Bumping gaia.json for 8 gaia revision(s) a=gaia-bump
[gecko.git] / dom / html / HTMLDataListElement.h
blob05708cc0b5d42fb00d8fa7933a9f450d52f838d4
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"
12 namespace mozilla {
13 namespace dom {
15 class HTMLDataListElement MOZ_FINAL : public nsGenericHTMLElement
17 public:
18 explicit HTMLDataListElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
19 : nsGenericHTMLElement(aNodeInfo)
23 // nsISupports
24 NS_DECL_ISUPPORTS_INHERITED
26 nsContentList* Options()
28 if (!mOptions) {
29 mOptions = new nsContentList(this, MatchOptions, nullptr, nullptr, true);
32 return mOptions;
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,
43 nsGenericHTMLElement)
44 protected:
45 virtual ~HTMLDataListElement();
47 virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE;
49 // <option>'s list inside the datalist element.
50 nsRefPtr<nsContentList> mOptions;
53 } // namespace dom
54 } // namespace mozilla
56 #endif /* HTMLDataListElement_h___ */