Bug 1795723 - Unified extensions UI should support High Contrast Mode. r=ayeddi,deskt...
[gecko.git] / dom / html / HTMLFontElement.h
bloba2bf3c687f0fb3500ec3b0bcb2247432c9f2e850
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 {
15 public:
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 virtual 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 virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction()
38 const override;
39 virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
41 protected:
42 virtual ~HTMLFontElement();
44 virtual JSObject* WrapNode(JSContext* aCx,
45 JS::Handle<JSObject*> aGivenProto) override;
47 private:
48 static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
49 MappedDeclarations&);
52 } // namespace mozilla::dom
54 #endif /* HTMLFontElement_h___ */