1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef HTMLDataListElement_h___
6 #define HTMLDataListElement_h___
8 #include "mozilla/Attributes.h"
9 #include "nsGenericHTMLElement.h"
10 #include "nsContentList.h"
15 class HTMLDataListElement MOZ_FINAL
: public nsGenericHTMLElement
18 explicit HTMLDataListElement(already_AddRefed
<mozilla::dom::NodeInfo
>& aNodeInfo
)
19 : nsGenericHTMLElement(aNodeInfo
)
24 NS_DECL_ISUPPORTS_INHERITED
26 nsContentList
* Options()
29 mOptions
= new nsContentList(this, MatchOptions
, nullptr, nullptr, true);
36 virtual nsresult
Clone(mozilla::dom::NodeInfo
*aNodeInfo
, nsINode
**aResult
) const MOZ_OVERRIDE
;
38 // This function is used to generate the nsContentList (option elements).
39 static bool MatchOptions(nsIContent
* aContent
, int32_t aNamespaceID
,
40 nsIAtom
* aAtom
, void* aData
);
42 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLDataListElement
,
45 virtual ~HTMLDataListElement();
47 virtual JSObject
* WrapNode(JSContext
*aCx
) MOZ_OVERRIDE
;
49 // <option>'s list inside the datalist element.
50 nsRefPtr
<nsContentList
> mOptions
;
54 } // namespace mozilla
56 #endif /* HTMLDataListElement_h___ */