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 HTMLFontElement_h___
7 #define HTMLFontElement_h___
9 #include "mozilla/Attributes.h"
10 #include "nsGenericHTMLElement.h"
15 class HTMLFontElement final
: public nsGenericHTMLElement
18 explicit HTMLFontElement(already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
)
19 : nsGenericHTMLElement(std::move(aNodeInfo
))
23 void GetColor(DOMString
& aColor
)
25 GetHTMLAttr(nsGkAtoms::color
, aColor
);
27 void SetColor(const nsAString
& aColor
, ErrorResult
& aError
)
29 SetHTMLAttr(nsGkAtoms::color
, aColor
, aError
);
31 void GetFace(DOMString
& aFace
)
33 GetHTMLAttr(nsGkAtoms::face
, aFace
);
35 void SetFace(const nsAString
& aFace
, ErrorResult
& aError
)
37 SetHTMLAttr(nsGkAtoms::face
, aFace
, aError
);
39 void GetSize(DOMString
& aSize
)
41 GetHTMLAttr(nsGkAtoms::size
, aSize
);
43 void SetSize(const nsAString
& aSize
, ErrorResult
& aError
)
45 SetHTMLAttr(nsGkAtoms::size
, aSize
, aError
);
48 virtual bool ParseAttribute(int32_t aNamespaceID
,
50 const nsAString
& aValue
,
51 nsIPrincipal
* aMaybeScriptedPrincipal
,
52 nsAttrValue
& aResult
) override
;
53 NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom
* aAttribute
) const override
;
54 virtual nsMapRuleToAttributesFunc
GetAttributeMappingFunction() const override
;
55 virtual nsresult
Clone(dom::NodeInfo
*, nsINode
** aResult
) const override
;
58 virtual ~HTMLFontElement();
60 virtual JSObject
* WrapNode(JSContext
*aCx
, JS::Handle
<JSObject
*> aGivenProto
) override
;
63 static void MapAttributesIntoRule(const nsMappedAttributes
* aAttributes
,
68 } // namespace mozilla
70 #endif /* HTMLFontElement_h___ */