Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dom/bindings/HTMLTableSectionElementBinding.cpp
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM HTMLTableSectionElement.webidl BY Codegen.py - DO NOT EDIT */
2
3
#include "HTMLElementBinding.h"
4
#include "HTMLTableSectionElementBinding.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/HTMLTableSectionElement.h"
12
#include "mozilla/dom/NonRefcountedDOMObject.h"
13
#include "mozilla/dom/PrimitiveConversions.h"
14
#include "mozilla/dom/XrayExpandoClass.h"
15
#include "nsContentList.h"
16
#include "nsGenericHTMLElement.h"
17
18
namespace mozilla {
19
namespace dom {
20
21
namespace binding_detail {}; // Just to make sure it's known as a namespace
22
using namespace mozilla::dom::binding_detail;
23
24
25
namespace HTMLTableSectionElement_Binding {
26
27
static_assert(IsRefcounted<NativeType>::value == IsRefcounted<HTMLElement_Binding::NativeType>::value,
28
              "Can't inherit from an interface with a different ownership model.");
29
30
MOZ_CAN_RUN_SCRIPT static bool
31
get_rows(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableSectionElement* self, JSJitGetterCallArgs args)
32
0
{
33
0
  AUTO_PROFILER_LABEL_FAST("get HTMLTableSectionElement.rows", DOM, cx);
34
0
35
0
  auto result(StrongOrRawPtr<nsIHTMLCollection>(self->Rows()));
36
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
37
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
38
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
39
0
    return false;
40
0
  }
41
0
  return true;
42
0
}
43
44
static const JSJitInfo rows_getterinfo = {
45
  { (JSJitGetterOp)get_rows },
46
  { prototypes::id::HTMLTableSectionElement },
47
  { PrototypeTraits<prototypes::id::HTMLTableSectionElement>::Depth },
48
  JSJitInfo::Getter,
49
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
50
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
51
  false,  /* isInfallible. False in setters. */
52
  false,  /* isMovable.  Not relevant for setters. */
53
  false, /* isEliminatable.  Not relevant for setters. */
54
  false, /* isAlwaysInSlot.  Only relevant for getters. */
55
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
56
  false,  /* isTypedMethod.  Only relevant for methods. */
57
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
58
};
59
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
60
static_assert(0 < 1, "There is no slot for us");
61
62
MOZ_CAN_RUN_SCRIPT static bool
63
insertRow(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableSectionElement* self, const JSJitMethodCallArgs& args)
64
0
{
65
0
  AUTO_PROFILER_LABEL_FAST("HTMLTableSectionElement.insertRow", DOM, cx);
66
0
67
0
  int32_t arg0;
68
0
  if (args.hasDefined(0)) {
69
0
    if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
70
0
      return false;
71
0
    }
72
0
  } else {
73
0
    arg0 = -1;
74
0
  }
75
0
  FastErrorResult rv;
76
0
  auto result(StrongOrRawPtr<nsGenericHTMLElement>(self->InsertRow(arg0, rv)));
77
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
78
0
    return false;
79
0
  }
80
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
81
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
82
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
83
0
    return false;
84
0
  }
85
0
  return true;
86
0
}
87
88
static const JSJitInfo insertRow_methodinfo = {
89
  { (JSJitGetterOp)insertRow },
90
  { prototypes::id::HTMLTableSectionElement },
91
  { PrototypeTraits<prototypes::id::HTMLTableSectionElement>::Depth },
92
  JSJitInfo::Method,
93
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
94
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
95
  false,  /* isInfallible. False in setters. */
96
  false,  /* isMovable.  Not relevant for setters. */
97
  false, /* isEliminatable.  Not relevant for setters. */
98
  false, /* isAlwaysInSlot.  Only relevant for getters. */
99
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
100
  false,  /* isTypedMethod.  Only relevant for methods. */
101
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
102
};
103
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
104
static_assert(0 < 1, "There is no slot for us");
105
106
MOZ_CAN_RUN_SCRIPT static bool
107
deleteRow(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableSectionElement* self, const JSJitMethodCallArgs& args)
108
0
{
109
0
  AUTO_PROFILER_LABEL_FAST("HTMLTableSectionElement.deleteRow", DOM, cx);
110
0
111
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
112
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "HTMLTableSectionElement.deleteRow");
113
0
  }
