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_HTMLTableColElement_h
7 #define mozilla_dom_HTMLTableColElement_h
9 #include "mozilla/Attributes.h"
10 #include "nsGenericHTMLElement.h"
15 class HTMLTableColElement final
: public nsGenericHTMLElement
{
17 explicit HTMLTableColElement(
18 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
)
19 : nsGenericHTMLElement(std::move(aNodeInfo
)) {
20 SetHasWeirdParserInsertionMode();
23 uint32_t Span() const { return GetIntAttr(nsGkAtoms::span
, 1); }
24 void SetSpan(uint32_t aSpan
, ErrorResult
& aError
) {
25 SetUnsignedIntAttr(nsGkAtoms::span
, aSpan
, 1, aError
);
28 void GetAlign(DOMString
& aAlign
) { GetHTMLAttr(nsGkAtoms::align
, aAlign
); }
29 void SetAlign(const nsAString
& aAlign
, ErrorResult
& aError
) {
30 SetHTMLAttr(nsGkAtoms::align
, aAlign
, aError
);
32 void GetCh(DOMString
& aCh
) { GetHTMLAttr(nsGkAtoms::_char
, aCh
); }
33 void SetCh(const nsAString
& aCh
, ErrorResult
& aError
) {
34 SetHTMLAttr(nsGkAtoms::_char
, aCh
, aError
);
36 void GetChOff(DOMString
& aChOff
) { GetHTMLAttr(nsGkAtoms::charoff
, aChOff
); }
37 void SetChOff(const nsAString
& aChOff
, ErrorResult
& aError
) {
38 SetHTMLAttr(nsGkAtoms::charoff
, aChOff
, aError
);
40 void GetVAlign(DOMString
& aVAlign
) {
41 GetHTMLAttr(nsGkAtoms::valign
, aVAlign
);
43 void SetVAlign(const nsAString
& aVAlign
, ErrorResult
& aError
) {
44 SetHTMLAttr(nsGkAtoms::valign
, aVAlign
, aError
);
46 void GetWidth(DOMString
& aWidth
) { GetHTMLAttr(nsGkAtoms::width
, aWidth
); }
47 void SetWidth(const nsAString
& aWidth
, ErrorResult
& aError
) {
48 SetHTMLAttr(nsGkAtoms::width
, aWidth
, aError
);
51 virtual bool ParseAttribute(int32_t aNamespaceID
, nsAtom
* aAttribute
,
52 const nsAString
& aValue
,
53 nsIPrincipal
* aMaybeScriptedPrincipal
,
54 nsAttrValue
& aResult
) override
;
55 nsMapRuleToAttributesFunc
GetAttributeMappingFunction() const override
;
56 NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom
* aAttribute
) const override
;
58 virtual nsresult
Clone(dom::NodeInfo
*, nsINode
** aResult
) const override
;
61 virtual ~HTMLTableColElement();
63 virtual JSObject
* WrapNode(JSContext
* aCx
,
64 JS::Handle
<JSObject
*> aGivenProto
) override
;
67 static void MapAttributesIntoRule(const nsMappedAttributes
* aAttributes
,
72 } // namespace mozilla
74 #endif /* mozilla_dom_HTMLTableColElement_h */