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_HTMLHRElement_h
8 #define mozilla_dom_HTMLHRElement_h
10 #include "nsGenericHTMLElement.h"
12 namespace mozilla::dom
{
14 class HTMLHRElement final
: public nsGenericHTMLElement
{
16 explicit HTMLHRElement(already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
);
19 NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLHRElement
, nsGenericHTMLElement
)
21 bool ParseAttribute(int32_t aNamespaceID
, nsAtom
* aAttribute
,
22 const nsAString
& aValue
,
23 nsIPrincipal
* aMaybeScriptedPrincipal
,
24 nsAttrValue
& aResult
) override
;
25 NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom
* aAttribute
) const override
;
26 nsMapRuleToAttributesFunc
GetAttributeMappingFunction() const override
;
27 nsresult
Clone(dom::NodeInfo
*, nsINode
** aResult
) const override
;
30 void GetAlign(nsAString
& aValue
) const {
31 GetHTMLAttr(nsGkAtoms::align
, aValue
);
33 void SetAlign(const nsAString
& aAlign
, ErrorResult
& aError
) {
34 SetHTMLAttr(nsGkAtoms::align
, aAlign
, aError
);
37 void GetColor(nsAString
& aValue
) const {
38 GetHTMLAttr(nsGkAtoms::color
, aValue
);
40 void SetColor(const nsAString
& aColor
, ErrorResult
& aError
) {
41 SetHTMLAttr(nsGkAtoms::color
, aColor
, aError
);
44 bool NoShade() const { return GetBoolAttr(nsGkAtoms::noshade
); }
45 void SetNoShade(bool aNoShade
, ErrorResult
& aError
) {
46 SetHTMLBoolAttr(nsGkAtoms::noshade
, aNoShade
, aError
);
49 void GetSize(nsAString
& aValue
) const {
50 GetHTMLAttr(nsGkAtoms::size
, aValue
);
52 void SetSize(const nsAString
& aSize
, ErrorResult
& aError
) {
53 SetHTMLAttr(nsGkAtoms::size
, aSize
, aError
);
56 void GetWidth(nsAString
& aValue
) const {
57 GetHTMLAttr(nsGkAtoms::width
, aValue
);
59 void SetWidth(const nsAString
& aWidth
, ErrorResult
& aError
) {
60 SetHTMLAttr(nsGkAtoms::width
, aWidth
, aError
);
64 virtual ~HTMLHRElement();
66 JSObject
* WrapNode(JSContext
*, JS::Handle
<JSObject
*> aGivenProto
) override
;
69 static void MapAttributesIntoRule(MappedDeclarationsBuilder
&);
72 } // namespace mozilla::dom
74 #endif // mozilla_dom_HTMLHRElement_h