114
0
  int32_t arg0;
115
0
  if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], &arg0)) {
116
0
    return false;
117
0
  }
118
0
  Maybe<AutoCEReaction> ceReaction;
119
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
120
0
    DocGroup* docGroup = self->GetDocGroup();
121
0
    if (docGroup) {
122
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
123
0
    }
124
0
  }
125
0
  FastErrorResult rv;
126
0
  self->DeleteRow(arg0, rv);
127
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
128
0
    return false;
129
0
  }
130
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
131
0
  args.rval().setUndefined();
132
0
  return true;
133
0
}
134
135
static const JSJitInfo deleteRow_methodinfo = {
136
  { (JSJitGetterOp)deleteRow },
137
  { prototypes::id::HTMLTableSectionElement },
138
  { PrototypeTraits<prototypes::id::HTMLTableSectionElement>::Depth },
139
  JSJitInfo::Method,
140
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
141
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
142
  false,  /* isInfallible. False in setters. */
143
  false,  /* isMovable.  Not relevant for setters. */
144
  false, /* isEliminatable.  Not relevant for setters. */
145
  false, /* isAlwaysInSlot.  Only relevant for getters. */
146
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
147
  false,  /* isTypedMethod.  Only relevant for methods. */
148
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
149
};
150
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
151
static_assert(0 < 1, "There is no slot for us");
152
153
MOZ_CAN_RUN_SCRIPT static bool
154
get_align(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableSectionElement* self, JSJitGetterCallArgs args)
155
0
{
156
0
  AUTO_PROFILER_LABEL_FAST("get HTMLTableSectionElement.align", DOM, cx);
157
0
158
0
  DOMString result;
159
0
  self->GetAlign(result);
160
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
161
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
162
0
    return false;
163
0
  }
164
0
  return true;
165
0
}
166
167
MOZ_CAN_RUN_SCRIPT static bool
168
set_align(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableSectionElement* self, JSJitSetterCallArgs args)
169
0
{
170
0
  AUTO_PROFILER_LABEL_FAST("set HTMLTableSectionElement.align", DOM, cx);
171
0
172
0
  binding_detail::FakeString arg0;
173
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
174
0
    return false;
175
0
  }
176
0
  Maybe<AutoCEReaction> ceReaction;
177
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
178
0
    DocGroup* docGroup = self->GetDocGroup();
179
0
    if (docGroup) {
180
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
181
0
    }
182
0
  }
183
0
  FastErrorResult rv;
184
0
  self->SetAlign(NonNullHelper(Constify(arg0)), rv);
185
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
186
0
    return false;
187
0
  }
188
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
189
0
190
0
  return true;
