Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dom/bindings/HTMLBodyElementBinding.cpp
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM HTMLBodyElement.webidl BY Codegen.py - DO NOT EDIT */
2
3
#include "EventHandlerBinding.h"
4
#include "HTMLBodyElementBinding.h"
5
#include "HTMLElementBinding.h"
6
#include "WrapperFactory.h"
7
#include "mozilla/OwningNonNull.h"
8
#include "mozilla/dom/BindingUtils.h"
9
#include "mozilla/dom/CustomElementRegistry.h"
10
#include "mozilla/dom/DOMJSClass.h"
11
#include "mozilla/dom/DocGroup.h"
12
#include "mozilla/dom/HTMLBodyElement.h"
13
#include "mozilla/dom/NonRefcountedDOMObject.h"
14
#include "mozilla/dom/Nullable.h"
15
#include "mozilla/dom/XrayExpandoClass.h"
16
17
namespace mozilla {
18
namespace dom {
19
20
namespace binding_detail {}; // Just to make sure it's known as a namespace
21
using namespace mozilla::dom::binding_detail;
22
23
24
namespace HTMLBodyElement_Binding {
25
26
static_assert(IsRefcounted<NativeType>::value == IsRefcounted<HTMLElement_Binding::NativeType>::value,
27
              "Can't inherit from an interface with a different ownership model.");
28
29
MOZ_CAN_RUN_SCRIPT static bool
30
get_text(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
31
0
{
32
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.text", DOM, cx);
33
0
34
0
  DOMString result;
35
0
  self->GetText(result);
36
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
37
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
38
0
    return false;
39
0
  }
40
0
  return true;
41
0
}
42
43
MOZ_CAN_RUN_SCRIPT static bool
44
set_text(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
45
0
{
46
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.text", DOM, cx);
47
0
48
0
  binding_detail::FakeString arg0;
49
0
  if (!ConvertJSValueToString(cx, args[0], eEmpty, eStringify, arg0)) {
50
0
    return false;
51
0
  }
52
0
  Maybe<AutoCEReaction> ceReaction;
53
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
54
0
    DocGroup* docGroup = self->GetDocGroup();
55
0
    if (docGroup) {
56
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
57
0
    }
58
0
  }
59
0
  FastErrorResult rv;
60
0
  self->SetText(NonNullHelper(Constify(arg0)), rv);
61
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
62
0
    return false;
63
0
  }
64
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
65
0
66
0
  return true;
67
0
}
68
69
static const JSJitInfo text_getterinfo = {
70
  { (JSJitGetterOp)get_text },
71
  { prototypes::id::HTMLBodyElement },
72
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
73
  JSJitInfo::Getter,
74
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
75
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
76
  false,  /* isInfallible. False in setters. */
77
  false,  /* isMovable.  Not relevant for setters. */
78
  false, /* isEliminatable.  Not relevant for setters. */
79
  false, /* isAlwaysInSlot.  Only relevant for getters. */
80
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
81
  false,  /* isTypedMethod.  Only relevant for methods. */
82
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
83
};
84
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
85
static_assert(0 < 1, "There is no slot for us");
86
static const JSJitInfo text_setterinfo = {
87
  { (JSJitGetterOp)set_text },
88
  { prototypes::id::HTMLBodyElement },
89
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
90
  JSJitInfo::Setter,
91
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
92
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
93
  false,  /* isInfallible. False in setters. */
94
  false,  /* isMovable.  Not relevant for setters. */
95
  false, /* isEliminatable.  Not relevant for setters. */
96
  false, /* isAlwaysInSlot.  Only relevant for getters. */
97
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
98
  false,  /* isTypedMethod.  Only relevant for methods. */
99
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
100
};
101
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
102
static_assert(0 < 1, "There is no slot for us");
103
104
MOZ_CAN_RUN_SCRIPT static bool
105
get_link(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
106
0
{
107
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.link", DOM, cx);
108
0
109
0
  DOMString result;
110
0
  self->GetLink(result);
111
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
112
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
113
0
    return false;
114
0
  }
115
0
  return true;
116
0
}
117
118
MOZ_CAN_RUN_SCRIPT static bool
119
set_link(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
120
0
{
121
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.link", DOM, cx);
122
0
123
0
  binding_detail::FakeString arg0;
124
0
  if (!ConvertJSValueToString(cx, args[0], eEmpty, eStringify, arg0)) {
125
0
    return false;
126
0
  }
127
0
  Maybe<AutoCEReaction> ceReaction;
128
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
129
0
    DocGroup* docGroup = self->GetDocGroup();
130
0
    if (docGroup) {
131
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
132
0
    }
133
0
  }
134
0
  FastErrorResult rv;
135
0
  self->SetLink(NonNullHelper(Constify(arg0)), rv);
136
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
137
0
    return false;
138
0
  }
139
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
140
0
141
0
  return true;
142
0
}
143
144
static const JSJitInfo link_getterinfo = {
145
  { (JSJitGetterOp)get_link },
146
  { prototypes::id::HTMLBodyElement },
147
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
148
  JSJitInfo::Getter,
149
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
150
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
151
  false,  /* isInfallible. False in setters. */
152
  false,  /* isMovable.  Not relevant for setters. */
153
  false, /* isEliminatable.  Not relevant for setters. */
154
  false, /* isAlwaysInSlot.  Only relevant for getters. */
155
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
156
  false,  /* isTypedMethod.  Only relevant for methods. */
157
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
158
};
159
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
160
static_assert(0 < 1, "There is no slot for us");
161
static const JSJitInfo link_setterinfo = {
162
  { (JSJitGetterOp)set_link },
163
  { prototypes::id::HTMLBodyElement },
164
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
165
  JSJitInfo::Setter,
166
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
167
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
168
  false,  /* isInfallible. False in setters. */
169
  false,  /* isMovable.  Not relevant for setters. */
170
  false, /* isEliminatable.  Not relevant for setters. */
171
  false, /* isAlwaysInSlot.  Only relevant for getters. */
172
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
173
  false,  /* isTypedMethod.  Only relevant for methods. */
174
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
175
};
176
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
177
static_assert(0 < 1, "There is no slot for us");
178
179
MOZ_CAN_RUN_SCRIPT static bool
180
get_vLink(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
181
0
{
182
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.vLink", DOM, cx);
183
0
184
0
  DOMString result;
185
0
  self->GetVLink(result);
186
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
187
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
188
0
    return false;
189
0
  }
190
0
  return true;
191
0
}
192
193
MOZ_CAN_RUN_SCRIPT static bool
194
set_vLink(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
195
0
{
196
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.vLink", DOM, cx);
197
0
198
0
  binding_detail::FakeString arg0;
199
0
  if (!ConvertJSValueToString(cx, args[0], eEmpty, eStringify, arg0)) {
200
0
    return false;
201
0
  }
202
0
  Maybe<AutoCEReaction> ceReaction;
203
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
204
0
    DocGroup* docGroup = self->GetDocGroup();
205
0
    if (docGroup) {
206
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
207
0
    }
208
0
  }
209
0
  FastErrorResult rv;
210
0
  self->SetVLink(NonNullHelper(Constify(arg0)), rv);
211
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
212
0
    return false;
213
0
  }
214
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
215
0
216
0
  return true;
217
0
}
218
219
static const JSJitInfo vLink_getterinfo = {
220
  { (JSJitGetterOp)get_vLink },
221
  { prototypes::id::HTMLBodyElement },
222
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
223
  JSJitInfo::Getter,
224
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
225
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
226
  false,  /* isInfallible. False in setters. */
227
  false,  /* isMovable.  Not relevant for setters. */
228
  false, /* isEliminatable.  Not relevant for setters. */
229
  false, /* isAlwaysInSlot.  Only relevant for getters. */
230
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
231
  false,  /* isTypedMethod.  Only relevant for methods. */
232
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
233
};
234
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
235
static_assert(0 < 1, "There is no slot for us");
236
static const JSJitInfo vLink_setterinfo = {
237
  { (JSJitGetterOp)set_vLink },
238
  { prototypes::id::HTMLBodyElement },
239
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
240
  JSJitInfo::Setter,
241
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
242
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
243
  false,  /* isInfallible. False in setters. */
244
  false,  /* isMovable.  Not relevant for setters. */
245
  false, /* isEliminatable.  Not relevant for setters. */
246
  false, /* isAlwaysInSlot.  Only relevant for getters. */
247
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
248
  false,  /* isTypedMethod.  Only relevant for methods. */
249
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
250
};
251
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
252
static_assert(0 < 1, "There is no slot for us");
253
254
MOZ_CAN_RUN_SCRIPT static bool
255
get_aLink(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
256
0
{
257
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.aLink", DOM, cx);
258
0
259
0
  DOMString result;
260
0
  self->GetALink(result);
261
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
262
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
263
0
    return false;
264
0
  }
265
0
  return true;
266
0
}
267
268
MOZ_CAN_RUN_SCRIPT static bool
269
set_aLink(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
270
0
{
271
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.aLink", DOM, cx);
272
0
273
0
  binding_detail::FakeString arg0;
274
0
  if (!ConvertJSValueToString(cx, args[0], eEmpty, eStringify, arg0)) {
275
0
    return false;
276
0
  }
277
0
  Maybe<AutoCEReaction> ceReaction;
278
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
279
0
    DocGroup* docGroup = self->GetDocGroup();
280
0
    if (docGroup) {
281
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
282
0
    }
283
0
  }
284
0
  FastErrorResult rv;
285
0
  self->SetALink(NonNullHelper(Constify(arg0)), rv);
286
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
287
0
    return false;
288
0
  }
