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