/work/obj-fuzz/dom/bindings/HTMLTableCellElementBinding.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM HTMLTableCellElement.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #include "HTMLElementBinding.h" |
4 | | #include "HTMLTableCellElementBinding.h" |
5 | | #include "WrapperFactory.h" |
6 | | #include "mozilla/OwningNonNull.h" |
7 | | #include "mozilla/dom/BindingUtils.h" |
8 | | #include "mozilla/dom/CustomElementRegistry.h" |
9 | | #include "mozilla/dom/DOMJSClass.h" |
10 | | #include "mozilla/dom/DocGroup.h" |
11 | | #include "mozilla/dom/HTMLTableCellElement.h" |
12 | | #include "mozilla/dom/NonRefcountedDOMObject.h" |
13 | | #include "mozilla/dom/PrimitiveConversions.h" |
14 | | #include "mozilla/dom/XrayExpandoClass.h" |
15 | | |
16 | | namespace mozilla { |
17 | | namespace dom { |
18 | | |
19 | | namespace binding_detail {}; // Just to make sure it's known as a namespace |
20 | | using namespace mozilla::dom::binding_detail; |
21 | | |
22 | | |
23 | | namespace HTMLTableCellElement_Binding { |
24 | | |
25 | | static_assert(IsRefcounted<NativeType>::value == IsRefcounted<HTMLElement_Binding::NativeType>::value, |
26 | | "Can't inherit from an interface with a different ownership model."); |
27 | | |
28 | | MOZ_CAN_RUN_SCRIPT static bool |
29 | | get_colSpan(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitGetterCallArgs args) |
30 | 0 | { |
31 | 0 | AUTO_PROFILER_LABEL_FAST("get HTMLTableCellElement.colSpan", DOM, cx); |
32 | 0 |
|
33 | 0 | uint32_t result(self->ColSpan()); |
34 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
35 | 0 | args.rval().setNumber(result); |
36 | 0 | return true; |
37 | 0 | } |
38 | | |
39 | | MOZ_CAN_RUN_SCRIPT static bool |
40 | | set_colSpan(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitSetterCallArgs args) |
41 | 0 | { |
42 | 0 | AUTO_PROFILER_LABEL_FAST("set HTMLTableCellElement.colSpan", DOM, cx); |
43 | 0 |
|
44 | 0 | uint32_t arg0; |
45 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
46 | 0 | return false; |
47 | 0 | } |
48 | 0 | Maybe<AutoCEReaction> ceReaction; |
49 | 0 | if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) { |
50 | 0 | DocGroup* docGroup = self->GetDocGroup(); |
51 | 0 | if (docGroup) { |
52 | 0 | ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); |
53 | 0 | } |
54 | 0 | } |
55 | 0 | FastErrorResult rv; |
56 | 0 | self->SetColSpan(arg0, rv); |
57 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
58 | 0 | return false; |
59 | 0 | } |
60 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
61 | 0 |
|
62 | 0 | return true; |
63 | 0 | } |
64 | | |
65 | | static const JSJitInfo colSpan_getterinfo = { |
66 | | { (JSJitGetterOp)get_colSpan }, |
67 | | { prototypes::id::HTMLTableCellElement }, |
68 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
69 | | JSJitInfo::Getter, |
70 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
71 | | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ |
72 | | true, /* isInfallible. False in setters. */ |
73 | | false, /* isMovable. Not relevant for setters. */ |
74 | | false, /* isEliminatable. Not relevant for setters. */ |
75 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
76 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
77 | | false, /* isTypedMethod. Only relevant for methods. */ |
78 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
79 | | }; |
80 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
81 | | static_assert(0 < 1, "There is no slot for us"); |
82 | | static const JSJitInfo colSpan_setterinfo = { |
83 | | { (JSJitGetterOp)set_colSpan }, |
84 | | { prototypes::id::HTMLTableCellElement }, |
85 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
86 | | JSJitInfo::Setter, |
87 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
88 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
89 | | false, /* isInfallible. False in setters. */ |
90 | | false, /* isMovable. Not relevant for setters. */ |
91 | | false, /* isEliminatable. Not relevant for setters. */ |
92 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
93 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
94 | | false, /* isTypedMethod. Only relevant for methods. */ |
95 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
96 | | }; |
97 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
98 | | static_assert(0 < 1, "There is no slot for us"); |
99 | | |
100 | | MOZ_CAN_RUN_SCRIPT static bool |
101 | | get_rowSpan(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitGetterCallArgs args) |
102 | 0 | { |
103 | 0 | AUTO_PROFILER_LABEL_FAST("get HTMLTableCellElement.rowSpan", DOM, cx); |
104 | 0 |
|
105 | 0 | uint32_t result(self->RowSpan()); |
106 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
107 | 0 | args.rval().setNumber(result); |
108 | 0 | return true; |
109 | 0 | } |
110 | | |
111 | | MOZ_CAN_RUN_SCRIPT static bool |
112 | | set_rowSpan(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitSetterCallArgs args) |
113 | 0 | { |
114 | 0 | AUTO_PROFILER_LABEL_FAST("set HTMLTableCellElement.rowSpan", DOM, cx); |
115 | 0 |
|
116 | 0 | uint32_t arg0; |
117 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
118 | 0 | return false; |
119 | 0 | } |
120 | 0 | Maybe<AutoCEReaction> ceReaction; |
121 | 0 | if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) { |
122 | 0 | DocGroup* docGroup = self->GetDocGroup(); |
123 | 0 | if (docGroup) { |
124 | 0 | ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); |
125 | 0 | } |
126 | 0 | } |
127 | 0 | FastErrorResult rv; |
128 | 0 | self->SetRowSpan(arg0, rv); |
129 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
130 | 0 | return false; |
131 | 0 | } |
132 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
133 | 0 |
|
134 | 0 | return true; |
135 | 0 | } |
136 | | |
137 | | static const JSJitInfo rowSpan_getterinfo = { |
138 | | { (JSJitGetterOp)get_rowSpan }, |
139 | | { prototypes::id::HTMLTableCellElement }, |
140 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
141 | | JSJitInfo::Getter, |
142 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
143 | | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ |
144 | | true, /* isInfallible. False in setters. */ |
145 | | false, /* isMovable. Not relevant for setters. */ |
146 | | false, /* isEliminatable. Not relevant for setters. */ |
147 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
148 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
149 | | false, /* isTypedMethod. Only relevant for methods. */ |
150 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
151 | | }; |
152 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
153 | | static_assert(0 < 1, "There is no slot for us"); |
154 | | static const JSJitInfo rowSpan_setterinfo = { |
155 | | { (JSJitGetterOp)set_rowSpan }, |
156 | | { prototypes::id::HTMLTableCellElement }, |
157 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
158 | | JSJitInfo::Setter, |
159 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
160 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
161 | | false, /* isInfallible. False in setters. */ |
162 | | false, /* isMovable. Not relevant for setters. */ |
163 | | false, /* isEliminatable. Not relevant for setters. */ |
164 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
165 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
166 | | false, /* isTypedMethod. Only relevant for methods. */ |
167 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
168 | | }; |
169 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
170 | | static_assert(0 < 1, "There is no slot for us"); |
171 | | |
172 | | MOZ_CAN_RUN_SCRIPT static bool |
173 | | get_headers(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitGetterCallArgs args) |
174 | 0 | { |
175 | 0 | AUTO_PROFILER_LABEL_FAST("get HTMLTableCellElement.headers", DOM, cx); |
176 | 0 |
|
177 | 0 | DOMString result; |
178 | 0 | self->GetHeaders(result); |
179 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
180 | 0 | if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { |
181 | 0 | return false; |
182 | 0 | } |
183 | 0 | return true; |
184 | 0 | } |
185 | | |
186 | | MOZ_CAN_RUN_SCRIPT static bool |
187 | | set_headers(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitSetterCallArgs args) |
188 | 0 | { |
189 | 0 | AUTO_PROFILER_LABEL_FAST("set HTMLTableCellElement.headers", DOM, cx); |
190 | 0 |
|
191 | 0 | binding_detail::FakeString arg0; |
192 | 0 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { |
193 | 0 | return false; |
194 | 0 | } |
195 | 0 | Maybe<AutoCEReaction> ceReaction; |
196 | 0 | if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) { |
197 | 0 | DocGroup* docGroup = self->GetDocGroup(); |
198 | 0 | if (docGroup) { |
199 | 0 | ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); |
200 | 0 | } |
201 | 0 | } |
202 | 0 | FastErrorResult rv; |
203 | 0 | self->SetHeaders(NonNullHelper(Constify(arg0)), rv); |
204 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
205 | 0 | return false; |
206 | 0 | } |
207 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
208 | 0 |
|
209 | 0 | return true; |
210 | 0 | } |
211 | | |
212 | | static const JSJitInfo headers_getterinfo = { |
213 | | { (JSJitGetterOp)get_headers }, |
214 | | { prototypes::id::HTMLTableCellElement }, |
215 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
216 | | JSJitInfo::Getter, |
217 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
218 | | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ |
219 | | false, /* isInfallible. False in setters. */ |
220 | | false, /* isMovable. Not relevant for setters. */ |
221 | | false, /* isEliminatable. Not relevant for setters. */ |
222 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
223 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
224 | | false, /* isTypedMethod. Only relevant for methods. */ |
225 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
226 | | }; |
227 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
228 | | static_assert(0 < 1, "There is no slot for us"); |
229 | | static const JSJitInfo headers_setterinfo = { |
230 | | { (JSJitGetterOp)set_headers }, |
231 | | { prototypes::id::HTMLTableCellElement }, |
232 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
233 | | JSJitInfo::Setter, |
234 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
235 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
236 | | false, /* isInfallible. False in setters. */ |
237 | | false, /* isMovable. Not relevant for setters. */ |
238 | | false, /* isEliminatable. Not relevant for setters. */ |
239 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
240 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
241 | | false, /* isTypedMethod. Only relevant for methods. */ |
242 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
243 | | }; |
244 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
245 | | static_assert(0 < 1, "There is no slot for us"); |
246 | | |
247 | | MOZ_CAN_RUN_SCRIPT static bool |
248 | | get_cellIndex(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitGetterCallArgs args) |
249 | 0 | { |
250 | 0 | AUTO_PROFILER_LABEL_FAST("get HTMLTableCellElement.cellIndex", DOM, cx); |
251 | 0 |
|
252 | 0 | int32_t result(self->CellIndex()); |
253 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
254 | 0 | args.rval().setInt32(int32_t(result)); |
255 | 0 | return true; |
256 | 0 | } |
257 | | |
258 | | static const JSJitInfo cellIndex_getterinfo = { |
259 | | { (JSJitGetterOp)get_cellIndex }, |
260 | | { prototypes::id::HTMLTableCellElement }, |
261 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
262 | | JSJitInfo::Getter, |
263 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
264 | | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ |
265 | | true, /* isInfallible. False in setters. */ |
266 | | false, /* isMovable. Not relevant for setters. */ |
267 | | false, /* isEliminatable. Not relevant for setters. */ |
268 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
269 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
270 | | false, /* isTypedMethod. Only relevant for methods. */ |
271 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
272 | | }; |
273 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
274 | | static_assert(0 < 1, "There is no slot for us"); |
275 | | |
276 | | MOZ_CAN_RUN_SCRIPT static bool |
277 | | get_abbr(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitGetterCallArgs args) |
278 | 0 | { |
279 | 0 | AUTO_PROFILER_LABEL_FAST("get HTMLTableCellElement.abbr", DOM, cx); |
280 | 0 |
|
281 | 0 | DOMString result; |
282 | 0 | self->GetAbbr(result); |
283 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
284 | 0 | if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { |
285 | 0 | return false; |
286 | 0 | } |
287 | 0 | return true; |
288 | 0 | } |
289 | | |
290 | | MOZ_CAN_RUN_SCRIPT static bool |
291 | | set_abbr(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitSetterCallArgs args) |
292 | 0 | { |
293 | 0 | AUTO_PROFILER_LABEL_FAST("set HTMLTableCellElement.abbr", DOM, cx); |
294 | 0 |
|
295 | 0 | binding_detail::FakeString arg0; |
296 | 0 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { |
297 | 0 | return false; |
298 | 0 | } |
299 | 0 | Maybe<AutoCEReaction> ceReaction; |
300 | 0 | if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) { |
301 | 0 | DocGroup* docGroup = self->GetDocGroup(); |
302 | 0 | if (docGroup) { |
303 | 0 | ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); |
304 | 0 | } |
305 | 0 | } |
306 | 0 | FastErrorResult rv; |
307 | 0 | self->SetAbbr(NonNullHelper(Constify(arg0)), rv); |
308 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
309 | 0 | return false; |
310 | 0 | } |
311 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
312 | 0 |
|
313 | 0 | return true; |
314 | 0 | } |
315 | | |
316 | | static const JSJitInfo abbr_getterinfo = { |
317 | | { (JSJitGetterOp)get_abbr }, |
318 | | { prototypes::id::HTMLTableCellElement }, |
319 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
320 | | JSJitInfo::Getter, |
321 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
322 | | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ |
323 | | false, /* isInfallible. False in setters. */ |
324 | | false, /* isMovable. Not relevant for setters. */ |
325 | | false, /* isEliminatable. Not relevant for setters. */ |
326 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
327 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
328 | | false, /* isTypedMethod. Only relevant for methods. */ |
329 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
330 | | }; |
331 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
332 | | static_assert(0 < 1, "There is no slot for us"); |
333 | | static const JSJitInfo abbr_setterinfo = { |
334 | | { (JSJitGetterOp)set_abbr }, |
335 | | { prototypes::id::HTMLTableCellElement }, |
336 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
337 | | JSJitInfo::Setter, |
338 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
339 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
340 | | false, /* isInfallible. False in setters. */ |
341 | | false, /* isMovable. Not relevant for setters. */ |
342 | | false, /* isEliminatable. Not relevant for setters. */ |
343 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
344 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
345 | | false, /* isTypedMethod. Only relevant for methods. */ |
346 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
347 | | }; |
348 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
349 | | static_assert(0 < 1, "There is no slot for us"); |
350 | | |
351 | | MOZ_CAN_RUN_SCRIPT static bool |
352 | | get_scope(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitGetterCallArgs args) |
353 | 0 | { |
354 | 0 | AUTO_PROFILER_LABEL_FAST("get HTMLTableCellElement.scope", DOM, cx); |
355 | 0 |
|
356 | 0 | DOMString result; |
357 | 0 | self->GetScope(result); |
358 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
359 | 0 | if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { |
360 | 0 | return false; |
361 | 0 | } |
362 | 0 | return true; |
363 | 0 | } |
364 | | |
365 | | MOZ_CAN_RUN_SCRIPT static bool |
366 | | set_scope(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitSetterCallArgs args) |
367 | 0 | { |
368 | 0 | AUTO_PROFILER_LABEL_FAST("set HTMLTableCellElement.scope", DOM, cx); |
369 | 0 |
|
370 | 0 | binding_detail::FakeString arg0; |
371 | 0 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { |
372 | 0 | return false; |
373 | 0 | } |
374 | 0 | Maybe<AutoCEReaction> ceReaction; |
375 | 0 | if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) { |
376 | 0 | DocGroup* docGroup = self->GetDocGroup(); |
377 | 0 | if (docGroup) { |
378 | 0 | ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); |
379 | 0 | } |
380 | 0 | } |
381 | 0 | FastErrorResult rv; |
382 | 0 | self->SetScope(NonNullHelper(Constify(arg0)), rv); |
383 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
384 | 0 | return false; |
385 | 0 | } |
386 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
387 | 0 |
|
388 | 0 | return true; |
389 | 0 | } |
390 | | |
391 | | static const JSJitInfo scope_getterinfo = { |
392 | | { (JSJitGetterOp)get_scope }, |
393 | | { prototypes::id::HTMLTableCellElement }, |
394 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
395 | | JSJitInfo::Getter, |
396 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
397 | | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ |
398 | | false, /* isInfallible. False in setters. */ |
399 | | false, /* isMovable. Not relevant for setters. */ |
400 | | false, /* isEliminatable. Not relevant for setters. */ |
401 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
402 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
403 | | false, /* isTypedMethod. Only relevant for methods. */ |
404 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
405 | | }; |
406 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
407 | | static_assert(0 < 1, "There is no slot for us"); |
408 | | static const JSJitInfo scope_setterinfo = { |
409 | | { (JSJitGetterOp)set_scope }, |
410 | | { prototypes::id::HTMLTableCellElement }, |
411 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
412 | | JSJitInfo::Setter, |
413 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
414 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
415 | | false, /* isInfallible. False in setters. */ |
416 | | false, /* isMovable. Not relevant for setters. */ |
417 | | false, /* isEliminatable. Not relevant for setters. */ |
418 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
419 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
420 | | false, /* isTypedMethod. Only relevant for methods. */ |
421 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
422 | | }; |
423 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
424 | | static_assert(0 < 1, "There is no slot for us"); |
425 | | |
426 | | MOZ_CAN_RUN_SCRIPT static bool |
427 | | get_align(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitGetterCallArgs args) |
428 | 0 | { |
429 | 0 | AUTO_PROFILER_LABEL_FAST("get HTMLTableCellElement.align", DOM, cx); |
430 | 0 |
|
431 | 0 | DOMString result; |
432 | 0 | self->GetAlign(result); |
433 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
434 | 0 | if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { |
435 | 0 | return false; |
436 | 0 | } |
437 | 0 | return true; |
438 | 0 | } |
439 | | |
440 | | MOZ_CAN_RUN_SCRIPT static bool |
441 | | set_align(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitSetterCallArgs args) |
442 | 0 | { |
443 | 0 | AUTO_PROFILER_LABEL_FAST("set HTMLTableCellElement.align", DOM, cx); |
444 | 0 |
|
445 | 0 | binding_detail::FakeString arg0; |
446 | 0 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { |
447 | 0 | return false; |
448 | 0 | } |
449 | 0 | Maybe<AutoCEReaction> ceReaction; |
450 | 0 | if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) { |
451 | 0 | DocGroup* docGroup = self->GetDocGroup(); |
452 | 0 | if (docGroup) { |
453 | 0 | ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); |
454 | 0 | } |
455 | 0 | } |
456 | 0 | FastErrorResult rv; |
457 | 0 | self->SetAlign(NonNullHelper(Constify(arg0)), rv); |
458 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
459 | 0 | return false; |
460 | 0 | } |
461 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
462 | 0 |
|
463 | 0 | return true; |
464 | 0 | } |
465 | | |
466 | | static const JSJitInfo align_getterinfo = { |
467 | | { (JSJitGetterOp)get_align }, |
468 | | { prototypes::id::HTMLTableCellElement }, |
469 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
470 | | JSJitInfo::Getter, |
471 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
472 | | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ |
473 | | false, /* isInfallible. False in setters. */ |
474 | | false, /* isMovable. Not relevant for setters. */ |
475 | | false, /* isEliminatable. Not relevant for setters. */ |
476 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
477 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
478 | | false, /* isTypedMethod. Only relevant for methods. */ |
479 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
480 | | }; |
481 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
482 | | static_assert(0 < 1, "There is no slot for us"); |
483 | | static const JSJitInfo align_setterinfo = { |
484 | | { (JSJitGetterOp)set_align }, |
485 | | { prototypes::id::HTMLTableCellElement }, |
486 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
487 | | JSJitInfo::Setter, |
488 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
489 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
490 | | false, /* isInfallible. False in setters. */ |
491 | | false, /* isMovable. Not relevant for setters. */ |
492 | | false, /* isEliminatable. Not relevant for setters. */ |
493 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
494 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
495 | | false, /* isTypedMethod. Only relevant for methods. */ |
496 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
497 | | }; |
498 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
499 | | static_assert(0 < 1, "There is no slot for us"); |
500 | | |
501 | | MOZ_CAN_RUN_SCRIPT static bool |
502 | | get_axis(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitGetterCallArgs args) |
503 | 0 | { |
504 | 0 | AUTO_PROFILER_LABEL_FAST("get HTMLTableCellElement.axis", DOM, cx); |
505 | 0 |
|
506 | 0 | DOMString result; |
507 | 0 | self->GetAxis(result); |
508 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
509 | 0 | if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { |
510 | 0 | return false; |
511 | 0 | } |
512 | 0 | return true; |
513 | 0 | } |
514 | | |
515 | | MOZ_CAN_RUN_SCRIPT static bool |
516 | | set_axis(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitSetterCallArgs args) |
517 | 0 | { |
518 | 0 | AUTO_PROFILER_LABEL_FAST("set HTMLTableCellElement.axis", DOM, cx); |
519 | 0 |
|
520 | 0 | binding_detail::FakeString arg0; |
521 | 0 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { |
522 | 0 | return false; |
523 | 0 | } |
524 | 0 | Maybe<AutoCEReaction> ceReaction; |
525 | 0 | if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) { |
526 | 0 | DocGroup* docGroup = self->GetDocGroup(); |
527 | 0 | if (docGroup) { |
528 | 0 | ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); |
529 | 0 | } |
530 | 0 | } |
531 | 0 | FastErrorResult rv; |
532 | 0 | self->SetAxis(NonNullHelper(Constify(arg0)), rv); |
533 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
534 | 0 | return false; |
535 | 0 | } |
536 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
537 | 0 |
|
538 | 0 | return true; |
539 | 0 | } |
540 | | |
541 | | static const JSJitInfo axis_getterinfo = { |
542 | | { (JSJitGetterOp)get_axis }, |
543 | | { prototypes::id::HTMLTableCellElement }, |
544 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
545 | | JSJitInfo::Getter, |
546 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
547 | | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ |
548 | | false, /* isInfallible. False in setters. */ |
549 | | false, /* isMovable. Not relevant for setters. */ |
550 | | false, /* isEliminatable. Not relevant for setters. */ |
551 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
552 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
553 | | false, /* isTypedMethod. Only relevant for methods. */ |
554 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
555 | | }; |
556 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
557 | | static_assert(0 < 1, "There is no slot for us"); |
558 | | static const JSJitInfo axis_setterinfo = { |
559 | | { (JSJitGetterOp)set_axis }, |
560 | | { prototypes::id::HTMLTableCellElement }, |
561 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
562 | | JSJitInfo::Setter, |
563 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
564 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
565 | | false, /* isInfallible. False in setters. */ |
566 | | false, /* isMovable. Not relevant for setters. */ |
567 | | false, /* isEliminatable. Not relevant for setters. */ |
568 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
569 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
570 | | false, /* isTypedMethod. Only relevant for methods. */ |
571 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
572 | | }; |
573 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
574 | | static_assert(0 < 1, "There is no slot for us"); |
575 | | |
576 | | MOZ_CAN_RUN_SCRIPT static bool |
577 | | get_height(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitGetterCallArgs args) |
578 | 0 | { |
579 | 0 | AUTO_PROFILER_LABEL_FAST("get HTMLTableCellElement.height", DOM, cx); |
580 | 0 |
|
581 | 0 | DOMString result; |
582 | 0 | self->GetHeight(result); |
583 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
584 | 0 | if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { |
585 | 0 | return false; |
586 | 0 | } |
587 | 0 | return true; |
588 | 0 | } |
589 | | |
590 | | MOZ_CAN_RUN_SCRIPT static bool |
591 | | set_height(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitSetterCallArgs args) |
592 | 0 | { |
593 | 0 | AUTO_PROFILER_LABEL_FAST("set HTMLTableCellElement.height", DOM, cx); |
594 | 0 |
|
595 | 0 | binding_detail::FakeString arg0; |
596 | 0 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { |
597 | 0 | return false; |
598 | 0 | } |
599 | 0 | Maybe<AutoCEReaction> ceReaction; |
600 | 0 | if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) { |
601 | 0 | DocGroup* docGroup = self->GetDocGroup(); |
602 | 0 | if (docGroup) { |
603 | 0 | ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); |
604 | 0 | } |
605 | 0 | } |
606 | 0 | FastErrorResult rv; |
607 | 0 | self->SetHeight(NonNullHelper(Constify(arg0)), rv); |
608 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
609 | 0 | return false; |
610 | 0 | } |
611 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
612 | 0 |
|
613 | 0 | return true; |
614 | 0 | } |
615 | | |
616 | | static const JSJitInfo height_getterinfo = { |
617 | | { (JSJitGetterOp)get_height }, |
618 | | { prototypes::id::HTMLTableCellElement }, |
619 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
620 | | JSJitInfo::Getter, |
621 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
622 | | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ |
623 | | false, /* isInfallible. False in setters. */ |
624 | | false, /* isMovable. Not relevant for setters. */ |
625 | | false, /* isEliminatable. Not relevant for setters. */ |
626 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
627 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
628 | | false, /* isTypedMethod. Only relevant for methods. */ |
629 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
630 | | }; |
631 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
632 | | static_assert(0 < 1, "There is no slot for us"); |
633 | | static const JSJitInfo height_setterinfo = { |
634 | | { (JSJitGetterOp)set_height }, |
635 | | { prototypes::id::HTMLTableCellElement }, |
636 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
637 | | JSJitInfo::Setter, |
638 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
639 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
640 | | false, /* isInfallible. False in setters. */ |
641 | | false, /* isMovable. Not relevant for setters. */ |
642 | | false, /* isEliminatable. Not relevant for setters. */ |
643 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
644 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
645 | | false, /* isTypedMethod. Only relevant for methods. */ |
646 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
647 | | }; |
648 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
649 | | static_assert(0 < 1, "There is no slot for us"); |
650 | | |
651 | | MOZ_CAN_RUN_SCRIPT static bool |
652 | | get_width(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitGetterCallArgs args) |
653 | 0 | { |
654 | 0 | AUTO_PROFILER_LABEL_FAST("get HTMLTableCellElement.width", DOM, cx); |
655 | 0 |
|
656 | 0 | DOMString result; |
657 | 0 | self->GetWidth(result); |
658 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
659 | 0 | if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { |
660 | 0 | return false; |
661 | 0 | } |
662 | 0 | return true; |
663 | 0 | } |
664 | | |
665 | | MOZ_CAN_RUN_SCRIPT static bool |
666 | | set_width(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitSetterCallArgs args) |
667 | 0 | { |
668 | 0 | AUTO_PROFILER_LABEL_FAST("set HTMLTableCellElement.width", DOM, cx); |
669 | 0 |
|
670 | 0 | binding_detail::FakeString arg0; |
671 | 0 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { |
672 | 0 | return false; |
673 | 0 | } |
674 | 0 | Maybe<AutoCEReaction> ceReaction; |
675 | 0 | if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) { |
676 | 0 | DocGroup* docGroup = self->GetDocGroup(); |
677 | 0 | if (docGroup) { |
678 | 0 | ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); |
679 | 0 | } |
680 | 0 | } |
681 | 0 | FastErrorResult rv; |
682 | 0 | self->SetWidth(NonNullHelper(Constify(arg0)), rv); |
683 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
684 | 0 | return false; |
685 | 0 | } |
686 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
687 | 0 |
|
688 | 0 | return true; |
689 | 0 | } |
690 | | |
691 | | static const JSJitInfo width_getterinfo = { |
692 | | { (JSJitGetterOp)get_width }, |
693 | | { prototypes::id::HTMLTableCellElement }, |
694 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
695 | | JSJitInfo::Getter, |
696 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
697 | | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ |
698 | | false, /* isInfallible. False in setters. */ |
699 | | false, /* isMovable. Not relevant for setters. */ |
700 | | false, /* isEliminatable. Not relevant for setters. */ |
701 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
702 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
703 | | false, /* isTypedMethod. Only relevant for methods. */ |
704 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
705 | | }; |
706 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
707 | | static_assert(0 < 1, "There is no slot for us"); |
708 | | static const JSJitInfo width_setterinfo = { |
709 | | { (JSJitGetterOp)set_width }, |
710 | | { prototypes::id::HTMLTableCellElement }, |
711 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
712 | | JSJitInfo::Setter, |
713 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
714 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
715 | | false, /* isInfallible. False in setters. */ |
716 | | false, /* isMovable. Not relevant for setters. */ |
717 | | false, /* isEliminatable. Not relevant for setters. */ |
718 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
719 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
720 | | false, /* isTypedMethod. Only relevant for methods. */ |
721 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
722 | | }; |
723 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
724 | | static_assert(0 < 1, "There is no slot for us"); |
725 | | |
726 | | MOZ_CAN_RUN_SCRIPT static bool |
727 | | get_ch(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitGetterCallArgs args) |
728 | 0 | { |
729 | 0 | AUTO_PROFILER_LABEL_FAST("get HTMLTableCellElement.ch", DOM, cx); |
730 | 0 |
|
731 | 0 | DOMString result; |
732 | 0 | self->GetCh(result); |
733 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
734 | 0 | if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { |
735 | 0 | return false; |
736 | 0 | } |
737 | 0 | return true; |
738 | 0 | } |
739 | | |
740 | | MOZ_CAN_RUN_SCRIPT static bool |
741 | | set_ch(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitSetterCallArgs args) |
742 | 0 | { |
743 | 0 | AUTO_PROFILER_LABEL_FAST("set HTMLTableCellElement.ch", DOM, cx); |
744 | 0 |
|
745 | 0 | binding_detail::FakeString arg0; |
746 | 0 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { |
747 | 0 | return false; |
748 | 0 | } |
749 | 0 | Maybe<AutoCEReaction> ceReaction; |
750 | 0 | if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) { |
751 | 0 | DocGroup* docGroup = self->GetDocGroup(); |
752 | 0 | if (docGroup) { |
753 | 0 | ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); |
754 | 0 | } |
755 | 0 | } |
756 | 0 | FastErrorResult rv; |
757 | 0 | self->SetCh(NonNullHelper(Constify(arg0)), rv); |
758 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
759 | 0 | return false; |
760 | 0 | } |
761 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
762 | 0 |
|
763 | 0 | return true; |
764 | 0 | } |
765 | | |
766 | | static const JSJitInfo ch_getterinfo = { |
767 | | { (JSJitGetterOp)get_ch }, |
768 | | { prototypes::id::HTMLTableCellElement }, |
769 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
770 | | JSJitInfo::Getter, |
771 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
772 | | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ |
773 | | false, /* isInfallible. False in setters. */ |
774 | | false, /* isMovable. Not relevant for setters. */ |
775 | | false, /* isEliminatable. Not relevant for setters. */ |
776 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
777 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
778 | | false, /* isTypedMethod. Only relevant for methods. */ |
779 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
780 | | }; |
781 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
782 | | static_assert(0 < 1, "There is no slot for us"); |
783 | | static const JSJitInfo ch_setterinfo = { |
784 | | { (JSJitGetterOp)set_ch }, |
785 | | { prototypes::id::HTMLTableCellElement }, |
786 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
787 | | JSJitInfo::Setter, |
788 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
789 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
790 | | false, /* isInfallible. False in setters. */ |
791 | | false, /* isMovable. Not relevant for setters. */ |
792 | | false, /* isEliminatable. Not relevant for setters. */ |
793 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
794 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
795 | | false, /* isTypedMethod. Only relevant for methods. */ |
796 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
797 | | }; |
798 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
799 | | static_assert(0 < 1, "There is no slot for us"); |
800 | | |
801 | | MOZ_CAN_RUN_SCRIPT static bool |
802 | | get_chOff(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitGetterCallArgs args) |
803 | 0 | { |
804 | 0 | AUTO_PROFILER_LABEL_FAST("get HTMLTableCellElement.chOff", DOM, cx); |
805 | 0 |
|
806 | 0 | DOMString result; |
807 | 0 | self->GetChOff(result); |
808 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
809 | 0 | if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { |
810 | 0 | return false; |
811 | 0 | } |
812 | 0 | return true; |
813 | 0 | } |
814 | | |
815 | | MOZ_CAN_RUN_SCRIPT static bool |
816 | | set_chOff(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitSetterCallArgs args) |
817 | 0 | { |
818 | 0 | AUTO_PROFILER_LABEL_FAST("set HTMLTableCellElement.chOff", DOM, cx); |
819 | 0 |
|
820 | 0 | binding_detail::FakeString arg0; |
821 | 0 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { |
822 | 0 | return false; |
823 | 0 | } |
824 | 0 | Maybe<AutoCEReaction> ceReaction; |
825 | 0 | if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) { |
826 | 0 | DocGroup* docGroup = self->GetDocGroup(); |
827 | 0 | if (docGroup) { |
828 | 0 | ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); |
829 | 0 | } |
830 | 0 | } |
831 | 0 | FastErrorResult rv; |
832 | 0 | self->SetChOff(NonNullHelper(Constify(arg0)), rv); |
833 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
834 | 0 | return false; |
835 | 0 | } |
836 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
837 | 0 |
|
838 | 0 | return true; |
839 | 0 | } |
840 | | |
841 | | static const JSJitInfo chOff_getterinfo = { |
842 | | { (JSJitGetterOp)get_chOff }, |
843 | | { prototypes::id::HTMLTableCellElement }, |
844 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
845 | | JSJitInfo::Getter, |
846 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
847 | | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ |
848 | | false, /* isInfallible. False in setters. */ |
849 | | false, /* isMovable. Not relevant for setters. */ |
850 | | false, /* isEliminatable. Not relevant for setters. */ |
851 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
852 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
853 | | false, /* isTypedMethod. Only relevant for methods. */ |
854 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
855 | | }; |
856 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
857 | | static_assert(0 < 1, "There is no slot for us"); |
858 | | static const JSJitInfo chOff_setterinfo = { |
859 | | { (JSJitGetterOp)set_chOff }, |
860 | | { prototypes::id::HTMLTableCellElement }, |
861 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
862 | | JSJitInfo::Setter, |
863 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
864 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
865 | | false, /* isInfallible. False in setters. */ |
866 | | false, /* isMovable. Not relevant for setters. */ |
867 | | false, /* isEliminatable. Not relevant for setters. */ |
868 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
869 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
870 | | false, /* isTypedMethod. Only relevant for methods. */ |
871 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
872 | | }; |
873 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
874 | | static_assert(0 < 1, "There is no slot for us"); |
875 | | |
876 | | MOZ_CAN_RUN_SCRIPT static bool |
877 | | get_noWrap(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitGetterCallArgs args) |
878 | 0 | { |
879 | 0 | AUTO_PROFILER_LABEL_FAST("get HTMLTableCellElement.noWrap", DOM, cx); |
880 | 0 |
|
881 | 0 | bool result(self->NoWrap()); |
882 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
883 | 0 | args.rval().setBoolean(result); |
884 | 0 | return true; |
885 | 0 | } |
886 | | |
887 | | MOZ_CAN_RUN_SCRIPT static bool |
888 | | set_noWrap(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitSetterCallArgs args) |
889 | 0 | { |
890 | 0 | AUTO_PROFILER_LABEL_FAST("set HTMLTableCellElement.noWrap", DOM, cx); |
891 | 0 |
|
892 | 0 | bool arg0; |
893 | 0 | if (!ValueToPrimitive<bool, eDefault>(cx, args[0], &arg0)) { |
894 | 0 | return false; |
895 | 0 | } |
896 | 0 | Maybe<AutoCEReaction> ceReaction; |
897 | 0 | if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) { |
898 | 0 | DocGroup* docGroup = self->GetDocGroup(); |
899 | 0 | if (docGroup) { |
900 | 0 | ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); |
901 | 0 | } |
902 | 0 | } |
903 | 0 | FastErrorResult rv; |
904 | 0 | self->SetNoWrap(arg0, rv); |
905 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
906 | 0 | return false; |
907 | 0 | } |
908 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
909 | 0 |
|
910 | 0 | return true; |
911 | 0 | } |
912 | | |
913 | | static const JSJitInfo noWrap_getterinfo = { |
914 | | { (JSJitGetterOp)get_noWrap }, |
915 | | { prototypes::id::HTMLTableCellElement }, |
916 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
917 | | JSJitInfo::Getter, |
918 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
919 | | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ |
920 | | true, /* isInfallible. False in setters. */ |
921 | | false, /* isMovable. Not relevant for setters. */ |
922 | | false, /* isEliminatable. Not relevant for setters. */ |
923 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
924 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
925 | | false, /* isTypedMethod. Only relevant for methods. */ |
926 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
927 | | }; |
928 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
929 | | static_assert(0 < 1, "There is no slot for us"); |
930 | | static const JSJitInfo noWrap_setterinfo = { |
931 | | { (JSJitGetterOp)set_noWrap }, |
932 | | { prototypes::id::HTMLTableCellElement }, |
933 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
934 | | JSJitInfo::Setter, |
935 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
936 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
937 | | false, /* isInfallible. False in setters. */ |
938 | | false, /* isMovable. Not relevant for setters. */ |
939 | | false, /* isEliminatable. Not relevant for setters. */ |
940 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
941 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
942 | | false, /* isTypedMethod. Only relevant for methods. */ |
943 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
944 | | }; |
945 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
946 | | static_assert(0 < 1, "There is no slot for us"); |
947 | | |
948 | | MOZ_CAN_RUN_SCRIPT static bool |
949 | | get_vAlign(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitGetterCallArgs args) |
950 | 0 | { |
951 | 0 | AUTO_PROFILER_LABEL_FAST("get HTMLTableCellElement.vAlign", DOM, cx); |
952 | 0 |
|
953 | 0 | DOMString result; |
954 | 0 | self->GetVAlign(result); |
955 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
956 | 0 | if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { |
957 | 0 | return false; |
958 | 0 | } |
959 | 0 | return true; |
960 | 0 | } |
961 | | |
962 | | MOZ_CAN_RUN_SCRIPT static bool |
963 | | set_vAlign(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitSetterCallArgs args) |
964 | 0 | { |
965 | 0 | AUTO_PROFILER_LABEL_FAST("set HTMLTableCellElement.vAlign", DOM, cx); |
966 | 0 |
|
967 | 0 | binding_detail::FakeString arg0; |
968 | 0 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { |
969 | 0 | return false; |
970 | 0 | } |
971 | 0 | Maybe<AutoCEReaction> ceReaction; |
972 | 0 | if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) { |
973 | 0 | DocGroup* docGroup = self->GetDocGroup(); |
974 | 0 | if (docGroup) { |
975 | 0 | ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); |
976 | 0 | } |
977 | 0 | } |
978 | 0 | FastErrorResult rv; |
979 | 0 | self->SetVAlign(NonNullHelper(Constify(arg0)), rv); |
980 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
981 | 0 | return false; |
982 | 0 | } |
983 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
984 | 0 |
|
985 | 0 | return true; |
986 | 0 | } |
987 | | |
988 | | static const JSJitInfo vAlign_getterinfo = { |
989 | | { (JSJitGetterOp)get_vAlign }, |
990 | | { prototypes::id::HTMLTableCellElement }, |
991 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
992 | | JSJitInfo::Getter, |
993 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
994 | | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ |
995 | | false, /* isInfallible. False in setters. */ |
996 | | false, /* isMovable. Not relevant for setters. */ |
997 | | false, /* isEliminatable. Not relevant for setters. */ |
998 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
999 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
1000 | | false, /* isTypedMethod. Only relevant for methods. */ |
1001 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
1002 | | }; |
1003 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
1004 | | static_assert(0 < 1, "There is no slot for us"); |
1005 | | static const JSJitInfo vAlign_setterinfo = { |
1006 | | { (JSJitGetterOp)set_vAlign }, |
1007 | | { prototypes::id::HTMLTableCellElement }, |
1008 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
1009 | | JSJitInfo::Setter, |
1010 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
1011 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
1012 | | false, /* isInfallible. False in setters. */ |
1013 | | false, /* isMovable. Not relevant for setters. */ |
1014 | | false, /* isEliminatable. Not relevant for setters. */ |
1015 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
1016 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
1017 | | false, /* isTypedMethod. Only relevant for methods. */ |
1018 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
1019 | | }; |
1020 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
1021 | | static_assert(0 < 1, "There is no slot for us"); |
1022 | | |
1023 | | MOZ_CAN_RUN_SCRIPT static bool |
1024 | | get_bgColor(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitGetterCallArgs args) |
1025 | 0 | { |
1026 | 0 | AUTO_PROFILER_LABEL_FAST("get HTMLTableCellElement.bgColor", DOM, cx); |
1027 | 0 |
|
1028 | 0 | DOMString result; |
1029 | 0 | self->GetBgColor(result); |
1030 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1031 | 0 | if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { |
1032 | 0 | return false; |
1033 | 0 | } |
1034 | 0 | return true; |
1035 | 0 | } |
1036 | | |
1037 | | MOZ_CAN_RUN_SCRIPT static bool |
1038 | | set_bgColor(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableCellElement* self, JSJitSetterCallArgs args) |
1039 | 0 | { |
1040 | 0 | AUTO_PROFILER_LABEL_FAST("set HTMLTableCellElement.bgColor", DOM, cx); |
1041 | 0 |
|
1042 | 0 | binding_detail::FakeString arg0; |
1043 | 0 | if (!ConvertJSValueToString(cx, args[0], eEmpty, eStringify, arg0)) { |
1044 | 0 | return false; |
1045 | 0 | } |
1046 | 0 | Maybe<AutoCEReaction> ceReaction; |
1047 | 0 | if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) { |
1048 | 0 | DocGroup* docGroup = self->GetDocGroup(); |
1049 | 0 | if (docGroup) { |
1050 | 0 | ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx); |
1051 | 0 | } |
1052 | 0 | } |
1053 | 0 | FastErrorResult rv; |
1054 | 0 | self->SetBgColor(NonNullHelper(Constify(arg0)), rv); |
1055 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1056 | 0 | return false; |
1057 | 0 | } |
1058 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1059 | 0 |
|
1060 | 0 | return true; |
1061 | 0 | } |
1062 | | |
1063 | | static const JSJitInfo bgColor_getterinfo = { |
1064 | | { (JSJitGetterOp)get_bgColor }, |
1065 | | { prototypes::id::HTMLTableCellElement }, |
1066 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
1067 | | JSJitInfo::Getter, |
1068 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
1069 | | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ |
1070 | | false, /* isInfallible. False in setters. */ |
1071 | | false, /* isMovable. Not relevant for setters. */ |
1072 | | false, /* isEliminatable. Not relevant for setters. */ |
1073 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
1074 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
1075 | | false, /* isTypedMethod. Only relevant for methods. */ |
1076 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
1077 | | }; |
1078 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
1079 | | static_assert(0 < 1, "There is no slot for us"); |
1080 | | static const JSJitInfo bgColor_setterinfo = { |
1081 | | { (JSJitGetterOp)set_bgColor }, |
1082 | | { prototypes::id::HTMLTableCellElement }, |
1083 | | { PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth }, |
1084 | | JSJitInfo::Setter, |
1085 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
1086 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
1087 | | false, /* isInfallible. False in setters. */ |
1088 | | false, /* isMovable. Not relevant for setters. */ |
1089 | | false, /* isEliminatable. Not relevant for setters. */ |
1090 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
1091 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
1092 | | false, /* isTypedMethod. Only relevant for methods. */ |
1093 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
1094 | | }; |
1095 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
1096 | | static_assert(0 < 1, "There is no slot for us"); |
1097 | | |
1098 | | static bool |
1099 | | _addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val) |
1100 | 0 | { |
1101 | 0 | mozilla::dom::HTMLTableCellElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLTableCellElement>(obj); |
1102 | 0 | // We don't want to preserve if we don't have a wrapper, and we |
1103 | 0 | // obviously can't preserve if we're not initialized. |
1104 | 0 | if (self && self->GetWrapperPreserveColor()) { |
1105 | 0 | PreserveWrapper(self); |
1106 | 0 | } |
1107 | 0 | return true; |
1108 | 0 | } |
1109 | | |
1110 | | static void |
1111 | | _finalize(js::FreeOp* fop, JSObject* obj) |
1112 | 0 | { |
1113 | 0 | mozilla::dom::HTMLTableCellElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLTableCellElement>(obj); |
1114 | 0 | if (self) { |
1115 | 0 | ClearWrapper(self, self, obj); |
1116 | 0 | AddForDeferredFinalization<mozilla::dom::HTMLTableCellElement>(self); |
1117 | 0 | } |
1118 | 0 | } |
1119 | | |
1120 | | static size_t |
1121 | | _objectMoved(JSObject* obj, JSObject* old) |
1122 | 0 | { |
1123 | 0 | mozilla::dom::HTMLTableCellElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLTableCellElement>(obj); |
1124 | 0 | if (self) { |
1125 | 0 | UpdateWrapper(self, self, obj, old); |
1126 | 0 | } |
1127 | 0 |
|
1128 | 0 | return 0; |
1129 | 0 | } |
1130 | | |
1131 | | // We deliberately use brace-elision to make Visual Studio produce better initalization code. |
1132 | | #if defined(__clang__) |
1133 | | #pragma clang diagnostic push |
1134 | | #pragma clang diagnostic ignored "-Wmissing-braces" |
1135 | | #endif |
1136 | | static const JSPropertySpec sAttributes_specs[] = { |
1137 | | { "colSpan", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &colSpan_getterinfo, GenericSetter<NormalThisPolicy>, &colSpan_setterinfo }, |
1138 | | { "rowSpan", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &rowSpan_getterinfo, GenericSetter<NormalThisPolicy>, &rowSpan_setterinfo }, |
1139 | | { "headers", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &headers_getterinfo, GenericSetter<NormalThisPolicy>, &headers_setterinfo }, |
1140 | | { "cellIndex", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &cellIndex_getterinfo, nullptr, nullptr }, |
1141 | | { "abbr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &abbr_getterinfo, GenericSetter<NormalThisPolicy>, &abbr_setterinfo }, |
1142 | | { "scope", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &scope_getterinfo, GenericSetter<NormalThisPolicy>, &scope_setterinfo }, |
1143 | | { "align", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &align_getterinfo, GenericSetter<NormalThisPolicy>, &align_setterinfo }, |
1144 | | { "axis", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &axis_getterinfo, GenericSetter<NormalThisPolicy>, &axis_setterinfo }, |
1145 | | { "height", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &height_getterinfo, GenericSetter<NormalThisPolicy>, &height_setterinfo }, |
1146 | | { "width", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &width_getterinfo, GenericSetter<NormalThisPolicy>, &width_setterinfo }, |
1147 | | { "ch", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ch_getterinfo, GenericSetter<NormalThisPolicy>, &ch_setterinfo }, |
1148 | | { "chOff", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &chOff_getterinfo, GenericSetter<NormalThisPolicy>, &chOff_setterinfo }, |
1149 | | { "noWrap", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &noWrap_getterinfo, GenericSetter<NormalThisPolicy>, &noWrap_setterinfo }, |
1150 | | { "vAlign", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &vAlign_getterinfo, GenericSetter<NormalThisPolicy>, &vAlign_setterinfo }, |
1151 | | { "bgColor", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &bgColor_getterinfo, GenericSetter<NormalThisPolicy>, &bgColor_setterinfo }, |
1152 | | { nullptr, 0, nullptr, nullptr, nullptr, nullptr } |
1153 | | }; |
1154 | | #if defined(__clang__) |
1155 | | #pragma clang diagnostic pop |
1156 | | #endif |
1157 | | |
1158 | | |
1159 | | static const Prefable<const JSPropertySpec> sAttributes[] = { |
1160 | | { nullptr, &sAttributes_specs[0] }, |
1161 | | { nullptr, nullptr } |
1162 | | }; |
1163 | | |
1164 | | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX, |
1165 | | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); |
1166 | | static_assert(15 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX, |
1167 | | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); |
1168 | | |
1169 | | |
1170 | | static uint16_t sNativeProperties_sortedPropertyIndices[15]; |
1171 | | static PropertyInfo sNativeProperties_propertyInfos[15]; |
1172 | | |
1173 | | static const NativePropertiesN<1> sNativeProperties = { |
1174 | | false, 0, |
1175 | | false, 0, |
1176 | | false, 0, |
1177 | | true, 0 /* sAttributes */, |
1178 | | false, 0, |
1179 | | false, 0, |
1180 | | false, 0, |
1181 | | -1, |
1182 | | 15, |
1183 | | sNativeProperties_sortedPropertyIndices, |
1184 | | { |
1185 | | { sAttributes, &sNativeProperties_propertyInfos[0] } |
1186 | | } |
1187 | | }; |
1188 | | static_assert(15 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount), |
1189 | | "We have a property info count that is oversized"); |
1190 | | |
1191 | | static bool |
1192 | | _constructor(JSContext* cx, unsigned argc, JS::Value* vp) |
1193 | 0 | { |
1194 | 0 | AUTO_PROFILER_LABEL_FAST("HTMLTableCellElement constructor", DOM, cx); |
1195 | 0 |
|
1196 | 0 | return HTMLConstructor(cx, argc, vp, |
1197 | 0 | constructors::id::HTMLTableCellElement, |
1198 | 0 | prototypes::id::HTMLTableCellElement, |
1199 | 0 | CreateInterfaceObjects); |
1200 | 0 | } |
1201 | | |
1202 | | static const js::ClassOps sInterfaceObjectClassOps = { |
1203 | | nullptr, /* addProperty */ |
1204 | | nullptr, /* delProperty */ |
1205 | | nullptr, /* enumerate */ |
1206 | | nullptr, /* newEnumerate */ |
1207 | | nullptr, /* resolve */ |
1208 | | nullptr, /* mayResolve */ |
1209 | | nullptr, /* finalize */ |
1210 | | _constructor, /* call */ |
1211 | | nullptr, /* hasInstance */ |
1212 | | _constructor, /* construct */ |
1213 | | nullptr, /* trace */ |
1214 | | }; |
1215 | | |
1216 | | static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = { |
1217 | | { |
1218 | | "Function", |
1219 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE), |
1220 | | &sInterfaceObjectClassOps, |
1221 | | JS_NULL_CLASS_SPEC, |
1222 | | JS_NULL_CLASS_EXT, |
1223 | | &sInterfaceObjectClassObjectOps |
1224 | | }, |
1225 | | eInterface, |
1226 | | true, |
1227 | | prototypes::id::HTMLTableCellElement, |
1228 | | PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth, |
1229 | | sNativePropertyHooks, |
1230 | | "function HTMLTableCellElement() {\n [native code]\n}", |
1231 | | HTMLElement_Binding::GetConstructorObject |
1232 | | }; |
1233 | | |
1234 | | static const DOMIfaceAndProtoJSClass sPrototypeClass = { |
1235 | | { |
1236 | | "HTMLTableCellElementPrototype", |
1237 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE), |
1238 | | JS_NULL_CLASS_OPS, |
1239 | | JS_NULL_CLASS_SPEC, |
1240 | | JS_NULL_CLASS_EXT, |
1241 | | JS_NULL_OBJECT_OPS |
1242 | | }, |
1243 | | eInterfacePrototype, |
1244 | | false, |
1245 | | prototypes::id::HTMLTableCellElement, |
1246 | | PrototypeTraits<prototypes::id::HTMLTableCellElement>::Depth, |
1247 | | sNativePropertyHooks, |
1248 | | "[object HTMLTableCellElementPrototype]", |
1249 | | HTMLElement_Binding::GetProtoObject |
1250 | | }; |
1251 | | |
1252 | | static const js::ClassOps sClassOps = { |
1253 | | _addProperty, /* addProperty */ |
1254 | | nullptr, /* delProperty */ |
1255 | | nullptr, /* enumerate */ |
1256 | | nullptr, /* newEnumerate */ |
1257 | | nullptr, /* resolve */ |
1258 | | nullptr, /* mayResolve */ |
1259 | | _finalize, /* finalize */ |
1260 | | nullptr, /* call */ |
1261 | | nullptr, /* hasInstance */ |
1262 | | nullptr, /* construct */ |
1263 | | nullptr, /* trace */ |
1264 | | }; |
1265 | | |
1266 | | static const js::ClassExtension sClassExtension = { |
1267 | | nullptr, /* weakmapKeyDelegateOp */ |
1268 | | _objectMoved /* objectMovedOp */ |
1269 | | }; |
1270 | | |
1271 | | static const DOMJSClass sClass = { |
1272 | | { "HTMLTableCellElement", |
1273 | | JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1), |
1274 | | &sClassOps, |
1275 | | JS_NULL_CLASS_SPEC, |
1276 | | &sClassExtension, |
1277 | | JS_NULL_OBJECT_OPS |
1278 | | }, |
1279 | | { prototypes::id::EventTarget, prototypes::id::Node, prototypes::id::Element, prototypes::id::HTMLElement, prototypes::id::HTMLTableCellElement, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count }, |
1280 | | IsBaseOf<nsISupports, mozilla::dom::HTMLTableCellElement >::value, |
1281 | | sNativePropertyHooks, |
1282 | | FindAssociatedGlobalForNative<mozilla::dom::HTMLTableCellElement>::Get, |
1283 | | GetProtoObjectHandle, |
1284 | | GetCCParticipant<mozilla::dom::HTMLTableCellElement>::Get() |
1285 | | }; |
1286 | | static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS, |
1287 | | "Must have the right minimal number of reserved slots."); |
1288 | | static_assert(1 >= 1, |
1289 | | "Must have enough reserved slots."); |
1290 | | |
1291 | | const JSClass* |
1292 | | GetJSClass() |
1293 | 0 | { |
1294 | 0 | return sClass.ToJSClass(); |
1295 | 0 | } |
1296 | | |
1297 | | bool |
1298 | | Wrap(JSContext* aCx, mozilla::dom::HTMLTableCellElement* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector) |
1299 | 0 | { |
1300 | 0 | static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::dom::HTMLTableCellElement>::value, |
1301 | 0 | "Shouldn't have wrappercached things that are not refcounted."); |
1302 | 0 | MOZ_ASSERT(static_cast<mozilla::dom::HTMLTableCellElement*>(aObject) == |
1303 | 0 | reinterpret_cast<mozilla::dom::HTMLTableCellElement*>(aObject), |
1304 | 0 | "Multiple inheritance for mozilla::dom::HTMLTableCellElement is broken."); |
1305 | 0 | MOZ_ASSERT(static_cast<nsGenericHTMLElement*>(aObject) == |
1306 | 0 | reinterpret_cast<nsGenericHTMLElement*>(aObject), |
1307 | 0 | "Multiple inheritance for nsGenericHTMLElement is broken."); |
1308 | 0 | MOZ_ASSERT(static_cast<mozilla::dom::Element*>(aObject) == |
1309 | 0 | reinterpret_cast<mozilla::dom::Element*>(aObject), |
1310 | 0 | "Multiple inheritance for mozilla::dom::Element is broken."); |
1311 | 0 | MOZ_ASSERT(static_cast<nsINode*>(aObject) == |
1312 | 0 | reinterpret_cast<nsINode*>(aObject), |
1313 | 0 | "Multiple inheritance for nsINode is broken."); |
1314 | 0 | MOZ_ASSERT(static_cast<mozilla::dom::EventTarget*>(aObject) == |
1315 | 0 | reinterpret_cast<mozilla::dom::EventTarget*>(aObject), |
1316 | 0 | "Multiple inheritance for mozilla::dom::EventTarget is broken."); |
1317 | 0 | MOZ_ASSERT(ToSupportsIsCorrect(aObject)); |
1318 | 0 | MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx)); |
1319 | 0 | MOZ_ASSERT(!aCache->GetWrapper(), |
1320 | 0 | "You should probably not be using Wrap() directly; use " |
1321 | 0 | "GetOrCreateDOMReflector instead"); |
1322 | 0 |
|
1323 | 0 | MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache), |
1324 | 0 | "nsISupports must be on our primary inheritance chain"); |
1325 | 0 |
|
1326 | 0 | JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject())); |
1327 | 0 | if (!global) { |
1328 | 0 | return false; |
1329 | 0 | } |
1330 | 0 | MOZ_ASSERT(JS_IsGlobalObject(global)); |
1331 | 0 | MOZ_ASSERT(JS::ObjectIsNotGray(global)); |
1332 | 0 |
|
1333 | 0 | // That might have ended up wrapping us already, due to the wonders |
1334 | 0 | // of XBL. Check for that, and bail out as needed. |
1335 | 0 | aReflector.set(aCache->GetWrapper()); |
1336 | 0 | if (aReflector) { |
1337 | | #ifdef DEBUG |
1338 | | AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto); |
1339 | | #endif // DEBUG |
1340 | | return true; |
1341 | 0 | } |
1342 | 0 |
|
1343 | 0 | JSAutoRealm ar(aCx, global); |
1344 | 0 | JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx); |
1345 | 0 | if (!canonicalProto) { |
1346 | 0 | return false; |
1347 | 0 | } |
1348 | 0 | JS::Rooted<JSObject*> proto(aCx); |
1349 | 0 | if (aGivenProto) { |
1350 | 0 | proto = aGivenProto; |
1351 | 0 | // Unfortunately, while aGivenProto was in the compartment of aCx |
1352 | 0 | // coming in, we changed compartments to that of "parent" so may need |
1353 | 0 | // to wrap the proto here. |
1354 | 0 | if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) { |
1355 | 0 | if (!JS_WrapObject(aCx, &proto)) { |
1356 | 0 | return false; |
1357 | 0 | } |
1358 | 0 | } |
1359 | 0 | } else { |
1360 | 0 | proto = canonicalProto; |
1361 | 0 | } |
1362 | 0 |
|
1363 | 0 | BindingJSObjectCreator<mozilla::dom::HTMLTableCellElement> creator(aCx); |
1364 | 0 | creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector); |
1365 | 0 | if (!aReflector) { |
1366 | 0 | return false; |
1367 | 0 | } |
1368 | 0 | |
1369 | 0 | aCache->SetWrapper(aReflector); |
1370 | 0 | creator.InitializationSucceeded(); |
1371 | 0 |
|
1372 | 0 | MOZ_ASSERT(aCache->GetWrapperPreserveColor() && |
1373 | 0 | aCache->GetWrapperPreserveColor() == aReflector); |
1374 | 0 | // If proto != canonicalProto, we have to preserve our wrapper; |
1375 | 0 | // otherwise we won't be able to properly recreate it later, since |
1376 | 0 | // we won't know what proto to use. Note that we don't check |
1377 | 0 | // aGivenProto here, since it's entirely possible (and even |
1378 | 0 | // somewhat common) to have a non-null aGivenProto which is the |
1379 | 0 | // same as canonicalProto. |
1380 | 0 | if (proto != canonicalProto) { |
1381 | 0 | PreserveWrapper(aObject); |
1382 | 0 | } |
1383 | 0 |
|
1384 | 0 | return true; |
1385 | 0 | } |
1386 | | |
1387 | | const NativePropertyHooks sNativePropertyHooks[] = { { |
1388 | | nullptr, |
1389 | | nullptr, |
1390 | | nullptr, |
1391 | | { sNativeProperties.Upcast(), nullptr }, |
1392 | | prototypes::id::HTMLTableCellElement, |
1393 | | constructors::id::HTMLTableCellElement, |
1394 | | HTMLElement_Binding::sNativePropertyHooks, |
1395 | | &DefaultXrayExpandoObjectClass |
1396 | | } }; |
1397 | | |
1398 | | void |
1399 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal) |
1400 | 0 | { |
1401 | 0 | JS::Handle<JSObject*> parentProto(HTMLElement_Binding::GetProtoObjectHandle(aCx)); |
1402 | 0 | if (!parentProto) { |
1403 | 0 | return; |
1404 | 0 | } |
1405 | 0 | |
1406 | 0 | JS::Handle<JSObject*> constructorProto(HTMLElement_Binding::GetConstructorObjectHandle(aCx)); |
1407 | 0 | if (!constructorProto) { |
1408 | 0 | return; |
1409 | 0 | } |
1410 | 0 | |
1411 | 0 | static bool sIdsInited = false; |
1412 | 0 | if (!sIdsInited && NS_IsMainThread()) { |
1413 | 0 | if (!InitIds(aCx, sNativeProperties.Upcast())) { |
1414 | 0 | return; |
1415 | 0 | } |
1416 | 0 | sIdsInited = true; |
1417 | 0 | } |
1418 | 0 |
|
1419 | 0 | JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::HTMLTableCellElement); |
1420 | 0 | JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::HTMLTableCellElement); |
1421 | 0 | dom::CreateInterfaceObjects(aCx, aGlobal, parentProto, |
1422 | 0 | &sPrototypeClass.mBase, protoCache, |
1423 | 0 | nullptr, |
1424 | 0 | constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr, |
1425 | 0 | interfaceCache, |
1426 | 0 | sNativeProperties.Upcast(), |
1427 | 0 | nullptr, |
1428 | 0 | "HTMLTableCellElement", aDefineOnGlobal, |
1429 | 0 | nullptr, |
1430 | 0 | false); |
1431 | 0 | } |
1432 | | |
1433 | | JSObject* |
1434 | | GetConstructorObject(JSContext* aCx) |
1435 | 0 | { |
1436 | 0 | return GetConstructorObjectHandle(aCx); |
1437 | 0 | } |
1438 | | |
1439 | | } // namespace HTMLTableCellElement_Binding |
1440 | | |
1441 | | |
1442 | | |
1443 | | } // namespace dom |
1444 | | } // namespace mozilla |