/work/obj-fuzz/dist/include/mozilla/dom/HTMLTableCellElement.h
Line | Count | Source (jump to first uncovered line) |
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_HTMLTableCellElement_h |
7 | | #define mozilla_dom_HTMLTableCellElement_h |
8 | | |
9 | | #include "mozilla/Attributes.h" |
10 | | #include "nsGenericHTMLElement.h" |
11 | | |
12 | | namespace mozilla { |
13 | | namespace dom { |
14 | | |
15 | | class HTMLTableElement; |
16 | | |
17 | | class HTMLTableCellElement final : public nsGenericHTMLElement |
18 | | { |
19 | | public: |
20 | | explicit HTMLTableCellElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo) |
21 | | : nsGenericHTMLElement(std::move(aNodeInfo)) |
22 | 0 | { |
23 | 0 | SetHasWeirdParserInsertionMode(); |
24 | 0 | } |
25 | | |
26 | | // nsISupports |
27 | | NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLTableCellElement, |
28 | | nsGenericHTMLElement) |
29 | | |
30 | | uint32_t ColSpan() const |
31 | 0 | { |
32 | 0 | return GetIntAttr(nsGkAtoms::colspan, 1); |
33 | 0 | } |
34 | | void SetColSpan(uint32_t aColSpan, ErrorResult& aError) |
35 | 0 | { |
36 | 0 | SetUnsignedIntAttr(nsGkAtoms::colspan, aColSpan, 1, aError); |
37 | 0 | } |
38 | | uint32_t RowSpan() const |
39 | 0 | { |
40 | 0 | return GetIntAttr(nsGkAtoms::rowspan, 1); |
41 | 0 | } |
42 | | void SetRowSpan(uint32_t aRowSpan, ErrorResult& aError) |
43 | 0 | { |
44 | 0 | SetUnsignedIntAttr(nsGkAtoms::rowspan, aRowSpan, 1, aError); |
45 | 0 | } |
46 | | //already_AddRefed<nsDOMTokenList> Headers() const; |
47 | | void GetHeaders(DOMString& aHeaders) |
48 | 0 | { |
49 | 0 | GetHTMLAttr(nsGkAtoms::headers, aHeaders); |
50 | 0 | } |
51 | | void SetHeaders(const nsAString& aHeaders, ErrorResult& aError) |
52 | 0 | { |
53 | 0 | SetHTMLAttr(nsGkAtoms::headers, aHeaders, aError); |
54 | 0 | } |
55 | | int32_t CellIndex() const; |
56 | | |
57 | | void GetAbbr(DOMString& aAbbr) |
58 | 0 | { |
59 | 0 | GetHTMLAttr(nsGkAtoms::abbr, aAbbr); |
60 | 0 | } |
61 | | void SetAbbr(const nsAString& aAbbr, ErrorResult& aError) |
62 | 0 | { |
63 | 0 | SetHTMLAttr(nsGkAtoms::abbr, aAbbr, aError); |
64 | 0 | } |
65 | | void GetScope(DOMString& aScope); |
66 | | void SetScope(const nsAString& aScope, ErrorResult& aError) |
67 | 0 | { |
68 | 0 | SetHTMLAttr(nsGkAtoms::scope, aScope, aError); |
69 | 0 | } |
70 | | void GetAlign(DOMString& aAlign); |
71 | | void SetAlign(const nsAString& aAlign, ErrorResult& aError) |
72 | 0 | { |
73 | 0 | SetHTMLAttr(nsGkAtoms::align, aAlign, aError); |
74 | 0 | } |
75 | | void GetAxis(DOMString& aAxis) |
76 | 0 | { |
77 | 0 | GetHTMLAttr(nsGkAtoms::axis, aAxis); |
78 | 0 | } |
79 | | void SetAxis(const nsAString& aAxis, ErrorResult& aError) |
80 | 0 | { |
81 | 0 | SetHTMLAttr(nsGkAtoms::axis, aAxis, aError); |
82 | 0 | } |
83 | | void GetHeight(DOMString& aHeight) |
84 | 0 | { |
85 | 0 | GetHTMLAttr(nsGkAtoms::height, aHeight); |
86 | 0 | } |
87 | | void SetHeight(const nsAString& aHeight, ErrorResult& aError) |
88 | 0 | { |
89 | 0 | SetHTMLAttr(nsGkAtoms::height, aHeight, aError); |
90 | 0 | } |
91 | | void GetWidth(DOMString& aWidth) |
92 | 0 | { |
93 | 0 | GetHTMLAttr(nsGkAtoms::width, aWidth); |
94 | 0 | } |
95 | | void SetWidth(const nsAString& aWidth, ErrorResult& aError) |
96 | 0 | { |
97 | 0 | SetHTMLAttr(nsGkAtoms::width, aWidth, aError); |
98 | 0 | } |
99 | | void GetCh(DOMString& aCh) |
100 | 0 | { |
101 | 0 | GetHTMLAttr(nsGkAtoms::_char, aCh); |
102 | 0 | } |
103 | | void SetCh(const nsAString& aCh, ErrorResult& aError) |
104 | 0 | { |
105 | 0 | SetHTMLAttr(nsGkAtoms::_char, aCh, aError); |
106 | 0 | } |
107 | | void GetChOff(DOMString& aChOff) |
108 | 0 | { |
109 | 0 | GetHTMLAttr(nsGkAtoms::charoff, aChOff); |
110 | 0 | } |
111 | | void SetChOff(const nsAString& aChOff, ErrorResult& aError) |
112 | 0 | { |
113 | 0 | SetHTMLAttr(nsGkAtoms::charoff, aChOff, aError); |
114 | 0 | } |
115 | | bool NoWrap() |
116 | 0 | { |
117 | 0 | return GetBoolAttr(nsGkAtoms::nowrap); |
118 | 0 | } |
119 | | void SetNoWrap(bool aNoWrap, ErrorResult& aError) |
120 | 0 | { |
121 | 0 | SetHTMLBoolAttr(nsGkAtoms::nowrap, aNoWrap, aError); |
122 | 0 | } |
123 | | void GetVAlign(DOMString& aVAlign) |
124 | 0 | { |
125 | 0 | GetHTMLAttr(nsGkAtoms::valign, aVAlign); |
126 | 0 | } |
127 | | void SetVAlign(const nsAString& aVAlign, ErrorResult& aError) |
128 | 0 | { |
129 | 0 | SetHTMLAttr(nsGkAtoms::valign, aVAlign, aError); |
130 | 0 | } |
131 | | void GetBgColor(DOMString& aBgColor) |
132 | 0 | { |
133 | 0 | GetHTMLAttr(nsGkAtoms::bgcolor, aBgColor); |
134 | 0 | } |
135 | | void SetBgColor(const nsAString& aBgColor, ErrorResult& aError) |
136 | 0 | { |
137 | 0 | SetHTMLAttr(nsGkAtoms::bgcolor, aBgColor, aError); |
138 | 0 | } |
139 | | |
140 | | virtual bool ParseAttribute(int32_t aNamespaceID, |
141 | | nsAtom* aAttribute, |
142 | | const nsAString& aValue, |
143 | | nsIPrincipal* aMaybeScriptedPrincipal, |
144 | | nsAttrValue& aResult) override; |
145 | | virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; |
146 | | NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; |
147 | | // Get mapped attributes of ancestor table, if any |
148 | | nsMappedAttributes* GetMappedAttributesInheritedFromTable() const; |
149 | | |
150 | | virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override; |
151 | | |
152 | | protected: |
153 | | virtual ~HTMLTableCellElement(); |
154 | | |
155 | | virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override; |
156 | | |
157 | | HTMLTableElement* GetTable() const; |
158 | | |
159 | | HTMLTableRowElement* GetRow() const; |
160 | | |
161 | | private: |
162 | | static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes, |
163 | | MappedDeclarations&); |
164 | | }; |
165 | | |
166 | | } // namespace dom |
167 | | } // namespace mozilla |
168 | | |
169 | | #endif /* mozilla_dom_HTMLTableCellElement_h */ |