191
0
}
192
193
static const JSJitInfo align_getterinfo = {
194
  { (JSJitGetterOp)get_align },
195
  { prototypes::id::HTMLTableSectionElement },
196
  { PrototypeTraits<prototypes::id::HTMLTableSectionElement>::Depth },
197
  JSJitInfo::Getter,
198
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
199
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
200
  false,  /* isInfallible. False in setters. */
201
  false,  /* isMovable.  Not relevant for setters. */
202
  false, /* isEliminatable.  Not relevant for setters. */
203
  false, /* isAlwaysInSlot.  Only relevant for getters. */
204
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
205
  false,  /* isTypedMethod.  Only relevant for methods. */
206
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
207
};
208
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
209
static_assert(0 < 1, "There is no slot for us");
210
static const JSJitInfo align_setterinfo = {
211
  { (JSJitGetterOp)set_align },
212
  { prototypes::id::HTMLTableSectionElement },
213
  { PrototypeTraits<prototypes::id::HTMLTableSectionElement>::Depth },
214
  JSJitInfo::Setter,
215
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
216
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
217
  false,  /* isInfallible. False in setters. */
218
  false,  /* isMovable.  Not relevant for setters. */
219
  false, /* isEliminatable.  Not relevant for setters. */
220
  false, /* isAlwaysInSlot.  Only relevant for getters. */
221
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
222
  false,  /* isTypedMethod.  Only relevant for methods. */
223
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
224
};
225
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
226
static_assert(0 < 1, "There is no slot for us");
227
228
MOZ_CAN_RUN_SCRIPT static bool
229
get_ch(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableSectionElement* self, JSJitGetterCallArgs args)
230
0
{
231
0
  AUTO_PROFILER_LABEL_FAST("get HTMLTableSectionElement.ch", DOM, cx);
232
0
233
0
  DOMString result;
234
0
  self->GetCh(result);
235
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
236
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
237
0
    return false;
238
0
  }
239
0
  return true;
240
0
}
241
242
MOZ_CAN_RUN_SCRIPT static bool
243
set_ch(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableSectionElement* self, JSJitSetterCallArgs args)
244
0
{
245
0
  AUTO_PROFILER_LABEL_FAST("set HTMLTableSectionElement.ch", DOM, cx);
246
0
247
0
  binding_detail::FakeString arg0;
248
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
249
0
    return false;
250
0
  }
251
0
  Maybe<AutoCEReaction> ceReaction;
252
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
253
0
    DocGroup* docGroup = self->GetDocGroup();
254
0
    if (docGroup) {
255
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
256
0
    }
257
0
  }
258
0
  FastErrorResult rv;
259
0
  self->SetCh(NonNullHelper(Constify(arg0)), rv);
260
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
261
0
    return false;
262
0
  }
263
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
264
0
265
0
  return true;
266
0
}
267
268
static const JSJitInfo ch_getterinfo = {
269
  { (JSJitGetterOp)get_ch },
270
  { prototypes::id::HTMLTableSectionElement },
271
  { PrototypeTraits<prototypes::id::HTMLTableSectionElement>::Depth },
272
  JSJitInfo::Getter,
273
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
274
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
275
  false,  /* isInfallible. False in setters. */
276
  false,  /* isMovable.  Not relevant for setters. */
277
  false, /* isEliminatable.  Not relevant for setters. */
278
  false, /* isAlwaysInSlot.  Only relevant for getters. */
279
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
280
  false,  /* isTypedMethod.  Only relevant for methods. */
281
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
282
};
283
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
284
static_assert(0 < 1, "There is no slot for us");
285
static const JSJitInfo ch_setterinfo = {
286
  { (JSJitGetterOp)set_ch },
287
  { prototypes::id::HTMLTableSectionElement },
288
  { PrototypeTraits<prototypes::id::HTMLTableSectionElement>::Depth },
289
  JSJitInfo::Setter,
290
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
291
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
292
  false,  /* isInfallible. False in setters. */
293
  false,  /* isMovable.  Not relevant for setters. */
294
  false, /* isEliminatable.  Not relevant for setters. */
295
  false, /* isAlwaysInSlot.  Only relevant for getters. */
296
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
297
  false,  /* isTypedMethod.  Only relevant for methods. */
298
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
299
};
300
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
301
static_assert(0 < 1, "There is no slot for us");
302
303
MOZ_CAN_RUN_SCRIPT static bool
304
get_chOff(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableSectionElement* self, JSJitGetterCallArgs args)
305
0
{
306
0
  AUTO_PROFILER_LABEL_FAST("get HTMLTableSectionElement.chOff", DOM, cx);
307
0
308
0
  DOMString result;
309
0
  self->GetChOff(result);
310
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
311
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
312
0
    return false;
313
0
  }
314
0
  return true;