289
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
290
0
291
0
  return true;
292
0
}
293
294
static const JSJitInfo aLink_getterinfo = {
295
  { (JSJitGetterOp)get_aLink },
296
  { prototypes::id::HTMLBodyElement },
297
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
298
  JSJitInfo::Getter,
299
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
300
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
301
  false,  /* isInfallible. False in setters. */
302
  false,  /* isMovable.  Not relevant for setters. */
303
  false, /* isEliminatable.  Not relevant for setters. */
304
  false, /* isAlwaysInSlot.  Only relevant for getters. */
305
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
306
  false,  /* isTypedMethod.  Only relevant for methods. */
307
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
308
};
309
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
310
static_assert(0 < 1, "There is no slot for us");
311
static const JSJitInfo aLink_setterinfo = {
312
  { (JSJitGetterOp)set_aLink },
313
  { prototypes::id::HTMLBodyElement },
314
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
315
  JSJitInfo::Setter,
316
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
317
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
318
  false,  /* isInfallible. False in setters. */
319
  false,  /* isMovable.  Not relevant for setters. */
320
  false, /* isEliminatable.  Not relevant for setters. */
321
  false, /* isAlwaysInSlot.  Only relevant for getters. */
322
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
323
  false,  /* isTypedMethod.  Only relevant for methods. */
324
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
325
};
326
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
327
static_assert(0 < 1, "There is no slot for us");
328
329
MOZ_CAN_RUN_SCRIPT static bool
330
get_bgColor(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
331
0
{
332
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.bgColor", DOM, cx);
333
0
334
0
  DOMString result;
335
0
  self->GetBgColor(result);
336
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
337
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
338
0
    return false;
339
0
  }
340
0
  return true;
341
0
}
342
343
MOZ_CAN_RUN_SCRIPT static bool
344
set_bgColor(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
345
0
{
346
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.bgColor", DOM, cx);
347
0
348
0
  binding_detail::FakeString arg0;
349
0
  if (!ConvertJSValueToString(cx, args[0], eEmpty, eStringify, arg0)) {
350
0
    return false;
351
0
  }
352
0
  Maybe<AutoCEReaction> ceReaction;
353
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
354
0
    DocGroup* docGroup = self->GetDocGroup();
355
0
    if (docGroup) {
356
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
357
0
    }
358
0
  }
359
0
  FastErrorResult rv;
360
0
  self->SetBgColor(NonNullHelper(Constify(arg0)), rv);
361
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
362
0
    return false;
363
0
  }
364
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
365
0
366
0
  return true;
367
0
}
368
369
static const JSJitInfo bgColor_getterinfo = {
370
  { (JSJitGetterOp)get_bgColor },
371
  { prototypes::id::HTMLBodyElement },
372
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
373
  JSJitInfo::Getter,
374
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
375
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
376
  false,  /* isInfallible. False in setters. */
377
  false,  /* isMovable.  Not relevant for setters. */
378
  false, /* isEliminatable.  Not relevant for setters. */
379
  false, /* isAlwaysInSlot.  Only relevant for getters. */
380
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
381
  false,  /* isTypedMethod.  Only relevant for methods. */
382
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
383
};
384
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
385
static_assert(0 < 1, "There is no slot for us");
386
static const JSJitInfo bgColor_setterinfo = {
387
  { (JSJitGetterOp)set_bgColor },
388
  { prototypes::id::HTMLBodyElement },
389
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
390
  JSJitInfo::Setter,
391
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
392
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
393
  false,  /* isInfallible. False in setters. */
394
  false,  /* isMovable.  Not relevant for setters. */
395
  false, /* isEliminatable.  Not relevant for setters. */
396
  false, /* isAlwaysInSlot.  Only relevant for getters. */
397
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
398
  false,  /* isTypedMethod.  Only relevant for methods. */
399
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
400
};
401
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
402
static_assert(0 < 1, "There is no slot for us");
403
404
MOZ_CAN_RUN_SCRIPT static bool
405
get_background(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
406
0
{
407
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.background", DOM, cx);
408
0
409
0
  DOMString result;
410
0
  self->GetBackground(result);
411
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
412
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
413
0
    return false;
414
0
  }
415
0
  return true;
416
0
}
417
418
MOZ_CAN_RUN_SCRIPT static bool
419
set_background(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
420
0
{
421
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.background", DOM, cx);
422
0
423
0
  binding_detail::FakeString arg0;
424
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
425
0
    return false;
426
0
  }
427
0
  Maybe<AutoCEReaction> ceReaction;
428
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
429
0
    DocGroup* docGroup = self->GetDocGroup();
430
0
    if (docGroup) {
431
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
432
0
    }
433
0
  }
434
0
  FastErrorResult rv;
435
0
  self->SetBackground(NonNullHelper(Constify(arg0)), rv);
436
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
437
0
    return false;
438
0
  }
439
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
440
0
441
0
  return true;
