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"
12 namespace mozilla::dom
{
14 class HTMLFontElement final
: public nsGenericHTMLElement
{
16 explicit HTMLFontElement(already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
)
17 : nsGenericHTMLElement(std::move(aNodeInfo
)) {}
19 void GetColor(DOMString
& aColor
) { GetHTMLAttr(nsGkAtoms::color
, aColor
); }
20 void SetColor(const nsAString
& aColor
, ErrorResult
& aError
) {
21 SetHTMLAttr(nsGkAtoms::color
, aColor
, aError
);
23 void GetFace(DOMString
& aFace
) { GetHTMLAttr(nsGkAtoms::face
, aFace
); }
24 void SetFace(const nsAString
& aFace
, ErrorResult
& aError
) {
25 SetHTMLAttr(nsGkAtoms::face
, aFace
, aError
);
27 void GetSize(DOMString
& aSize
) { GetHTMLAttr(nsGkAtoms::size
, aSize
); }
28 void SetSize(const nsAString
& aSize
, ErrorResult
& aError
) {
29 SetHTMLAttr(nsGkAtoms::size
, aSize
, aError
);
32 bool ParseAttribute(int32_t aNamespaceID
, nsAtom
* aAttribute
,
33 const nsAString
& aValue
,
34 nsIPrincipal
* aMaybeScriptedPrincipal
,
35 nsAttrValue
& aResult
) override
;
36 NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom
* aAttribute
) const override
;
37 nsMapRuleToAttributesFunc
GetAttributeMappingFunction() const override
;
38 nsresult
Clone(dom::NodeInfo
*, nsINode
** aResult
) const override
;
41 virtual ~HTMLFontElement();
43 JSObject
* WrapNode(JSContext
*, JS::Handle
<JSObject
*> aGivenProto
) override
;
46 static void MapAttributesIntoRule(MappedDeclarationsBuilder
&);
49 } // namespace mozilla::dom
51 #endif /* HTMLFontElement_h___ */