315
0
}
316
317
MOZ_CAN_RUN_SCRIPT static bool
318
set_chOff(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableSectionElement* self, JSJitSetterCallArgs args)
319
0
{
320
0
  AUTO_PROFILER_LABEL_FAST("set HTMLTableSectionElement.chOff", DOM, cx);
321
0
322
0
  binding_detail::FakeString arg0;
323
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
324
0
    return false;
325
0
  }
326
0
  Maybe<AutoCEReaction> ceReaction;
327
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
328
0
    DocGroup* docGroup = self->GetDocGroup();
329
0
    if (docGroup) {
330
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
331
0
    }
332
0
  }
333
0
  FastErrorResult rv;
334
0
  self->SetChOff(NonNullHelper(Constify(arg0)), rv);
335
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
336
0
    return false;
337
0
  }
338
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
339
0
340
0
  return true;
341
0
}
342
343
static const JSJitInfo chOff_getterinfo = {
344
  { (JSJitGetterOp)get_chOff },
345
  { prototypes::id::HTMLTableSectionElement },
346
  { PrototypeTraits<prototypes::id::HTMLTableSectionElement>::Depth },
347
  JSJitInfo::Getter,
348
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
349
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
350
  false,  /* isInfallible. False in setters. */
351
  false,  /* isMovable.  Not relevant for setters. */
352
  false, /* isEliminatable.  Not relevant for setters. */
353
  false, /* isAlwaysInSlot.  Only relevant for getters. */
354
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
355
  false,  /* isTypedMethod.  Only relevant for methods. */
356
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
357
};
358
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
359
static_assert(0 < 1, "There is no slot for us");
360
static const JSJitInfo chOff_setterinfo = {
361
  { (JSJitGetterOp)set_chOff },
362
  { prototypes::id::HTMLTableSectionElement },
363
  { PrototypeTraits<prototypes::id::HTMLTableSectionElement>::Depth },
364
  JSJitInfo::Setter,
365
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
366
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
367
  false,  /* isInfallible. False in setters. */
368
  false,  /* isMovable.  Not relevant for setters. */
369
  false, /* isEliminatable.  Not relevant for setters. */
370
  false, /* isAlwaysInSlot.  Only relevant for getters. */
371
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
372
  false,  /* isTypedMethod.  Only relevant for methods. */
373
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
374
};
375
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
376
static_assert(0 < 1, "There is no slot for us");
377
378
MOZ_CAN_RUN_SCRIPT static bool
379
get_vAlign(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableSectionElement* self, JSJitGetterCallArgs args)
380
0
{
381
0
  AUTO_PROFILER_LABEL_FAST("get HTMLTableSectionElement.vAlign", DOM, cx);
382
0
383
0
  DOMString result;
384
0
  self->GetVAlign(result);
385
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
386
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
387
0
    return false;
388
0
  }
389
0
  return true;
390
0
}
391
392
MOZ_CAN_RUN_SCRIPT static bool
393
set_vAlign(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLTableSectionElement* self, JSJitSetterCallArgs args)
394
0
{
395
0
  AUTO_PROFILER_LABEL_FAST("set HTMLTableSectionElement.vAlign", DOM, cx);
396
0
397
0
  binding_detail::FakeString arg0;
398
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
399
0
    return false;
400
0
  }
401
0
  Maybe<AutoCEReaction> ceReaction;
402
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
403
0
    DocGroup* docGroup = self->GetDocGroup();
404
0
    if (docGroup) {
405
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
406
0
    }
407
0
  }
408
0
  FastErrorResult rv;
409
0
  self->SetVAlign(NonNullHelper(Constify(arg0)), rv);
410
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
411
0
    return false;
412
0
  }
413
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
414
0
415
0
  return true;
