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 #ifndef HTMLDivElement_h___
7 #define HTMLDivElement_h___
9 #include "mozilla/Attributes.h"
10 #include "nsGenericHTMLElement.h"
15 class HTMLDivElement final
: public nsGenericHTMLElement
18 explicit HTMLDivElement(already_AddRefed
<mozilla::dom::NodeInfo
>& aNodeInfo
)
19 : nsGenericHTMLElement(aNodeInfo
)
23 void GetAlign(DOMString
& aAlign
)
25 GetHTMLAttr(nsGkAtoms::align
, aAlign
);
27 void SetAlign(const nsAString
& aAlign
, mozilla::ErrorResult
& aError
)
29 SetHTMLAttr(nsGkAtoms::align
, aAlign
, aError
);
32 virtual bool ParseAttribute(int32_t aNamespaceID
,
34 const nsAString
& aValue
,
35 nsIPrincipal
* aMaybeScriptedPrincipal
,
36 nsAttrValue
& aResult
) override
;
37 NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom
* aAttribute
) const override
;
38 virtual nsMapRuleToAttributesFunc
GetAttributeMappingFunction() const override
;
39 virtual nsresult
Clone(mozilla::dom::NodeInfo
*aNodeInfo
, nsINode
**aResult
,
40 bool aPreallocateChildren
) const override
;
43 virtual ~HTMLDivElement();
45 virtual JSObject
* WrapNode(JSContext
*aCx
, JS::Handle
<JSObject
*> aGivenProto
) override
;
48 static void MapAttributesIntoRule(const nsMappedAttributes
* aAttributes
,
53 } // namespace mozilla
55 #endif /* HTMLDivElement_h___ */