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"
12 namespace mozilla::dom
{
14 class HTMLDivElement final
: public nsGenericHTMLElement
{
16 explicit HTMLDivElement(already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
)
17 : nsGenericHTMLElement(std::move(aNodeInfo
)) {
18 MOZ_ASSERT(mNodeInfo
->Equals(nsGkAtoms::div
),
19 "HTMLDivElement should be a div");
22 void GetAlign(DOMString
& aAlign
) { GetHTMLAttr(nsGkAtoms::align
, aAlign
); }
23 void SetAlign(const nsAString
& aAlign
, mozilla::ErrorResult
& aError
) {
24 SetHTMLAttr(nsGkAtoms::align
, aAlign
, aError
);
27 bool ParseAttribute(int32_t aNamespaceID
, nsAtom
* aAttribute
,
28 const nsAString
& aValue
,
29 nsIPrincipal
* aMaybeScriptedPrincipal
,
30 nsAttrValue
& aResult
) override
;
31 NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom
* aAttribute
) const override
;
32 nsMapRuleToAttributesFunc
GetAttributeMappingFunction() const override
;
33 nsresult
Clone(dom::NodeInfo
*, nsINode
** aResult
) const override
;
36 virtual ~HTMLDivElement();
38 JSObject
* WrapNode(JSContext
*, JS::Handle
<JSObject
*> aGivenProto
) override
;
41 static void MapAttributesIntoRule(MappedDeclarationsBuilder
&);
44 } // namespace mozilla::dom
46 #endif /* HTMLDivElement_h___ */