1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef HTMLFontElement_h___
6 #define HTMLFontElement_h___
8 #include "mozilla/Attributes.h"
9 #include "nsGenericHTMLElement.h"
14 class HTMLFontElement MOZ_FINAL
: public nsGenericHTMLElement
17 explicit HTMLFontElement(already_AddRefed
<mozilla::dom::NodeInfo
>& aNodeInfo
)
18 : nsGenericHTMLElement(aNodeInfo
)
22 void GetColor(nsString
& aColor
)
24 GetHTMLAttr(nsGkAtoms::color
, aColor
);
26 void SetColor(const nsAString
& aColor
, ErrorResult
& aError
)
28 SetHTMLAttr(nsGkAtoms::color
, aColor
, aError
);
30 void GetFace(nsString
& aFace
)
32 GetHTMLAttr(nsGkAtoms::face
, aFace
);
34 void SetFace(const nsAString
& aFace
, ErrorResult
& aError
)
36 SetHTMLAttr(nsGkAtoms::face
, aFace
, aError
);
38 void GetSize(nsString
& aSize
)
40 GetHTMLAttr(nsGkAtoms::size
, aSize
);
42 void SetSize(const nsAString
& aSize
, ErrorResult
& aError
)
44 SetHTMLAttr(nsGkAtoms::size
, aSize
, aError
);
47 virtual bool ParseAttribute(int32_t aNamespaceID
,
49 const nsAString
& aValue
,
50 nsAttrValue
& aResult
) MOZ_OVERRIDE
;
51 NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom
* aAttribute
) const MOZ_OVERRIDE
;
52 virtual nsMapRuleToAttributesFunc
GetAttributeMappingFunction() const MOZ_OVERRIDE
;
53 virtual nsresult
Clone(mozilla::dom::NodeInfo
*aNodeInfo
, nsINode
**aResult
) const MOZ_OVERRIDE
;
56 virtual ~HTMLFontElement();
58 virtual JSObject
* WrapNode(JSContext
*aCx
) MOZ_OVERRIDE
;
61 static void MapAttributesIntoRule(const nsMappedAttributes
* aAttributes
,
66 } // namespace mozilla
68 #endif /* HTMLFontElement_h___ */