HTMLFontElement.h (1941B)
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___ 8 9 #include "nsGenericHTMLElement.h" 10 11 namespace mozilla::dom { 12 13 class HTMLFontElement final : public nsGenericHTMLElement { 14 public: 15 explicit HTMLFontElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo) 16 : nsGenericHTMLElement(std::move(aNodeInfo)) {} 17 18 void GetColor(DOMString& aColor) { GetHTMLAttr(nsGkAtoms::color, aColor); } 19 void SetColor(const nsAString& aColor, ErrorResult& aError) { 20 SetHTMLAttr(nsGkAtoms::color, aColor, aError); 21 } 22 void GetFace(DOMString& aFace) { GetHTMLAttr(nsGkAtoms::face, aFace); } 23 void SetFace(const nsAString& aFace, ErrorResult& aError) { 24 SetHTMLAttr(nsGkAtoms::face, aFace, aError); 25 } 26 void GetSize(DOMString& aSize) { GetHTMLAttr(nsGkAtoms::size, aSize); } 27 void SetSize(const nsAString& aSize, ErrorResult& aError) { 28 SetHTMLAttr(nsGkAtoms::size, aSize, aError); 29 } 30 31 bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, 32 const nsAString& aValue, 33 nsIPrincipal* aMaybeScriptedPrincipal, 34 nsAttrValue& aResult) override; 35 NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; 36 nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; 37 nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override; 38 39 protected: 40 virtual ~HTMLFontElement(); 41 42 JSObject* WrapNode(JSContext*, JS::Handle<JSObject*> aGivenProto) override; 43 44 private: 45 static void MapAttributesIntoRule(MappedDeclarationsBuilder&); 46 }; 47 48 } // namespace mozilla::dom 49 50 #endif /* HTMLFontElement_h___ */