416
0
}
417
418
static const JSJitInfo vAlign_getterinfo = {
419
  { (JSJitGetterOp)get_vAlign },
420
  { prototypes::id::HTMLTableSectionElement },
421
  { PrototypeTraits<prototypes::id::HTMLTableSectionElement>::Depth },
422
  JSJitInfo::Getter,
423
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
424
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
425
  false,  /* isInfallible. False in setters. */
426
  false,  /* isMovable.  Not relevant for setters. */
427
  false, /* isEliminatable.  Not relevant for setters. */
428
  false, /* isAlwaysInSlot.  Only relevant for getters. */
429
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
430
  false,  /* isTypedMethod.  Only relevant for methods. */
431
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
432
};
433
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
434
static_assert(0 < 1, "There is no slot for us");
435
static const JSJitInfo vAlign_setterinfo = {
436
  { (JSJitGetterOp)set_vAlign },
437
  { prototypes::id::HTMLTableSectionElement },
438
  { PrototypeTraits<prototypes::id::HTMLTableSectionElement>::Depth },
439
  JSJitInfo::Setter,
440
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
441
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
442
  false,  /* isInfallible. False in setters. */
443
  false,  /* isMovable.  Not relevant for setters. */
444
  false, /* isEliminatable.  Not relevant for setters. */
445
  false, /* isAlwaysInSlot.  Only relevant for getters. */
446
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
447
  false,  /* isTypedMethod.  Only relevant for methods. */
448
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
449
};
450
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
451
static_assert(0 < 1, "There is no slot for us");
452
453
static bool
454
_addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
455
0
{
456
0
  mozilla::dom::HTMLTableSectionElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLTableSectionElement>(obj);
457
0
  // We don't want to preserve if we don't have a wrapper, and we
458
0
  // obviously can't preserve if we're not initialized.
459
0
  if (self && self->GetWrapperPreserveColor()) {
460
0
    PreserveWrapper(self);
461
0
  }
462
0
  return true;
463
0
}
464
465
static void
466
_finalize(js::FreeOp* fop, JSObject* obj)
467
0
{
468
0
  mozilla::dom::HTMLTableSectionElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLTableSectionElement>(obj);
469
0
  if (self) {
470
0
    ClearWrapper(self, self, obj);
471
0
    AddForDeferredFinalization<mozilla::dom::HTMLTableSectionElement>(self);
472
0
  }
473
0
}
474
475
static size_t
476
_objectMoved(JSObject* obj, JSObject* old)
477
0
{
478
0
  mozilla::dom::HTMLTableSectionElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLTableSectionElement>(obj);
479
0
  if (self) {
480
0
    UpdateWrapper(self, self, obj, old);
481
0
  }
482
0
483
0
  return 0;
484
0
}
485
486
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
487
#if defined(__clang__)
488
#pragma clang diagnostic push
489
#pragma clang diagnostic ignored "-Wmissing-braces"
490
#endif
491
static const JSFunctionSpec sMethods_specs[] = {
492
  JS_FNSPEC("insertRow", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&insertRow_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
493
  JS_FNSPEC("deleteRow", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&deleteRow_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
494
  JS_FS_END
495
};
496
#if defined(__clang__)
497
#pragma clang diagnostic pop
498
#endif
499
500
501
static const Prefable<const JSFunctionSpec> sMethods[] = {
502
  { nullptr, &sMethods_specs[0] },
503
  { nullptr, nullptr }
504
};
505
506
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
507
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
508
static_assert(2 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
509
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
510
511
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
512
#if defined(__clang__)
513
#pragma clang diagnostic push
514
#pragma clang diagnostic ignored "-Wmissing-braces"
515
#endif
516
static const JSPropertySpec sAttributes_specs[] = {
517
  { "rows", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &rows_getterinfo, nullptr, nullptr },
518
  { "align", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &align_getterinfo, GenericSetter<NormalThisPolicy>, &align_setterinfo },
519
  { "ch", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ch_getterinfo, GenericSetter<NormalThisPolicy>, &ch_setterinfo },
520
  { "chOff", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &chOff_getterinfo, GenericSetter<NormalThisPolicy>, &chOff_setterinfo },
521
  { "vAlign", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &vAlign_getterinfo, GenericSetter<NormalThisPolicy>, &vAlign_setterinfo },
522
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
523
};
524
#if defined(__clang__)
525
#pragma clang diagnostic pop
526
#endif
527
528
529
static const Prefable<const JSPropertySpec> sAttributes[] = {
530
  { nullptr, &sAttributes_specs[0] },
531
  { nullptr, nullptr }
532
};
533
534
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
535
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
536
static_assert(5 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
537
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
538
539
540
static uint16_t sNativeProperties_sortedPropertyIndices[7];
541
static PropertyInfo sNativeProperties_propertyInfos[7];
542
543
static const NativePropertiesN<2> sNativeProperties = {
544
  false, 0,
545
  false, 0,
546
  true,  0 /* sMethods */,
547
  true,  1 /* sAttributes */,
548
  false, 0,
549
  false, 0,
550
  false, 0,
551
  -1,
552
  7,
553
  sNativeProperties_sortedPropertyIndices,
554
  {
555
    { sMethods, &sNativeProperties_propertyInfos[0] },
556
    { sAttributes, &sNativeProperties_propertyInfos[2] }
557
  }
558
};
559
static_assert(7 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
560
    "We have a property info count that is oversized");
561
562
static bool
563
_constructor(JSContext* cx, unsigned argc, JS::Value* vp)
564
0
{
565
0
  AUTO_PROFILER_LABEL_FAST("HTMLTableSectionElement constructor", DOM, cx);
566
0
567
0
  return HTMLConstructor(cx, argc, vp,
568
0
                         constructors::id::HTMLTableSectionElement,
569
0
                         prototypes::id::HTMLTableSectionElement,
570
0
                         CreateInterfaceObjects);
571
0
}
572
573
static const js::ClassOps sInterfaceObjectClassOps = {
574
    nullptr,               /* addProperty */
575
    nullptr,               /* delProperty */
576
    nullptr,               /* enumerate */
577
    nullptr,               /* newEnumerate */
578
    nullptr,               /* resolve */
579
    nullptr,               /* mayResolve */
580
    nullptr,               /* finalize */
581
    _constructor, /* call */
582
    nullptr,               /* hasInstance */
583
    _constructor, /* construct */
584
    nullptr,               /* trace */
585
};
586
587
static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
588
  {
589
    "Function",
590
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE),
591
    &sInterfaceObjectClassOps,
592
    JS_NULL_CLASS_SPEC,
593
    JS_NULL_CLASS_EXT,
594
    &sInterfaceObjectClassObjectOps
595
  },
596
  eInterface,
597
  true,
598
  prototypes::id::HTMLTableSectionElement,
599
  PrototypeTraits<prototypes::id::HTMLTableSectionElement>::Depth,
600
  sNativePropertyHooks,
601
  "function HTMLTableSectionElement() {\n    [native code]\n}",
602
  HTMLElement_Binding::GetConstructorObject
603
};
604
605
static const DOMIfaceAndProtoJSClass sPrototypeClass = {
606
  {
607
    "HTMLTableSectionElementPrototype",
608
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE),
609
    JS_NULL_CLASS_OPS,
610
    JS_NULL_CLASS_SPEC,
611
    JS_NULL_CLASS_EXT,
612
    JS_NULL_OBJECT_OPS
613
  },
614
  eInterfacePrototype,
615
  false,
616
  prototypes::id::HTMLTableSectionElement,
617
  PrototypeTraits<prototypes::id::HTMLTableSectionElement>::Depth,
618
  sNativePropertyHooks,
619
  "[object HTMLTableSectionElementPrototype]",
620
  HTMLElement_Binding::GetProtoObject
621
};
622
623
static const js::ClassOps sClassOps = {
624
  _addProperty, /* addProperty */
625
  nullptr,               /* delProperty */
626
  nullptr,               /* enumerate */
627
  nullptr, /* newEnumerate */
628
  nullptr, /* resolve */
629
  nullptr, /* mayResolve */
630
  _finalize, /* finalize */
631
  nullptr, /* call */
632
  nullptr,               /* hasInstance */
633
  nullptr,               /* construct */
634
  nullptr, /* trace */
635
};
636
637
static const js::ClassExtension sClassExtension = {
638
  nullptr, /* weakmapKeyDelegateOp */
639
  _objectMoved /* objectMovedOp */
640
};
641
642
static const DOMJSClass sClass = {
643
  { "HTMLTableSectionElement",
644
    JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
645
    &sClassOps,
646
    JS_NULL_CLASS_SPEC,
647
    &sClassExtension,
648
    JS_NULL_OBJECT_OPS
649
  },
650
  { prototypes::id::EventTarget, prototypes::id::Node, prototypes::id::Element, prototypes::id::HTMLElement, prototypes::id::HTMLTableSectionElement, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
651
  IsBaseOf<nsISupports, mozilla::dom::HTMLTableSectionElement >::value,
652
  sNativePropertyHooks,
653
  FindAssociatedGlobalForNative<mozilla::dom::HTMLTableSectionElement>::Get,
654
  GetProtoObjectHandle,
655
  GetCCParticipant<mozilla::dom::HTMLTableSectionElement>::Get()
656
};
657
static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
658
              "Must have the right minimal number of reserved slots.");
659
static_assert(1 >= 1,
660
              "Must have enough reserved slots.");
661
662
const JSClass*
663
GetJSClass()
664
0
{
665
0
  return sClass.ToJSClass();
666
0
}
667
668
bool
669
Wrap(JSContext* aCx, mozilla::dom::HTMLTableSectionElement* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
670
0
{
671
0
  static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::dom::HTMLTableSectionElement>::value,
672
0
                "Shouldn't have wrappercached things that are not refcounted.");
673
0
  MOZ_ASSERT(static_cast<mozilla::dom::HTMLTableSectionElement*>(aObject) ==
674
0
             reinterpret_cast<mozilla::dom::HTMLTableSectionElement*>(aObject),
675
0
             "Multiple inheritance for mozilla::dom::HTMLTableSectionElement is broken.");
676
0
  MOZ_ASSERT(static_cast<nsGenericHTMLElement*>(aObject) ==
677
0
             reinterpret_cast<nsGenericHTMLElement*>(aObject),
678
0
             "Multiple inheritance for nsGenericHTMLElement is broken.");
679
0
  MOZ_ASSERT(static_cast<mozilla::dom::Element*>(aObject) ==
680
0
             reinterpret_cast<mozilla::dom::Element*>(aObject),
681
0
             "Multiple inheritance for mozilla::dom::Element is broken.");
682
0
  MOZ_ASSERT(static_cast<nsINode*>(aObject) ==
683
0
             reinterpret_cast<nsINode*>(aObject),
684
0
             "Multiple inheritance for nsINode is broken.");
685
0
  MOZ_ASSERT(static_cast<mozilla::dom::EventTarget*>(aObject) ==
686
0
             reinterpret_cast<mozilla::dom::EventTarget*>(aObject),
687
0
             "Multiple inheritance for mozilla::dom::EventTarget is broken.");
688
0
  MOZ_ASSERT(ToSupportsIsCorrect(aObject));
689
0
  MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
690
0
  MOZ_ASSERT(!aCache->GetWrapper(),
691
0
             "You should probably not be using Wrap() directly; use "
692
0
             "GetOrCreateDOMReflector instead");
693
0
694
0
  MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
695
0
             "nsISupports must be on our primary inheritance chain");
696
0
697
0
  JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
698
0
  if (!global) {
699
0
    return false;
700
0
  }
701
0
  MOZ_ASSERT(JS_IsGlobalObject(global));
702
0
  MOZ_ASSERT(JS::ObjectIsNotGray(global));
703
0
704
0
  // That might have ended up wrapping us already, due to the wonders
705
0
  // of XBL.  Check for that, and bail out as needed.
706
0
  aReflector.set(aCache->GetWrapper());
707
0
  if (aReflector) {
708
#ifdef DEBUG
709
    AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
710
#endif // DEBUG
711
    return true;
712
0
  }
713
0
714
0
  JSAutoRealm ar(aCx, global);
715
0
  JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
716
0
  if (!canonicalProto) {
717
0
    return false;
718
0
  }
719
0
  JS::Rooted<JSObject*> proto(aCx);
720
0
  if (aGivenProto) {
721
0
    proto = aGivenProto;
722
0
    // Unfortunately, while aGivenProto was in the compartment of aCx
723
0
    // coming in, we changed compartments to that of "parent" so may need
724
0
    // to wrap the proto here.
725
0
    if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) {
726
0
      if (!JS_WrapObject(aCx, &proto)) {
727
0
        return false;
728
0
      }
729
0
    }
730
0
  } else {
731
0
    proto = canonicalProto;
732
0
  }
