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
{
17 explicit HTMLFontElement(already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
)
18 : nsGenericHTMLElement(std::move(aNodeInfo
)) {}
20 void GetColor(DOMString
& aColor
) { GetHTMLAttr(nsGkAtoms::color
, aColor
); }
21 void SetColor(const nsAString
& aColor
, ErrorResult
& aError
) {
22 SetHTMLAttr(nsGkAtoms::color
, aColor
, aError
);
24 void GetFace(DOMString
& aFace
) { GetHTMLAttr(nsGkAtoms::face
, aFace
); }
25 void SetFace(const nsAString
& aFace
, ErrorResult
& aError
) {
26 SetHTMLAttr(nsGkAtoms::face
, aFace
, aError
);
28 void GetSize(DOMString
& aSize
) { GetHTMLAttr(nsGkAtoms::size
, aSize
); }
29 void SetSize(const nsAString
& aSize
, ErrorResult
& aError
) {
30 SetHTMLAttr(nsGkAtoms::size
, aSize
, aError
);
33 virtual bool ParseAttribute(int32_t aNamespaceID
, nsAtom
* aAttribute
,
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()
40 virtual nsresult
Clone(dom::NodeInfo
*, nsINode
** aResult
) const override
;
43 virtual ~HTMLFontElement();
45 virtual JSObject
* WrapNode(JSContext
* aCx
,
46 JS::Handle
<JSObject
*> aGivenProto
) override
;
49 static void MapAttributesIntoRule(const nsMappedAttributes
* aAttributes
,
54 } // namespace mozilla
56 #endif /* HTMLFontElement_h___ */