Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 : /* This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #ifndef mozilla_dom_HTMLLIElement_h
8 : #define mozilla_dom_HTMLLIElement_h
9 :
10 : #include "mozilla/Attributes.h"
11 :
12 : #include "nsIDOMHTMLLIElement.h"
13 : #include "nsGenericHTMLElement.h"
14 :
15 : namespace mozilla {
16 : namespace dom {
17 :
18 : class HTMLLIElement final : public nsGenericHTMLElement,
19 : public nsIDOMHTMLLIElement
20 : {
21 : public:
22 0 : explicit HTMLLIElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
23 0 : : nsGenericHTMLElement(aNodeInfo)
24 : {
25 0 : }
26 :
27 : // nsISupports
28 : NS_DECL_ISUPPORTS_INHERITED
29 :
30 : // nsIDOMHTMLLIElement
31 : NS_DECL_NSIDOMHTMLLIELEMENT
32 :
33 : virtual bool ParseAttribute(int32_t aNamespaceID,
34 : nsIAtom* aAttribute,
35 : const nsAString& aValue,
36 : nsAttrValue& aResult) override;
37 : NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const override;
38 : virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override;
39 : virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
40 : bool aPreallocateChildren) const override;
41 :
42 : // WebIDL API
43 0 : void GetType(DOMString& aType)
44 : {
45 0 : GetHTMLAttr(nsGkAtoms::type, aType);
46 0 : }
47 0 : void SetType(const nsAString& aType, mozilla::ErrorResult& rv)
48 : {
49 0 : SetHTMLAttr(nsGkAtoms::type, aType, rv);
50 0 : }
51 0 : int32_t Value() const
52 : {
53 0 : return GetIntAttr(nsGkAtoms::value, 0);
54 : }
55 0 : void SetValue(int32_t aValue, mozilla::ErrorResult& rv)
56 : {
57 0 : SetHTMLIntAttr(nsGkAtoms::value, aValue, rv);
58 0 : }
59 :
60 : protected:
61 : virtual ~HTMLLIElement();
62 :
63 : virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
64 :
65 : private:
66 : static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
67 : GenericSpecifiedValues* aGenericData);
68 : };
69 :
70 : } // namespace dom
71 : } // namespace mozilla
72 :
73 : #endif // mozilla_dom_HTMLLIElement_h
|