733
0
734
0
  BindingJSObjectCreator<mozilla::dom::HTMLTableSectionElement> creator(aCx);
735
0
  creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
736
0
  if (!aReflector) {
737
0
    return false;
738
0
  }
739
0
740
0
  aCache->SetWrapper(aReflector);
741
0
  creator.InitializationSucceeded();
742
0
743
0
  MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&
744
0
             aCache->GetWrapperPreserveColor() == aReflector);
745
0
  // If proto != canonicalProto, we have to preserve our wrapper;
746
0
  // otherwise we won't be able to properly recreate it later, since
747
0
  // we won't know what proto to use.  Note that we don't check
748
0
  // aGivenProto here, since it's entirely possible (and even
749
0
  // somewhat common) to have a non-null aGivenProto which is the
750
0
  // same as canonicalProto.
751
0
  if (proto != canonicalProto) {
752
0
    PreserveWrapper(aObject);
753
0
  }
754
0
755
0
  return true;
756
0
}
757
758
const NativePropertyHooks sNativePropertyHooks[] = { {
759
  nullptr,
760
  nullptr,
761
  nullptr,
762
  { sNativeProperties.Upcast(), nullptr },
763
  prototypes::id::HTMLTableSectionElement,
764
  constructors::id::HTMLTableSectionElement,
765
  HTMLElement_Binding::sNativePropertyHooks,
766
  &DefaultXrayExpandoObjectClass
767
} };
768
769
void
770
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
771
0
{
772
0
  JS::Handle<JSObject*> parentProto(HTMLElement_Binding::GetProtoObjectHandle(aCx));
773
0
  if (!parentProto) {
774
0
    return;
775
0
  }
776
0
777
0
  JS::Handle<JSObject*> constructorProto(HTMLElement_Binding::GetConstructorObjectHandle(aCx));
778
0
  if (!constructorProto) {
779
0
    return;
780
0
  }
781
0
782
0
  static bool sIdsInited = false;
783
0
  if (!sIdsInited && NS_IsMainThread()) {
784
0
    if (!InitIds(aCx, sNativeProperties.Upcast())) {
785
0
      return;
786
0
    }
787
0
    sIdsInited = true;
788
0
  }
789
0
790
0
  JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::HTMLTableSectionElement);
791
0
  JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::HTMLTableSectionElement);
792
0
  dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
793
0
                              &sPrototypeClass.mBase, protoCache,
794
0
                              nullptr,
795
0
                              constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr,
796
0
                              interfaceCache,
797
0
                              sNativeProperties.Upcast(),
798
0
                              nullptr,
799
0
                              "HTMLTableSectionElement", aDefineOnGlobal,
800
0
                              nullptr,
801
0
                              false);
802
0
}
803
804
JSObject*
805
GetConstructorObject(JSContext* aCx)
806
0
{
807
0
  return GetConstructorObjectHandle(aCx);
808
0
}
809
810
} // namespace HTMLTableSectionElement_Binding
811
812
813
814
} // namespace dom
815
} // namespace mozilla