Backed out changeset 62f7af8fe549 (bug 1843981) for causing valgrind bustage. CLOSED...
[gecko.git] / dom / html / HTMLLIElement.h
blob8f2b52dd73e72fac460bdd11f9251d7563f77073
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/. */
7 #ifndef mozilla_dom_HTMLLIElement_h
8 #define mozilla_dom_HTMLLIElement_h
10 #include "mozilla/Attributes.h"
12 #include "nsGenericHTMLElement.h"
14 namespace mozilla::dom {
16 class HTMLLIElement final : public nsGenericHTMLElement {
17 public:
18 explicit HTMLLIElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
19 : nsGenericHTMLElement(std::move(aNodeInfo)) {}
21 // nsISupports
22 NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLLIElement, nsGenericHTMLElement)
24 bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
25 const nsAString& aValue,
26 nsIPrincipal* aMaybeScriptedPrincipal,
27 nsAttrValue& aResult) override;
28 NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
29 nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override;
30 nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
32 // WebIDL API
33 void GetType(DOMString& aType) { GetHTMLAttr(nsGkAtoms::type, aType); }
34 void SetType(const nsAString& aType, mozilla::ErrorResult& rv) {
35 SetHTMLAttr(nsGkAtoms::type, aType, rv);
37 int32_t Value() const { return GetIntAttr(nsGkAtoms::value, 0); }
38 void SetValue(int32_t aValue, mozilla::ErrorResult& rv) {
39 SetHTMLIntAttr(nsGkAtoms::value, aValue, rv);
42 protected:
43 virtual ~HTMLLIElement();
45 JSObject* WrapNode(JSContext*, JS::Handle<JSObject*> aGivenProto) override;
47 private:
48 static void MapAttributesIntoRule(MappedDeclarationsBuilder&);
51 } // namespace mozilla::dom
53 #endif // mozilla_dom_HTMLLIElement_h