442
0
}
443
444
static const JSJitInfo background_getterinfo = {
445
  { (JSJitGetterOp)get_background },
446
  { prototypes::id::HTMLBodyElement },
447
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
448
  JSJitInfo::Getter,
449
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
450
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
451
  false,  /* isInfallible. False in setters. */
452
  false,  /* isMovable.  Not relevant for setters. */
453
  false, /* isEliminatable.  Not relevant for setters. */
454
  false, /* isAlwaysInSlot.  Only relevant for getters. */
455
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
456
  false,  /* isTypedMethod.  Only relevant for methods. */
457
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
458
};
459
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
460
static_assert(0 < 1, "There is no slot for us");
461
static const JSJitInfo background_setterinfo = {
462
  { (JSJitGetterOp)set_background },
463
  { prototypes::id::HTMLBodyElement },
464
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
465
  JSJitInfo::Setter,
466
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
467
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
468
  false,  /* isInfallible. False in setters. */
469
  false,  /* isMovable.  Not relevant for setters. */
470
  false, /* isEliminatable.  Not relevant for setters. */
471
  false, /* isAlwaysInSlot.  Only relevant for getters. */
472
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
473
  false,  /* isTypedMethod.  Only relevant for methods. */
474
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
475
};
476
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
477
static_assert(0 < 1, "There is no slot for us");
478
479
MOZ_CAN_RUN_SCRIPT static bool
480
get_onafterprint(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
481
0
{
482
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.onafterprint", DOM, cx);
483
0
484
0
  RefPtr<EventHandlerNonNull> result(self->GetOnafterprint());
485
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
486
0
  if (result) {
487
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
488
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
489
0
      return false;
490
0
    }
491
0
    return true;
492
0
  } else {
493
0
    args.rval().setNull();
494
0
    return true;
495
0
  }
496
0
}
497
498
MOZ_CAN_RUN_SCRIPT static bool
499
set_onafterprint(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
500
0
{
501
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.onafterprint", DOM, cx);
502
0
503
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
504
0
  if (args[0].isObject()) {
505
0
    { // scope for tempRoot and tempGlobalRoot if needed
506
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
507
0
    }
508
0
  } else {
509
0
    arg0 = nullptr;
510
0
  }
511
0
  self->SetOnafterprint(Constify(arg0));
512
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
513
0
514
0
  return true;
515
0
}
516
517
static const JSJitInfo onafterprint_getterinfo = {
518
  { (JSJitGetterOp)get_onafterprint },
519
  { prototypes::id::HTMLBodyElement },
520
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
521
  JSJitInfo::Getter,
522
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
523
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
524
  false,  /* isInfallible. False in setters. */
525
  false,  /* isMovable.  Not relevant for setters. */
526
  false, /* isEliminatable.  Not relevant for setters. */
527
  false, /* isAlwaysInSlot.  Only relevant for getters. */
528
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
529
  false,  /* isTypedMethod.  Only relevant for methods. */
530
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
531
};
532
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
533
static_assert(0 < 1, "There is no slot for us");
534
static const JSJitInfo onafterprint_setterinfo = {
535
  { (JSJitGetterOp)set_onafterprint },
536
  { prototypes::id::HTMLBodyElement },
537
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
538
  JSJitInfo::Setter,
539
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
540
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
541
  false,  /* isInfallible. False in setters. */
542
  false,  /* isMovable.  Not relevant for setters. */
543
  false, /* isEliminatable.  Not relevant for setters. */
544
  false, /* isAlwaysInSlot.  Only relevant for getters. */
545
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
546
  false,  /* isTypedMethod.  Only relevant for methods. */
547
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
548
};
549
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
550
static_assert(0 < 1, "There is no slot for us");
551
552
MOZ_CAN_RUN_SCRIPT static bool
553
get_onbeforeprint(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
554
0
{
555
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.onbeforeprint", DOM, cx);
556
0
557
0
  RefPtr<EventHandlerNonNull> result(self->GetOnbeforeprint());
558
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
559
0
  if (result) {
560
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
561
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
562
0
      return false;
563
0
    }
564
0
    return true;
565
0
  } else {
566
0
    args.rval().setNull();
567
0
    return true;
568
0
  }
569
0
}
570
571
MOZ_CAN_RUN_SCRIPT static bool
572
set_onbeforeprint(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
573
0
{
574
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.onbeforeprint", DOM, cx);
575
0
576
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
577
0
  if (args[0].isObject()) {
578
0
    { // scope for tempRoot and tempGlobalRoot if needed
579
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
580
0
    }
581
0
  } else {
582
0
    arg0 = nullptr;
583
0
  }
584
0
  self->SetOnbeforeprint(Constify(arg0));
585
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
586
0
587
0
  return true;
588
0
}
589
590
static const JSJitInfo onbeforeprint_getterinfo = {
591
  { (JSJitGetterOp)get_onbeforeprint },
592
  { prototypes::id::HTMLBodyElement },
593
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
594
  JSJitInfo::Getter,
595
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
596
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
597
  false,  /* isInfallible. False in setters. */
598
  false,  /* isMovable.  Not relevant for setters. */
599
  false, /* isEliminatable.  Not relevant for setters. */
600
  false, /* isAlwaysInSlot.  Only relevant for getters. */
601
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
602
  false,  /* isTypedMethod.  Only relevant for methods. */
603
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
604
};
605
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
606
static_assert(0 < 1, "There is no slot for us");
607
static const JSJitInfo onbeforeprint_setterinfo = {
608
  { (JSJitGetterOp)set_onbeforeprint },
609
  { prototypes::id::HTMLBodyElement },
610
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
611
  JSJitInfo::Setter,
612
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
613
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
614
  false,  /* isInfallible. False in setters. */
615
  false,  /* isMovable.  Not relevant for setters. */
616
  false, /* isEliminatable.  Not relevant for setters. */
617
  false, /* isAlwaysInSlot.  Only relevant for getters. */
618
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
619
  false,  /* isTypedMethod.  Only relevant for methods. */
620
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
621
};
622
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
623
static_assert(0 < 1, "There is no slot for us");
624
625
MOZ_CAN_RUN_SCRIPT static bool
626
get_onbeforeunload(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
627
0
{
628
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.onbeforeunload", DOM, cx);
629
0
630
0
  RefPtr<OnBeforeUnloadEventHandlerNonNull> result(self->GetOnbeforeunload());
631
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
632
0
  if (result) {
633
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
634
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
635
0
      return false;
636
0
    }
637
0
    return true;
638
0
  } else {
639
0
    args.rval().setNull();
640
0
    return true;
641
0
  }
642
0
}
643
644
MOZ_CAN_RUN_SCRIPT static bool
645
set_onbeforeunload(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
646
0
{
647
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.onbeforeunload", DOM, cx);
648
0
649
0
  RootedCallback<RefPtr<binding_detail::FastOnBeforeUnloadEventHandlerNonNull>> arg0(cx);
650
0
  if (args[0].isObject()) {
651
0
    { // scope for tempRoot and tempGlobalRoot if needed
652
0
      arg0 = new binding_detail::FastOnBeforeUnloadEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
653
0
    }
654
0
  } else {
655
0
    arg0 = nullptr;
656
0
  }
657
0
  self->SetOnbeforeunload(Constify(arg0));
658
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
659
0
660
0
  return true;
661
0
}
662
663
static const JSJitInfo onbeforeunload_getterinfo = {
664
  { (JSJitGetterOp)get_onbeforeunload },
665
  { prototypes::id::HTMLBodyElement },
666
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
667
  JSJitInfo::Getter,
668
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
669
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
670
  false,  /* isInfallible. False in setters. */
671
  false,  /* isMovable.  Not relevant for setters. */
672
  false, /* isEliminatable.  Not relevant for setters. */
673
  false, /* isAlwaysInSlot.  Only relevant for getters. */
674
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
675
  false,  /* isTypedMethod.  Only relevant for methods. */
676
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
677
};
678
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
679
static_assert(0 < 1, "There is no slot for us");
680
static const JSJitInfo onbeforeunload_setterinfo = {
681
  { (JSJitGetterOp)set_onbeforeunload },
682
  { prototypes::id::HTMLBodyElement },
683
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
684
  JSJitInfo::Setter,
685
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
686
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
687
  false,  /* isInfallible. False in setters. */
688
  false,  /* isMovable.  Not relevant for setters. */
689
  false, /* isEliminatable.  Not relevant for setters. */
690
  false, /* isAlwaysInSlot.  Only relevant for getters. */
691
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
692
  false,  /* isTypedMethod.  Only relevant for methods. */
693
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
694
};
695
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
696
static_assert(0 < 1, "There is no slot for us");
697
698
MOZ_CAN_RUN_SCRIPT static bool
699
get_onhashchange(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
700
0
{
701
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.onhashchange", DOM, cx);
702
0
703
0
  RefPtr<EventHandlerNonNull> result(self->GetOnhashchange());
704
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
705
0
  if (result) {
706
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
707
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
708
0
      return false;
709
0
    }
710
0
    return true;
711
0
  } else {
712
0
    args.rval().setNull();
713
0
    return true;
714
0
  }
715
0
}
716
717
MOZ_CAN_RUN_SCRIPT static bool
718
set_onhashchange(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
719
0
{
720
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.onhashchange", DOM, cx);
721
0
722
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
723
0
  if (args[0].isObject()) {
724
0
    { // scope for tempRoot and tempGlobalRoot if needed
725
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
726
0
    }
727
0
  } else {
728
0
    arg0 = nullptr;
729
0
  }
730
0
  self->SetOnhashchange(Constify(arg0));
731
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
732
0
733
0
  return true;
734
0
}
735
736
static const JSJitInfo onhashchange_getterinfo = {
737
  { (JSJitGetterOp)get_onhashchange },
738
  { prototypes::id::HTMLBodyElement },
739
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
740
  JSJitInfo::Getter,
741
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
742
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
743
  false,  /* isInfallible. False in setters. */
744
  false,  /* isMovable.  Not relevant for setters. */
745
  false, /* isEliminatable.  Not relevant for setters. */
746
  false, /* isAlwaysInSlot.  Only relevant for getters. */
747
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
748
  false,  /* isTypedMethod.  Only relevant for methods. */
749
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
750
};
751
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
752
static_assert(0 < 1, "There is no slot for us");
753
static const JSJitInfo onhashchange_setterinfo = {
754
  { (JSJitGetterOp)set_onhashchange },
755
  { prototypes::id::HTMLBodyElement },
756
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
757
  JSJitInfo::Setter,
758
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
759
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
760
  false,  /* isInfallible. False in setters. */
761
  false,  /* isMovable.  Not relevant for setters. */
762
  false, /* isEliminatable.  Not relevant for setters. */
763
  false, /* isAlwaysInSlot.  Only relevant for getters. */
764
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
765
  false,  /* isTypedMethod.  Only relevant for methods. */
766
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
767
};
768
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
769
static_assert(0 < 1, "There is no slot for us");
770
771
MOZ_CAN_RUN_SCRIPT static bool
772
get_onlanguagechange(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
773
0
{
774
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.onlanguagechange", DOM, cx);
775
0
776
0
  RefPtr<EventHandlerNonNull> result(self->GetOnlanguagechange());
777
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
778
0
  if (result) {
779
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
780
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
781
0
      return false;
782
0
    }
783
0
    return true;
784
0
  } else {
785
0
    args.rval().setNull();
786
0
    return true;
787
0
  }
788
0
}
789
790
MOZ_CAN_RUN_SCRIPT static bool
791
set_onlanguagechange(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
792
0
{
793
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.onlanguagechange", DOM, cx);
794
0
795
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
796
0
  if (args[0].isObject()) {
797
0
    { // scope for tempRoot and tempGlobalRoot if needed
798
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
799
0
    }
800
0
  } else {
801
0
    arg0 = nullptr;
802
0
  }
803
0
  self->SetOnlanguagechange(Constify(arg0));
804
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
805
0
806
0
  return true;
807
0
}
808
809
static const JSJitInfo onlanguagechange_getterinfo = {
810
  { (JSJitGetterOp)get_onlanguagechange },
811
  { prototypes::id::HTMLBodyElement },
812
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
813
  JSJitInfo::Getter,
814
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
815
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
816
  false,  /* isInfallible. False in setters. */
817
  false,  /* isMovable.  Not relevant for setters. */
818
  false, /* isEliminatable.  Not relevant for setters. */
819
  false, /* isAlwaysInSlot.  Only relevant for getters. */
820
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
821
  false,  /* isTypedMethod.  Only relevant for methods. */
822
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
823
};
824
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
825
static_assert(0 < 1, "There is no slot for us");
826
static const JSJitInfo onlanguagechange_setterinfo = {
827
  { (JSJitGetterOp)set_onlanguagechange },
828
  { prototypes::id::HTMLBodyElement },
829
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
830
  JSJitInfo::Setter,
831
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
832
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
833
  false,  /* isInfallible. False in setters. */
834
  false,  /* isMovable.  Not relevant for setters. */
835
  false, /* isEliminatable.  Not relevant for setters. */
836
  false, /* isAlwaysInSlot.  Only relevant for getters. */
837
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
838
  false,  /* isTypedMethod.  Only relevant for methods. */
839
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
840
};
841
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
842
static_assert(0 < 1, "There is no slot for us");
843
844
MOZ_CAN_RUN_SCRIPT static bool
845
get_onmessage(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
846
0
{
847
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.onmessage", DOM, cx);
848
0
849
0
  RefPtr<EventHandlerNonNull> result(self->GetOnmessage());
850
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
851
0
  if (result) {
852
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
853
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
854
0
      return false;
855
0
    }
856
0
    return true;
857
0
  } else {
858
0
    args.rval().setNull();
859
0
    return true;
860
0
  }
861
0
}
862
863
MOZ_CAN_RUN_SCRIPT static bool
864
set_onmessage(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
865
0
{
866
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.onmessage", DOM, cx);
867
0
868
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
869
0
  if (args[0].isObject()) {
870
0
    { // scope for tempRoot and tempGlobalRoot if needed
871
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
872
0
    }
873
0
  } else {
874
0
    arg0 = nullptr;
875
0
  }
876
0
  self->SetOnmessage(Constify(arg0));
877
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
878
0
879
0
  return true;
880
0
}
881
882
static const JSJitInfo onmessage_getterinfo = {
883
  { (JSJitGetterOp)get_onmessage },
884
  { prototypes::id::HTMLBodyElement },
885
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
886
  JSJitInfo::Getter,
887
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
888
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
889
  false,  /* isInfallible. False in setters. */
890
  false,  /* isMovable.  Not relevant for setters. */
891
  false, /* isEliminatable.  Not relevant for setters. */
892
  false, /* isAlwaysInSlot.  Only relevant for getters. */
893
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
894
  false,  /* isTypedMethod.  Only relevant for methods. */
895
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
896
};
897
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
898
static_assert(0 < 1, "There is no slot for us");
899
static const JSJitInfo onmessage_setterinfo = {
900
  { (JSJitGetterOp)set_onmessage },
901
  { prototypes::id::HTMLBodyElement },
902
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
903
  JSJitInfo::Setter,
904
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
905
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
906
  false,  /* isInfallible. False in setters. */
907
  false,  /* isMovable.  Not relevant for setters. */
908
  false, /* isEliminatable.  Not relevant for setters. */
909
  false, /* isAlwaysInSlot.  Only relevant for getters. */
910
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
911
  false,  /* isTypedMethod.  Only relevant for methods. */
912
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
913
};
914
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
915
static_assert(0 < 1, "There is no slot for us");
916
917
MOZ_CAN_RUN_SCRIPT static bool
918
get_onmessageerror(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
919
0
{
920
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.onmessageerror", DOM, cx);
921
0
922
0
  RefPtr<EventHandlerNonNull> result(self->GetOnmessageerror());
923
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
924
0
  if (result) {
925
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
926
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
927
0
      return false;
928
0
    }
929
0
    return true;
930
0
  } else {
931
0
    args.rval().setNull();
932
0
    return true;
933
0
  }
934
0
}
935
936
MOZ_CAN_RUN_SCRIPT static bool
937
set_onmessageerror(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
938
0
{
939
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.onmessageerror", DOM, cx);
940
0
941
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
942
0
  if (args[0].isObject()) {
943
0
    { // scope for tempRoot and tempGlobalRoot if needed
944
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
945
0
    }
946
0
  } else {
947
0
    arg0 = nullptr;
948
0
  }
949
0
  self->SetOnmessageerror(Constify(arg0));
950
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
951
0
952
0
  return true;
953
0
}
954
955
static const JSJitInfo onmessageerror_getterinfo = {
956
  { (JSJitGetterOp)get_onmessageerror },
957
  { prototypes::id::HTMLBodyElement },
958
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
959
  JSJitInfo::Getter,
960
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
961
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
962
  false,  /* isInfallible. False in setters. */
963
  false,  /* isMovable.  Not relevant for setters. */
964
  false, /* isEliminatable.  Not relevant for setters. */
965
  false, /* isAlwaysInSlot.  Only relevant for getters. */
966
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
967
  false,  /* isTypedMethod.  Only relevant for methods. */
968
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
969
};
970
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
971
static_assert(0 < 1, "There is no slot for us");
972
static const JSJitInfo onmessageerror_setterinfo = {
973
  { (JSJitGetterOp)set_onmessageerror },
974
  { prototypes::id::HTMLBodyElement },
975
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
976
  JSJitInfo::Setter,
977
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
978
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
979
  false,  /* isInfallible. False in setters. */
980
  false,  /* isMovable.  Not relevant for setters. */
981
  false, /* isEliminatable.  Not relevant for setters. */
982
  false, /* isAlwaysInSlot.  Only relevant for getters. */
983
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
984
  false,  /* isTypedMethod.  Only relevant for methods. */
985
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
986
};
987
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
988
static_assert(0 < 1, "There is no slot for us");
989
990
MOZ_CAN_RUN_SCRIPT static bool
991
get_onoffline(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
992
0
{
993
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.onoffline", DOM, cx);
994
0
995
0
  RefPtr<EventHandlerNonNull> result(self->GetOnoffline());
996
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
997
0
  if (result) {
998
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
999
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
1000
0
      return false;
1001
0
    }
1002
0
    return true;
1003
0
  } else {
1004
0
    args.rval().setNull();
1005
0
    return true;
1006
0
  }
1007
0
}
1008
1009
MOZ_CAN_RUN_SCRIPT static bool
1010
set_onoffline(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
1011
0
{
1012
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.onoffline", DOM, cx);
1013
0
1014
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
1015
0
  if (args[0].isObject()) {
1016
0
    { // scope for tempRoot and tempGlobalRoot if needed
1017
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
1018
0
    }
1019
0
  } else {
1020
0
    arg0 = nullptr;
1021
0
  }
1022
0
  self->SetOnoffline(Constify(arg0));
1023
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1024
0
1025
0
  return true;
1026
0
}
1027
1028
static const JSJitInfo onoffline_getterinfo = {
1029
  { (JSJitGetterOp)get_onoffline },
1030
  { prototypes::id::HTMLBodyElement },
1031
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
1032
  JSJitInfo::Getter,
1033
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1034
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
1035
  false,  /* isInfallible. False in setters. */
1036
  false,  /* isMovable.  Not relevant for setters. */
1037
  false, /* isEliminatable.  Not relevant for setters. */
1038
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1039
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1040
  false,  /* isTypedMethod.  Only relevant for methods. */
1041
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1042
};
1043
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1044
static_assert(0 < 1, "There is no slot for us");
1045
static const JSJitInfo onoffline_setterinfo = {
1046
  { (JSJitGetterOp)set_onoffline },
1047
  { prototypes::id::HTMLBodyElement },
1048
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
1049
  JSJitInfo::Setter,
1050
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1051
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1052
  false,  /* isInfallible. False in setters. */
1053
  false,  /* isMovable.  Not relevant for setters. */
1054
  false, /* isEliminatable.  Not relevant for setters. */
1055
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1056
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1057
  false,  /* isTypedMethod.  Only relevant for methods. */
1058
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1059
};
1060
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1061
static_assert(0 < 1, "There is no slot for us");
1062
1063
MOZ_CAN_RUN_SCRIPT static bool
1064
get_ononline(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
1065
0
{
1066
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.ononline", DOM, cx);
1067
0
1068
0
  RefPtr<EventHandlerNonNull> result(self->GetOnonline());
1069
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1070
0
  if (result) {
1071
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
1072
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
1073
0
      return false;
1074
0
    }
1075
0
    return true;
1076
0
  } else {
1077
0
    args.rval().setNull();
1078
0
    return true;
1079
0
  }
1080
0
}
1081
1082
MOZ_CAN_RUN_SCRIPT static bool
1083
set_ononline(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
1084
0
{
1085
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.ononline", DOM, cx);
1086
0
1087
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
1088
0
  if (args[0].isObject()) {
1089
0
    { // scope for tempRoot and tempGlobalRoot if needed
1090
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
1091
0
    }
1092
0
  } else {
1093
0
    arg0 = nullptr;
1094
0
  }
1095
0
  self->SetOnonline(Constify(arg0));
1096
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1097
0
1098
0
  return true;
1099
0
}
1100
1101
static const JSJitInfo ononline_getterinfo = {
1102
  { (JSJitGetterOp)get_ononline },
1103
  { prototypes::id::HTMLBodyElement },
1104
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
1105
  JSJitInfo::Getter,
1106
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1107
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
1108
  false,  /* isInfallible. False in setters. */
1109
  false,  /* isMovable.  Not relevant for setters. */
1110
  false, /* isEliminatable.  Not relevant for setters. */
1111
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1112
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1113
  false,  /* isTypedMethod.  Only relevant for methods. */
1114
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1115
};
1116
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1117
static_assert(0 < 1, "There is no slot for us");
1118
static const JSJitInfo ononline_setterinfo = {
1119
  { (JSJitGetterOp)set_ononline },
1120
  { prototypes::id::HTMLBodyElement },
1121
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
1122
  JSJitInfo::Setter,
1123
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1124
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1125
  false,  /* isInfallible. False in setters. */
1126
  false,  /* isMovable.  Not relevant for setters. */
1127
  false, /* isEliminatable.  Not relevant for setters. */
1128
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1129
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1130
  false,  /* isTypedMethod.  Only relevant for methods. */
1131
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1132
};
1133
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1134
static_assert(0 < 1, "There is no slot for us");
1135
1136
MOZ_CAN_RUN_SCRIPT static bool
1137
get_onpagehide(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
1138
0
{
1139
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.onpagehide", DOM, cx);
1140
0
1141
0
  RefPtr<EventHandlerNonNull> result(self->GetOnpagehide());
1142
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1143
0
  if (result) {
1144
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
1145
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
1146
0
      return false;
1147
0
    }
1148
0
    return true;
1149
0
  } else {
1150
0
    args.rval().setNull();
1151
0
    return true;
1152
0
  }
1153
0
}
1154
1155
MOZ_CAN_RUN_SCRIPT static bool
1156
set_onpagehide(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
1157
0
{
1158
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.onpagehide", DOM, cx);
1159
0
1160
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
1161
0
  if (args[0].isObject()) {
1162
0
    { // scope for tempRoot and tempGlobalRoot if needed
1163
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
1164
0
    }
1165
0
  } else {
1166
0
    arg0 = nullptr;
1167
0
  }
1168
0
  self->SetOnpagehide(Constify(arg0));
1169
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1170
0
1171
0
  return true;
1172
0
}
1173
1174
static const JSJitInfo onpagehide_getterinfo = {
1175
  { (JSJitGetterOp)get_onpagehide },
1176
  { prototypes::id::HTMLBodyElement },
1177
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
1178
  JSJitInfo::Getter,
1179
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1180
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
1181
  false,  /* isInfallible. False in setters. */
1182
  false,  /* isMovable.  Not relevant for setters. */
1183
  false, /* isEliminatable.  Not relevant for setters. */
1184
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1185
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1186
  false,  /* isTypedMethod.  Only relevant for methods. */
1187
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1188
};
1189
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1190
static_assert(0 < 1, "There is no slot for us");
1191
static const JSJitInfo onpagehide_setterinfo = {
1192
  { (JSJitGetterOp)set_onpagehide },
1193
  { prototypes::id::HTMLBodyElement },
1194
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
1195
  JSJitInfo::Setter,
1196
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1197
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1198
  false,  /* isInfallible. False in setters. */
1199
  false,  /* isMovable.  Not relevant for setters. */
1200
  false, /* isEliminatable.  Not relevant for setters. */
1201
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1202
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1203
  false,  /* isTypedMethod.  Only relevant for methods. */
1204
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1205
};
1206
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1207
static_assert(0 < 1, "There is no slot for us");
1208
1209
MOZ_CAN_RUN_SCRIPT static bool
1210
get_onpageshow(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
1211
0
{
1212
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.onpageshow", DOM, cx);
1213
0
1214
0
  RefPtr<EventHandlerNonNull> result(self->GetOnpageshow());
1215
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1216
0
  if (result) {
1217
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
1218
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
1219
0
      return false;
1220
0
    }
1221
0
    return true;
1222
0
  } else {
1223
0
    args.rval().setNull();
1224
0
    return true;
1225
0
  }
1226
0
}
1227
1228
MOZ_CAN_RUN_SCRIPT static bool
1229
set_onpageshow(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
1230
0
{
1231
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.onpageshow", DOM, cx);
1232
0
1233
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
1234
0
  if (args[0].isObject()) {
1235
0
    { // scope for tempRoot and tempGlobalRoot if needed
1236
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
1237
0
    }
1238
0
  } else {
1239
0
    arg0 = nullptr;
1240
0
  }
1241
0
  self->SetOnpageshow(Constify(arg0));
1242
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1243
0
1244
0
  return true;
1245
0
}
1246
1247
static const JSJitInfo onpageshow_getterinfo = {
1248
  { (JSJitGetterOp)get_onpageshow },
1249
  { prototypes::id::HTMLBodyElement },
1250
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
1251
  JSJitInfo::Getter,
1252
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1253
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
1254
  false,  /* isInfallible. False in setters. */
1255
  false,  /* isMovable.  Not relevant for setters. */
1256
  false, /* isEliminatable.  Not relevant for setters. */
1257
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1258
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1259
  false,  /* isTypedMethod.  Only relevant for methods. */
1260
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1261
};
1262
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1263
static_assert(0 < 1, "There is no slot for us");
1264
static const JSJitInfo onpageshow_setterinfo = {
1265
  { (JSJitGetterOp)set_onpageshow },
1266
  { prototypes::id::HTMLBodyElement },
1267
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
1268
  JSJitInfo::Setter,
1269
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1270
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1271
  false,  /* isInfallible. False in setters. */
1272
  false,  /* isMovable.  Not relevant for setters. */
1273
  false, /* isEliminatable.  Not relevant for setters. */
1274
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1275
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1276
  false,  /* isTypedMethod.  Only relevant for methods. */
1277
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1278
};
1279
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1280
static_assert(0 < 1, "There is no slot for us");
1281
1282
MOZ_CAN_RUN_SCRIPT static bool
1283
get_onpopstate(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
1284
0
{
1285
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.onpopstate", DOM, cx);
1286
0
1287
0
  RefPtr<EventHandlerNonNull> result(self->GetOnpopstate());
1288
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1289
0
  if (result) {
1290
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
1291
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
1292
0
      return false;
1293
0
    }
1294
0
    return true;
1295
0
  } else {
1296
0
    args.rval().setNull();
1297
0
    return true;
1298
0
  }
1299
0
}
1300
1301
MOZ_CAN_RUN_SCRIPT static bool
1302
set_onpopstate(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
1303
0
{
1304
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.onpopstate", DOM, cx);
1305
0
1306
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
1307
0
  if (args[0].isObject()) {
1308
0
    { // scope for tempRoot and tempGlobalRoot if needed
1309
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
1310
0
    }
1311
0
  } else {
1312
0
    arg0 = nullptr;
1313
0
  }
1314
0
  self->SetOnpopstate(Constify(arg0));
1315
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1316
0
1317
0
  return true;
1318
0
}
1319
1320
static const JSJitInfo onpopstate_getterinfo = {
1321
  { (JSJitGetterOp)get_onpopstate },
1322
  { prototypes::id::HTMLBodyElement },
1323
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
1324
  JSJitInfo::Getter,
1325
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1326
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
1327
  false,  /* isInfallible. False in setters. */
1328
  false,  /* isMovable.  Not relevant for setters. */
1329
  false, /* isEliminatable.  Not relevant for setters. */
1330
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1331
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1332
  false,  /* isTypedMethod.  Only relevant for methods. */
1333
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1334
};
1335
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1336
static_assert(0 < 1, "There is no slot for us");
1337
static const JSJitInfo onpopstate_setterinfo = {
1338
  { (JSJitGetterOp)set_onpopstate },
1339
  { prototypes::id::HTMLBodyElement },
1340
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
1341
  JSJitInfo::Setter,
1342
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1343
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1344
  false,  /* isInfallible. False in setters. */
1345
  false,  /* isMovable.  Not relevant for setters. */
1346
  false, /* isEliminatable.  Not relevant for setters. */
1347
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1348
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1349
  false,  /* isTypedMethod.  Only relevant for methods. */
1350
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1351
};
1352
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1353
static_assert(0 < 1, "There is no slot for us");
1354
1355
MOZ_CAN_RUN_SCRIPT static bool
1356
get_onstorage(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
1357
0
{
1358
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.onstorage", DOM, cx);
1359
0
1360
0
  RefPtr<EventHandlerNonNull> result(self->GetOnstorage());
1361
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1362
0
  if (result) {
1363
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
1364
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
1365
0
      return false;
1366
0
    }
1367
0
    return true;
1368
0
  } else {
1369
0
    args.rval().setNull();
1370
0
    return true;
1371
0
  }
1372
0
}
1373
1374
MOZ_CAN_RUN_SCRIPT static bool
1375
set_onstorage(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
1376
0
{
1377
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.onstorage", DOM, cx);
1378
0
1379
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
1380
0
  if (args[0].isObject()) {
1381
0
    { // scope for tempRoot and tempGlobalRoot if needed
1382
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
1383
0
    }
1384
0
  } else {
1385
0
    arg0 = nullptr;
1386
0
  }
1387
0
  self->SetOnstorage(Constify(arg0));
1388
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1389
0
1390
0
  return true;
1391
0
}
1392
1393
static const JSJitInfo onstorage_getterinfo = {
1394
  { (JSJitGetterOp)get_onstorage },
1395
  { prototypes::id::HTMLBodyElement },
1396
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
1397
  JSJitInfo::Getter,
1398
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1399
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
1400
  false,  /* isInfallible. False in setters. */
1401
  false,  /* isMovable.  Not relevant for setters. */
1402
  false, /* isEliminatable.  Not relevant for setters. */
1403
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1404
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1405
  false,  /* isTypedMethod.  Only relevant for methods. */
1406
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1407
};
1408
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1409
static_assert(0 < 1, "There is no slot for us");
1410
static const JSJitInfo onstorage_setterinfo = {
1411
  { (JSJitGetterOp)set_onstorage },
1412
  { prototypes::id::HTMLBodyElement },
1413
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
1414
  JSJitInfo::Setter,
1415
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1416
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1417
  false,  /* isInfallible. False in setters. */
1418
  false,  /* isMovable.  Not relevant for setters. */
1419
  false, /* isEliminatable.  Not relevant for setters. */
1420
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1421
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1422
  false,  /* isTypedMethod.  Only relevant for methods. */
1423
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1424
};
1425
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1426
static_assert(0 < 1, "There is no slot for us");
1427
1428
MOZ_CAN_RUN_SCRIPT static bool
1429
get_onunload(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitGetterCallArgs args)
1430
0
{
1431
0
  AUTO_PROFILER_LABEL_FAST("get HTMLBodyElement.onunload", DOM, cx);
1432
0
1433
0
  RefPtr<EventHandlerNonNull> result(self->GetOnunload());
1434
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1435
0
  if (result) {
1436
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
1437
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
1438
0
      return false;
1439
0
    }
1440
0
    return true;
1441
0
  } else {
1442
0
    args.rval().setNull();
1443
0
    return true;
1444
0
  }
1445
0
}
1446
1447
MOZ_CAN_RUN_SCRIPT static bool
1448
set_onunload(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLBodyElement* self, JSJitSetterCallArgs args)
1449
0
{
1450
0
  AUTO_PROFILER_LABEL_FAST("set HTMLBodyElement.onunload", DOM, cx);
1451
0
1452
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
1453
0
  if (args[0].isObject()) {
1454
0
    { // scope for tempRoot and tempGlobalRoot if needed
1455
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
1456
0
    }
1457
0
  } else {
1458
0
    arg0 = nullptr;
1459
0
  }
1460
0
  self->SetOnunload(Constify(arg0));
1461
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1462
0
1463
0
  return true;
1464
0
}
1465
1466
static const JSJitInfo onunload_getterinfo = {
1467
  { (JSJitGetterOp)get_onunload },
1468
  { prototypes::id::HTMLBodyElement },
1469
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
1470
  JSJitInfo::Getter,
1471
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1472
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
1473
  false,  /* isInfallible. False in setters. */
1474
  false,  /* isMovable.  Not relevant for setters. */
1475
  false, /* isEliminatable.  Not relevant for setters. */
1476
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1477
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1478
  false,  /* isTypedMethod.  Only relevant for methods. */
1479
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1480
};
1481
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1482
static_assert(0 < 1, "There is no slot for us");
1483
static const JSJitInfo onunload_setterinfo = {
1484
  { (JSJitGetterOp)set_onunload },
1485
  { prototypes::id::HTMLBodyElement },
1486
  { PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth },
1487
  JSJitInfo::Setter,
1488
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1489
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1490
  false,  /* isInfallible. False in setters. */
1491
  false,  /* isMovable.  Not relevant for setters. */
1492
  false, /* isEliminatable.  Not relevant for setters. */
1493
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1494
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1495
  false,  /* isTypedMethod.  Only relevant for methods. */
1496
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1497
};
1498
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1499
static_assert(0 < 1, "There is no slot for us");
1500
1501
static bool
1502
_addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
1503
0
{
1504
0
  mozilla::dom::HTMLBodyElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLBodyElement>(obj);
1505
0
  // We don't want to preserve if we don't have a wrapper, and we
1506
0
  // obviously can't preserve if we're not initialized.
1507
0
  if (self && self->GetWrapperPreserveColor()) {
1508
0
    PreserveWrapper(self);
1509
0
  }
1510
0
  return true;
1511
0
}
1512
1513
static void
1514
_finalize(js::FreeOp* fop, JSObject* obj)
1515
0
{
1516
0
  mozilla::dom::HTMLBodyElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLBodyElement>(obj);
1517
0
  if (self) {
1518
0
    ClearWrapper(self, self, obj);
1519
0
    AddForDeferredFinalization<mozilla::dom::HTMLBodyElement>(self);
1520
0
  }
1521
0
}
1522
1523
static size_t
1524
_objectMoved(JSObject* obj, JSObject* old)
1525
0
{
1526
0
  mozilla::dom::HTMLBodyElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLBodyElement>(obj);
1527
0
  if (self) {
1528
0
    UpdateWrapper(self, self, obj, old);
1529
0
  }
1530
0
1531
0
  return 0;
1532
0
}
1533
1534
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
1535
#if defined(__clang__)
1536
#pragma clang diagnostic push
1537
#pragma clang diagnostic ignored "-Wmissing-braces"
1538
#endif
1539
static const JSPropertySpec sAttributes_specs[] = {
1540
  { "text", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &text_getterinfo, GenericSetter<NormalThisPolicy>, &text_setterinfo },
1541
  { "link", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &link_getterinfo, GenericSetter<NormalThisPolicy>, &link_setterinfo },
1542
  { "vLink", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &vLink_getterinfo, GenericSetter<NormalThisPolicy>, &vLink_setterinfo },
1543
  { "aLink", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &aLink_getterinfo, GenericSetter<NormalThisPolicy>, &aLink_setterinfo },
1544
  { "bgColor", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &bgColor_getterinfo, GenericSetter<NormalThisPolicy>, &bgColor_setterinfo },
1545
  { "background", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &background_getterinfo, GenericSetter<NormalThisPolicy>, &background_setterinfo },
1546
  { "onafterprint", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onafterprint_getterinfo, GenericSetter<NormalThisPolicy>, &onafterprint_setterinfo },
1547
  { "onbeforeprint", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onbeforeprint_getterinfo, GenericSetter<NormalThisPolicy>, &onbeforeprint_setterinfo },
1548
  { "onbeforeunload", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onbeforeunload_getterinfo, GenericSetter<NormalThisPolicy>, &onbeforeunload_setterinfo },
1549
  { "onhashchange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onhashchange_getterinfo, GenericSetter<NormalThisPolicy>, &onhashchange_setterinfo },
1550
  { "onlanguagechange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onlanguagechange_getterinfo, GenericSetter<NormalThisPolicy>, &onlanguagechange_setterinfo },
1551
  { "onmessage", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onmessage_getterinfo, GenericSetter<NormalThisPolicy>, &onmessage_setterinfo },
1552
  { "onmessageerror", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onmessageerror_getterinfo, GenericSetter<NormalThisPolicy>, &onmessageerror_setterinfo },
1553
  { "onoffline", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onoffline_getterinfo, GenericSetter<NormalThisPolicy>, &onoffline_setterinfo },
1554
  { "ononline", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ononline_getterinfo, GenericSetter<NormalThisPolicy>, &ononline_setterinfo },
1555
  { "onpagehide", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpagehide_getterinfo, GenericSetter<NormalThisPolicy>, &onpagehide_setterinfo },
1556
  { "onpageshow", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpageshow_getterinfo, GenericSetter<NormalThisPolicy>, &onpageshow_setterinfo },
1557
  { "onpopstate", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpopstate_getterinfo, GenericSetter<NormalThisPolicy>, &onpopstate_setterinfo },
1558
  { "onstorage", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onstorage_getterinfo, GenericSetter<NormalThisPolicy>, &onstorage_setterinfo },
1559
  { "onunload", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onunload_getterinfo, GenericSetter<NormalThisPolicy>, &onunload_setterinfo },
1560
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
1561
};
1562
#if defined(__clang__)
1563
#pragma clang diagnostic pop
1564
#endif
1565
1566
1567
static const Prefable<const JSPropertySpec> sAttributes[] = {
1568
  { nullptr, &sAttributes_specs[0] },
1569
  { nullptr, nullptr }
1570
};
1571
1572
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
1573
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
1574
static_assert(20 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
1575
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
1576
1577
1578
static uint16_t sNativeProperties_sortedPropertyIndices[20];
1579
static PropertyInfo sNativeProperties_propertyInfos[20];
1580
1581
static const NativePropertiesN<1> sNativeProperties = {
1582
  false, 0,
1583
  false, 0,
1584
  false, 0,
1585
  true,  0 /* sAttributes */,
1586
  false, 0,
1587
  false, 0,
1588
  false, 0,
1589
  -1,
1590
  20,
1591
  sNativeProperties_sortedPropertyIndices,
1592
  {
1593
    { sAttributes, &sNativeProperties_propertyInfos[0] }
1594
  }
1595
};
1596
static_assert(20 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
1597
    "We have a property info count that is oversized");
1598
1599
static bool
1600
_constructor(JSContext* cx, unsigned argc, JS::Value* vp)
1601
0
{
1602
0
  AUTO_PROFILER_LABEL_FAST("HTMLBodyElement constructor", DOM, cx);
1603
0
1604
0
  return HTMLConstructor(cx, argc, vp,
1605
0
                         constructors::id::HTMLBodyElement,
1606
0
                         prototypes::id::HTMLBodyElement,
1607
0
                         CreateInterfaceObjects);
1608
0
}
1609
1610
static const js::ClassOps sInterfaceObjectClassOps = {
1611
    nullptr,               /* addProperty */
1612
    nullptr,               /* delProperty */
1613
    nullptr,               /* enumerate */
1614
    nullptr,               /* newEnumerate */
1615
    nullptr,               /* resolve */
1616
    nullptr,               /* mayResolve */
1617
    nullptr,               /* finalize */
1618
    _constructor, /* call */
1619
    nullptr,               /* hasInstance */
1620
    _constructor, /* construct */
1621
    nullptr,               /* trace */
1622
};
1623
1624
static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
1625
  {
1626
    "Function",
1627
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE),
1628
    &sInterfaceObjectClassOps,
1629
    JS_NULL_CLASS_SPEC,
1630
    JS_NULL_CLASS_EXT,
1631
    &sInterfaceObjectClassObjectOps
1632
  },
1633
  eInterface,
1634
  true,
1635
  prototypes::id::HTMLBodyElement,
1636
  PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth,
1637
  sNativePropertyHooks,
1638
  "function HTMLBodyElement() {\n    [native code]\n}",
1639
  HTMLElement_Binding::GetConstructorObject
1640
};
1641
1642
static const DOMIfaceAndProtoJSClass sPrototypeClass = {
1643
  {
1644
    "HTMLBodyElementPrototype",
1645
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE),
1646
    JS_NULL_CLASS_OPS,
1647
    JS_NULL_CLASS_SPEC,
1648
    JS_NULL_CLASS_EXT,
1649
    JS_NULL_OBJECT_OPS
1650
  },
1651
  eInterfacePrototype,
1652
  false,
1653
  prototypes::id::HTMLBodyElement,
1654
  PrototypeTraits<prototypes::id::HTMLBodyElement>::Depth,
1655
  sNativePropertyHooks,
1656
  "[object HTMLBodyElementPrototype]",
1657
  HTMLElement_Binding::GetProtoObject
1658
};
1659
1660
static const js::ClassOps sClassOps = {
1661
  _addProperty, /* addProperty */
1662
  nullptr,               /* delProperty */
1663
  nullptr,               /* enumerate */
1664
  nullptr, /* newEnumerate */
1665
  nullptr, /* resolve */
1666
  nullptr, /* mayResolve */
1667
  _finalize, /* finalize */
1668
  nullptr, /* call */
1669
  nullptr,               /* hasInstance */
1670
  nullptr,               /* construct */
1671
  nullptr, /* trace */
1672
};
1673
1674
static const js::ClassExtension sClassExtension = {
1675
  nullptr, /* weakmapKeyDelegateOp */
1676
  _objectMoved /* objectMovedOp */
1677
};
1678
1679
static const DOMJSClass sClass = {
1680
  { "HTMLBodyElement",
1681
    JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
1682
    &sClassOps,
1683
    JS_NULL_CLASS_SPEC,
1684
    &sClassExtension,
1685
    JS_NULL_OBJECT_OPS
1686
  },
1687
  { prototypes::id::EventTarget, prototypes::id::Node, prototypes::id::Element, prototypes::id::HTMLElement, prototypes::id::HTMLBodyElement, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
1688
  IsBaseOf<nsISupports, mozilla::dom::HTMLBodyElement >::value,
1689
  sNativePropertyHooks,
1690
  FindAssociatedGlobalForNative<mozilla::dom::HTMLBodyElement>::Get,
1691
  GetProtoObjectHandle,
1692
  GetCCParticipant<mozilla::dom::HTMLBodyElement>::Get()
1693
};
1694
static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
1695
              "Must have the right minimal number of reserved slots.");
1696
static_assert(1 >= 1,
1697
              "Must have enough reserved slots.");
1698
1699
const JSClass*
1700
GetJSClass()
1701
0
{
1702
0
  return sClass.ToJSClass();
1703
0
}
1704
1705
bool
1706
Wrap(JSContext* aCx, mozilla::dom::HTMLBodyElement* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
1707
0
{
1708
0
  static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::dom::HTMLBodyElement>::value,
1709
0
                "Shouldn't have wrappercached things that are not refcounted.");
1710
0
  MOZ_ASSERT(static_cast<mozilla::dom::HTMLBodyElement*>(aObject) ==
1711
0
             reinterpret_cast<mozilla::dom::HTMLBodyElement*>(aObject),
1712
0
             "Multiple inheritance for mozilla::dom::HTMLBodyElement is broken.");
1713
0
  MOZ_ASSERT(static_cast<nsGenericHTMLElement*>(aObject) ==
1714
0
             reinterpret_cast<nsGenericHTMLElement*>(aObject),
1715
0
             "Multiple inheritance for nsGenericHTMLElement is broken.");
1716
0
  MOZ_ASSERT(static_cast<mozilla::dom::Element*>(aObject) ==
1717
0
             reinterpret_cast<mozilla::dom::Element*>(aObject),
1718
0
             "Multiple inheritance for mozilla::dom::Element is broken.");
1719
0
  MOZ_ASSERT(static_cast<nsINode*>(aObject) ==
1720
0
             reinterpret_cast<nsINode*>(aObject),
1721
0
             "Multiple inheritance for nsINode is broken.");
1722
0
  MOZ_ASSERT(static_cast<mozilla::dom::EventTarget*>(aObject) ==
1723
0
             reinterpret_cast<mozilla::dom::EventTarget*>(aObject),
1724
0
             "Multiple inheritance for mozilla::dom::EventTarget is broken.");
1725
0
  MOZ_ASSERT(ToSupportsIsCorrect(aObject));
1726
0
  MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
1727
0
  MOZ_ASSERT(!aCache->GetWrapper(),
1728
0
             "You should probably not be using Wrap() directly; use "
1729
0
             "GetOrCreateDOMReflector instead");
1730
0
1731
0
  MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
1732
0
             "nsISupports must be on our primary inheritance chain");
1733
0
1734
0
  JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
1735
0
  if (!global) {
1736
0
    return false;
1737
0
  }
1738
0
  MOZ_ASSERT(JS_IsGlobalObject(global));
1739
0
  MOZ_ASSERT(JS::ObjectIsNotGray(global));
1740
0
1741
0
  // That might have ended up wrapping us already, due to the wonders
1742
0
  // of XBL.  Check for that, and bail out as needed.
1743
0
  aReflector.set(aCache->GetWrapper());
1744
0
  if (aReflector) {
1745
#ifdef DEBUG
1746
    AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
1747
#endif // DEBUG
1748
    return true;
1749
0
  }
1750
0
1751
0
  JSAutoRealm ar(aCx, global);
1752
0
  JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
1753
0
  if (!canonicalProto) {
1754
0
    return false;
1755
0
  }
1756
0
  JS::Rooted<JSObject*> proto(aCx);
1757
0
  if (aGivenProto) {
1758
0
    proto = aGivenProto;
1759
0
    // Unfortunately, while aGivenProto was in the compartment of aCx
1760
0
    // coming in, we changed compartments to that of "parent" so may need
1761
0
    // to wrap the proto here.
1762
0
    if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) {
1763
0
      if (!JS_WrapObject(aCx, &proto)) {
1764
0
        return false;
1765
0
      }
1766
0
    }
1767
0
  } else {
1768
0
    proto = canonicalProto;
1769
0
  }
1770
0
1771
0
  BindingJSObjectCreator<mozilla::dom::HTMLBodyElement> creator(aCx);
1772
0
  creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
1773
0
  if (!aReflector) {
1774
0
    return false;
1775
0
  }
1776
0
1777
0
  aCache->SetWrapper(aReflector);
1778
0
  creator.InitializationSucceeded();
1779
0
1780
0
  MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&
1781
0
             aCache->GetWrapperPreserveColor() == aReflector);
1782
0
  // If proto != canonicalProto, we have to preserve our wrapper;
1783
0
  // otherwise we won't be able to properly recreate it later, since
1784
0
  // we won't know what proto to use.  Note that we don't check
1785
0
  // aGivenProto here, since it's entirely possible (and even
1786
0
  // somewhat common) to have a non-null aGivenProto which is the
1787
0
  // same as canonicalProto.
1788
0
  if (proto != canonicalProto) {
1789
0
    PreserveWrapper(aObject);
1790
0
  }
1791
0
1792
0
  return true;
1793
0
}
1794
1795
const NativePropertyHooks sNativePropertyHooks[] = { {
1796
  nullptr,
1797
  nullptr,
1798
  nullptr,
1799
  { sNativeProperties.Upcast(), nullptr },
1800
  prototypes::id::HTMLBodyElement,
1801
  constructors::id::HTMLBodyElement,
1802
  HTMLElement_Binding::sNativePropertyHooks,
1803
  &DefaultXrayExpandoObjectClass
1804
} };
1805
1806
void
1807
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
1808
0
{
1809
0
  JS::Handle<JSObject*> parentProto(HTMLElement_Binding::GetProtoObjectHandle(aCx));
1810
0
  if (!parentProto) {
1811
0
    return;
1812
0
  }
1813
0
1814
0
  JS::Handle<JSObject*> constructorProto(HTMLElement_Binding::GetConstructorObjectHandle(aCx));
1815
0
  if (!constructorProto) {
1816
0
    return;
1817
0
  }
1818
0
1819
0
  static bool sIdsInited = false;
1820
0
  if (!sIdsInited && NS_IsMainThread()) {
1821
0
    if (!InitIds(aCx, sNativeProperties.Upcast())) {
1822
0
      return;
1823
0
    }
1824
0
    sIdsInited = true;
1825
0
  }
1826
0
1827
0
  JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::HTMLBodyElement);
1828
0
  JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::HTMLBodyElement);
1829
0
  dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
1830
0
                              &sPrototypeClass.mBase, protoCache,
1831
0
                              nullptr,
1832
0
                              constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr,
1833
0
                              interfaceCache,
1834
0
                              sNativeProperties.Upcast(),
1835
0
                              nullptr,
1836
0
                              "HTMLBodyElement", aDefineOnGlobal,
1837
0
                              nullptr,
1838
0
                              false);
1839
0
}
1840
1841
JSObject*
1842
GetConstructorObject(JSContext* aCx)
1843
0
{
1844
0
  return GetConstructorObjectHandle(aCx);
1845
0
}
1846
1847
} // namespace HTMLBodyElement_Binding
1848
1849
1850
1851
} // namespace dom
1852
} // namespace mozilla