Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dom/bindings/DocumentBinding.cpp
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM Document.webidl BY Codegen.py - DO NOT EDIT */
2
3
#include "AtomList.h"
4
#include "DOMPointBinding.h"
5
#include "DocumentBinding.h"
6
#include "EventHandlerBinding.h"
7
#include "GeometryUtilsBinding.h"
8
#include "NodeBinding.h"
9
#include "NodeFilterBinding.h"
10
#include "WrapperFactory.h"
11
#include "XPathNSResolverBinding.h"
12
#include "jsapi.h"
13
#include "mozilla/FloatingPoint.h"
14
#include "mozilla/OwningNonNull.h"
15
#include "mozilla/Preferences.h"
16
#include "mozilla/dom/Animation.h"
17
#include "mozilla/dom/AnonymousContent.h"
18
#include "mozilla/dom/Attr.h"
19
#include "mozilla/dom/BindingUtils.h"
20
#include "mozilla/dom/BoxObject.h"
21
#include "mozilla/dom/CDATASection.h"
22
#include "mozilla/dom/Comment.h"
23
#include "mozilla/dom/CustomElementRegistry.h"
24
#include "mozilla/dom/DOMImplementation.h"
25
#include "mozilla/dom/DOMJSClass.h"
26
#include "mozilla/dom/DOMPoint.h"
27
#include "mozilla/dom/DOMQuad.h"
28
#include "mozilla/dom/DOMRect.h"
29
#include "mozilla/dom/DOMStringList.h"
30
#include "mozilla/dom/DocGroup.h"
31
#include "mozilla/dom/DocumentFragment.h"
32
#include "mozilla/dom/DocumentL10n.h"
33
#include "mozilla/dom/DocumentTimeline.h"
34
#include "mozilla/dom/DocumentType.h"
35
#include "mozilla/dom/Element.h"
36
#include "mozilla/dom/Event.h"
37
#include "mozilla/dom/EventTarget.h"
38
#include "mozilla/dom/FontFaceSet.h"
39
#include "mozilla/dom/HTMLSharedElement.h"
40
#include "mozilla/dom/Location.h"
41
#include "mozilla/dom/NodeIterator.h"
42
#include "mozilla/dom/NonRefcountedDOMObject.h"
43
#include "mozilla/dom/Nullable.h"
44
#include "mozilla/dom/PrimitiveConversions.h"
45
#include "mozilla/dom/ProcessingInstruction.h"
46
#include "mozilla/dom/Promise.h"
47
#include "mozilla/dom/SVGSVGElement.h"
48
#include "mozilla/dom/ScriptSettings.h"
49
#include "mozilla/dom/Selection.h"
50
#include "mozilla/dom/SimpleGlobalObject.h"
51
#include "mozilla/dom/StyleSheetList.h"
52
#include "mozilla/dom/ToJSValue.h"
53
#include "mozilla/dom/Touch.h"
54
#include "mozilla/dom/TouchEvent.h"
55
#include "mozilla/dom/TreeWalker.h"
56
#include "mozilla/dom/UnionConversions.h"
57
#include "mozilla/dom/UnionTypes.h"
58
#include "mozilla/dom/XPathExpression.h"
59
#include "mozilla/dom/XPathResult.h"
60
#include "mozilla/dom/XrayExpandoClass.h"
61
#include "nsContentList.h"
62
#include "nsContentUtils.h"
63
#include "nsDOMCaretPosition.h"
64
#include "nsDocument.h"
65
#include "nsGenericHTMLElement.h"
66
#include "nsGlobalWindow.h"
67
#include "nsIDOMXULCommandDispatcher.h"
68
#include "nsIDocument.h"
69
#include "nsILoadGroup.h"
70
#include "nsINode.h"
71
#include "nsINodeList.h"
72
#include "nsISupports.h"
73
#include "nsIURI.h"
74
#include "nsPIDOMWindow.h"
75
#include "nsRange.h"
76
#include "nsTextNode.h"
77
#include "xpcjsid.h"
78
79
namespace mozilla {
80
namespace dom {
81
82
namespace binding_detail {}; // Just to make sure it's known as a namespace
83
using namespace mozilla::dom::binding_detail;
84
85
86
namespace VisibilityStateValues {
87
extern const EnumEntry strings[3] = {
88
  {"hidden", 6},
89
  {"visible", 7},
90
  { nullptr, 0 }
91
};
92
} // namespace VisibilityStateValues
93
94
bool
95
ToJSValue(JSContext* aCx, VisibilityState aArgument, JS::MutableHandle<JS::Value> aValue)
96
0
{
97
0
  MOZ_ASSERT(uint32_t(aArgument) < ArrayLength(VisibilityStateValues::strings));
98
0
  JSString* resultStr =
99
0
    JS_NewStringCopyN(aCx, VisibilityStateValues::strings[uint32_t(aArgument)].value,
100
0
                      VisibilityStateValues::strings[uint32_t(aArgument)].length);
101
0
  if (!resultStr) {
102
0
    return false;
103
0
  }
104
0
  aValue.setString(resultStr);
105
0
  return true;
106
0
}
107
108
109
namespace FlashClassificationValues {
110
extern const EnumEntry strings[5] = {
111
  {"unclassified", 12},
112
  {"unknown", 7},
113
  {"allowed", 7},
114
  {"denied", 6},
115
  { nullptr, 0 }
116
};
117
} // namespace FlashClassificationValues
118
119
bool
120
ToJSValue(JSContext* aCx, FlashClassification aArgument, JS::MutableHandle<JS::Value> aValue)
121
0
{
122
0
  MOZ_ASSERT(uint32_t(aArgument) < ArrayLength(FlashClassificationValues::strings));
123
0
  JSString* resultStr =
124
0
    JS_NewStringCopyN(aCx, FlashClassificationValues::strings[uint32_t(aArgument)].value,
125
0
                      FlashClassificationValues::strings[uint32_t(aArgument)].length);
126
0
  if (!resultStr) {
127
0
    return false;
128
0
  }
129
0
  aValue.setString(resultStr);
130
0
  return true;
131
0
}
132
133
134
135
BlockParsingOptions::BlockParsingOptions()
136
0
{
137
0
  // Safe to pass a null context if we pass a null value
138
0
  Init(nullptr, JS::NullHandleValue);
139
0
}
140
141
142
143
bool
144
BlockParsingOptions::InitIds(JSContext* cx, BlockParsingOptionsAtoms* atomsCache)
145
0
{
146
0
  MOZ_ASSERT(!*reinterpret_cast<jsid**>(atomsCache));
147
0
148
0
  // Initialize these in reverse order so that any failure leaves the first one
149
0
  // uninitialized.
150
0
  if (!atomsCache->blockScriptCreated_id.init(cx, "blockScriptCreated")) {
151
0
    return false;
152
0
  }
153
0
  return true;
154
0
}
155
156
bool
157
BlockParsingOptions::Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription, bool passedToJSImpl)
158
0
{
159
0
  // Passing a null JSContext is OK only if we're initing from null,
160
0
  // Since in that case we will not have to do any property gets
161
0
  // Also evaluate isNullOrUndefined in order to avoid false-positive
162
0
  // checkers by static analysis tools
163
0
  MOZ_ASSERT_IF(!cx, val.isNull() && val.isNullOrUndefined());
164
0
  BlockParsingOptionsAtoms* atomsCache = nullptr;
165
0
  if (cx) {
166
0
    atomsCache = GetAtomCache<BlockParsingOptionsAtoms>(cx);
167
0
    if (!*reinterpret_cast<jsid**>(atomsCache) && !InitIds(cx, atomsCache)) {
168
0
      return false;
169
0
    }
170
0
  }
171
0
172
0
  if (!IsConvertibleToDictionary(val)) {
173
0
    return ThrowErrorMessage(cx, MSG_NOT_DICTIONARY, sourceDescription);
174
0
  }
175
0
176
0
  bool isNull = val.isNullOrUndefined();
177
0
  // We only need these if !isNull, in which case we have |cx|.
178
0
  Maybe<JS::Rooted<JSObject *> > object;
179
0
  Maybe<JS::Rooted<JS::Value> > temp;
180
0
  if (!isNull) {
181
0
    MOZ_ASSERT(cx);
182
0
    object.emplace(cx, &val.toObject());
183
0
    temp.emplace(cx);
184
0
  }
185
0
  if (!isNull) {
186
0
    if (!JS_GetPropertyById(cx, *object, atomsCache->blockScriptCreated_id, temp.ptr())) {
187
0
      return false;
188
0
    }
189
0
  }
190
0
  if (!isNull && !temp->isUndefined()) {
191
0
    if (!ValueToPrimitive<bool, eDefault>(cx, temp.ref(), &mBlockScriptCreated)) {
192
0
      return false;
193
0
    }
194
0
  } else {
195
0
    mBlockScriptCreated = true;
196
0
  }
197
0
  mIsAnyMemberPresent = true;
198
0
  return true;
199
0
}
200
201
bool
202
BlockParsingOptions::Init(const nsAString& aJSON)
203
0
{
204
0
  AutoJSAPI jsapi;
205
0
  JSObject* cleanGlobal = SimpleGlobalObject::Create(SimpleGlobalObject::GlobalType::BindingDetail);
206
0
  if (!cleanGlobal) {
207
0
    return false;
208
0
  }
209
0
  if (!jsapi.Init(cleanGlobal)) {
210
0
    return false;
211
0
  }
212
0
  JSContext* cx = jsapi.cx();
213
0
  JS::Rooted<JS::Value> json(cx);
214
0
  bool ok = ParseJSON(cx, aJSON, &json);
215
0
  NS_ENSURE_TRUE(ok, false);
216
0
  return Init(cx, json);
217
0
}
218
219
bool
220
BlockParsingOptions::ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const
221
0
{
222
0
  BlockParsingOptionsAtoms* atomsCache = GetAtomCache<BlockParsingOptionsAtoms>(cx);
223
0
  if (!*reinterpret_cast<jsid**>(atomsCache) && !InitIds(cx, atomsCache)) {
224
0
    return false;
225
0
  }
226
0
227
0
  JS::Rooted<JSObject*> obj(cx, JS_NewPlainObject(cx));
228
0
  if (!obj) {
229
0
    return false;
230
0
  }
231
0
  rval.set(JS::ObjectValue(*obj));
232
0
233
0
  do {
234
0
    // block for our 'break' successCode and scope for 'temp' and 'currentValue'
235
0
    JS::Rooted<JS::Value> temp(cx);
236
0
    bool const & currentValue = mBlockScriptCreated;
237
0
    temp.setBoolean(currentValue);
238
0
    if (!JS_DefinePropertyById(cx, obj, atomsCache->blockScriptCreated_id, temp, JSPROP_ENUMERATE)) {
239
0
      return false;
240
0
    }
241
0
    break;
242
0
  } while(false);
243
0
244
0
  return true;
245
0
}
246
247
bool
248
BlockParsingOptions::ToJSON(nsAString& aJSON) const
249
0
{
250
0
  AutoJSAPI jsapi;
251
0
  jsapi.Init();
252
0
  JSContext *cx = jsapi.cx();
253
0
  // It's safe to use UnprivilegedJunkScopeOrWorkerGlobal here
254
0
  // because we'll only be creating objects, in ways that have no
255
0
  // side-effects, followed by a call to JS::ToJSONMaybeSafely,
256
0
  // which likewise guarantees no side-effects for the sorts of
257
0
  // things we will pass it.
258
0
  JSAutoRealm ar(cx, UnprivilegedJunkScopeOrWorkerGlobal());
259
0
  JS::Rooted<JS::Value> val(cx);
260
0
  if (!ToObjectInternal(cx, &val)) {
261
0
    return false;
262
0
  }
263
0
  JS::Rooted<JSObject*> obj(cx, &val.toObject());
264
0
  return StringifyToJSON(cx, obj, aJSON);
265
0
}
266
267
void
268
BlockParsingOptions::TraceDictionary(JSTracer* trc)
269
0
{
270
0
}
271
272
BlockParsingOptions&
273
BlockParsingOptions::operator=(const BlockParsingOptions& aOther)
274
0
{
275
0
  DictionaryBase::operator=(aOther);
276
0
  mBlockScriptCreated = aOther.mBlockScriptCreated;
277
0
  return *this;
278
0
}
279
280
namespace binding_detail {
281
} // namespace binding_detail
282
283
284
285
ElementCreationOptions::ElementCreationOptions()
286
0
{
287
0
  // Safe to pass a null context if we pass a null value
288
0
  Init(nullptr, JS::NullHandleValue);
289
0
}
290
291
292
293
bool
294
ElementCreationOptions::InitIds(JSContext* cx, ElementCreationOptionsAtoms* atomsCache)
295
0
{
296
0
  MOZ_ASSERT(!*reinterpret_cast<jsid**>(atomsCache));
297
0
298
0
  // Initialize these in reverse order so that any failure leaves the first one
299
0
  // uninitialized.
300
0
  if (!atomsCache->pseudo_id.init(cx, "pseudo") ||
301
0
      !atomsCache->is_id.init(cx, "is")) {
302
0
    return false;
303
0
  }
304
0
  return true;
305
0
}
306
307
bool
308
ElementCreationOptions::Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription, bool passedToJSImpl)
309
0
{
310
0
  // Passing a null JSContext is OK only if we're initing from null,
311
0
  // Since in that case we will not have to do any property gets
312
0
  // Also evaluate isNullOrUndefined in order to avoid false-positive
313
0
  // checkers by static analysis tools
314
0
  MOZ_ASSERT_IF(!cx, val.isNull() && val.isNullOrUndefined());
315
0
  ElementCreationOptionsAtoms* atomsCache = nullptr;
316
0
  if (cx) {
317
0
    atomsCache = GetAtomCache<ElementCreationOptionsAtoms>(cx);
318
0
    if (!*reinterpret_cast<jsid**>(atomsCache) && !InitIds(cx, atomsCache)) {
319
0
      return false;
320
0
    }
321
0
  }
322
0
323
0
  if (!IsConvertibleToDictionary(val)) {
324
0
    return ThrowErrorMessage(cx, MSG_NOT_DICTIONARY, sourceDescription);
325
0
  }
326
0
327
0
  bool isNull = val.isNullOrUndefined();
328
0
  // We only need these if !isNull, in which case we have |cx|.
329
0
  Maybe<JS::Rooted<JSObject *> > object;
330
0
  Maybe<JS::Rooted<JS::Value> > temp;
331
0
  if (!isNull) {
332
0
    MOZ_ASSERT(cx);
333
0
    object.emplace(cx, &val.toObject());
334
0
    temp.emplace(cx);
335
0
  }
336
0
  if (!isNull) {
337
0
    if (!JS_GetPropertyById(cx, *object, atomsCache->is_id, temp.ptr())) {
338
0
      return false;
339
0
    }
340
0
  }
341
0
  if (!isNull && !temp->isUndefined()) {
342
0
    mIs.Construct();
343
0
    if (!ConvertJSValueToString(cx, temp.ref(), eStringify, eStringify, (mIs.Value()))) {
344
0
      return false;
345
0
    }
346
0
    mIsAnyMemberPresent = true;
347
0
  }
348
0
349
0
  if (!isNull) {
350
0
    if (nsContentUtils::ThreadsafeIsSystemCaller(cx)) {
351
0
      if (!JS_GetPropertyById(cx, *object, atomsCache->pseudo_id, temp.ptr())) {
352
0
        return false;
353
0
      }
354
0
    } else {
355
0
      temp->setUndefined();
356
0
    }
357
0
  }
358
0
  if (!isNull && !temp->isUndefined()) {
359
0
    mPseudo.Construct();
360
0
    if (!ConvertJSValueToString(cx, temp.ref(), eStringify, eStringify, (mPseudo.Value()))) {
361
0
      return false;
362
0
    }
363
0
    mIsAnyMemberPresent = true;
364
0
  }
365
0
  return true;
366
0
}
367
368
bool
369
ElementCreationOptions::Init(const nsAString& aJSON)
370
0
{
371
0
  AutoJSAPI jsapi;
372
0
  JSObject* cleanGlobal = SimpleGlobalObject::Create(SimpleGlobalObject::GlobalType::BindingDetail);
373
0
  if (!cleanGlobal) {
374
0
    return false;
375
0
  }
376
0
  if (!jsapi.Init(cleanGlobal)) {
377
0
    return false;
378
0
  }
379
0
  JSContext* cx = jsapi.cx();
380
0
  JS::Rooted<JS::Value> json(cx);
381
0
  bool ok = ParseJSON(cx, aJSON, &json);
382
0
  NS_ENSURE_TRUE(ok, false);
383
0
  return Init(cx, json);
384
0
}
385
386
bool
387
ElementCreationOptions::ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const
388
0
{
389
0
  ElementCreationOptionsAtoms* atomsCache = GetAtomCache<ElementCreationOptionsAtoms>(cx);
390
0
  if (!*reinterpret_cast<jsid**>(atomsCache) && !InitIds(cx, atomsCache)) {
391
0
    return false;
392
0
  }
393
0
394
0
  JS::Rooted<JSObject*> obj(cx, JS_NewPlainObject(cx));
395
0
  if (!obj) {
396
0
    return false;
397
0
  }
398
0
  rval.set(JS::ObjectValue(*obj));
399
0
400
0
  if (mIs.WasPassed()) {
401
0
    do {
402
0
      // block for our 'break' successCode and scope for 'temp' and 'currentValue'
403
0
      JS::Rooted<JS::Value> temp(cx);
404
0
      nsString const & currentValue = mIs.InternalValue();
405
0
      if (!xpc::NonVoidStringToJsval(cx, currentValue, &temp)) {
406
0
        return false;
407
0
      }
408
0
      if (!JS_DefinePropertyById(cx, obj, atomsCache->is_id, temp, JSPROP_ENUMERATE)) {
409
0
        return false;
410
0
      }
411
0
      break;
412
0
    } while(false);
413
0
  }
414
0
415
0
  if (nsContentUtils::ThreadsafeIsSystemCaller(cx)) {
416
0
    if (mPseudo.WasPassed()) {
417
0
      do {
418
0
        // block for our 'break' successCode and scope for 'temp' and 'currentValue'
419
0
        JS::Rooted<JS::Value> temp(cx);
420
0
        nsString const & currentValue = mPseudo.InternalValue();
421
0
        if (!xpc::NonVoidStringToJsval(cx, currentValue, &temp)) {
422
0
          return false;
423
0
        }
424
0
        if (!JS_DefinePropertyById(cx, obj, atomsCache->pseudo_id, temp, JSPROP_ENUMERATE)) {
425
0
          return false;
426
0
        }
427
0
        break;
428
0
      } while(false);
429
0
    }
430
0
  }
431
0
432
0
  return true;
433
0
}
434
435
bool
436
ElementCreationOptions::ToJSON(nsAString& aJSON) const
437
0
{
438
0
  AutoJSAPI jsapi;
439
0
  jsapi.Init();
440
0
  JSContext *cx = jsapi.cx();
441
0
  // It's safe to use UnprivilegedJunkScopeOrWorkerGlobal here
442
0
  // because we'll only be creating objects, in ways that have no
443
0
  // side-effects, followed by a call to JS::ToJSONMaybeSafely,
444
0
  // which likewise guarantees no side-effects for the sorts of
445
0
  // things we will pass it.
446
0
  JSAutoRealm ar(cx, UnprivilegedJunkScopeOrWorkerGlobal());
447
0
  JS::Rooted<JS::Value> val(cx);
448
0
  if (!ToObjectInternal(cx, &val)) {
449
0
    return false;
450
0
  }
451
0
  JS::Rooted<JSObject*> obj(cx, &val.toObject());
452
0
  return StringifyToJSON(cx, obj, aJSON);
453
0
}
454
455
void
456
ElementCreationOptions::TraceDictionary(JSTracer* trc)
457
0
{
458
0
}
459
460
ElementCreationOptions&
461
ElementCreationOptions::operator=(const ElementCreationOptions& aOther)
462
0
{
463
0
  DictionaryBase::operator=(aOther);
464
0
  mIs.Reset();
465
0
  if (aOther.mIs.WasPassed()) {
466
0
    mIs.Construct(aOther.mIs.Value());
467
0
  }
468
0
  mPseudo.Reset();
469
0
  if (aOther.mPseudo.WasPassed()) {
470
0
    mPseudo.Construct(aOther.mPseudo.Value());
471
0
  }
472
0
  return *this;
473
0
}
474
475
namespace binding_detail {
476
} // namespace binding_detail
477
478
479
bool
480
ElementCreationOptionsOrString::ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const
481
0
{
482
0
  switch (mType) {
483
0
    case eUninitialized: {
484
0
      return false;
485
0
      break;
486
0
    }
487
0
    case eElementCreationOptions: {
488
0
      if (!mValue.mElementCreationOptions.Value().ToObjectInternal(cx, rval)) {
489
0
        return false;
490
0
      }
491
0
      return true;
492
0
      break;
493
0
    }
494
0
    case eString: {
495
0
      if (!xpc::NonVoidStringToJsval(cx, mValue.mString.Value(), rval)) {
496
0
        return false;
497
0
      }
498
0
      return true;
499
0
      break;
500
0
    }
501
0
    default: {
502
0
      return false;
503
0
      break;
504
0
    }
505
0
  }
506
0
507
0
  return false;
508
0
}
509
510
511
ElementCreationOptions&
512
OwningElementCreationOptionsOrString::RawSetAsElementCreationOptions()
513
0
{
514
0
  if (mType == eElementCreationOptions) {
515
0
    return mValue.mElementCreationOptions.Value();
516
0
  }
517
0
  MOZ_ASSERT(mType == eUninitialized);
518
0
  mType = eElementCreationOptions;
519
0
  return mValue.mElementCreationOptions.SetValue();
520
0
}
521
522
ElementCreationOptions&
523
OwningElementCreationOptionsOrString::SetAsElementCreationOptions()
524
0
{
525
0
  if (mType == eElementCreationOptions) {
526
0
    return mValue.mElementCreationOptions.Value();
527
0
  }
528
0
  Uninit();
529
0
  mType = eElementCreationOptions;
530
0
  return mValue.mElementCreationOptions.SetValue();
531
0
}
532
533
bool
534
OwningElementCreationOptionsOrString::TrySetToElementCreationOptions(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl)
535
0
{
536
0
  tryNext = false;
537
0
  { // scope for memberSlot
538
0
    ElementCreationOptions& memberSlot = RawSetAsElementCreationOptions();
539
0
    if (!IsConvertibleToDictionary(value)) {
540
0
      DestroyElementCreationOptions();
541
0
      tryNext = true;
542
0
      return true;
543
0
    }
544
0
    if (!memberSlot.Init(cx, value,  "Member of ElementCreationOptionsOrString", passedToJSImpl)) {
545
0
      return false;
546
0
    }
547
0
  }
548
0
  return true;
549
0
}
550
551
void
552
OwningElementCreationOptionsOrString::DestroyElementCreationOptions()
553
0
{
554
0
  MOZ_ASSERT(IsElementCreationOptions(), "Wrong type!");
555
0
  mValue.mElementCreationOptions.Destroy();
556
0
  mType = eUninitialized;
557
0
}
558
559
560
561
562
nsString&
563
OwningElementCreationOptionsOrString::RawSetAsString()
564
0
{
565
0
  if (mType == eString) {
566
0
    return mValue.mString.Value();
567
0
  }
568
0
  MOZ_ASSERT(mType == eUninitialized);
569
0
  mType = eString;
570
0
  return mValue.mString.SetValue();
571
0
}
572
573
nsString&
574
OwningElementCreationOptionsOrString::SetAsString()
575
0
{
576
0
  if (mType == eString) {
577
0
    return mValue.mString.Value();
578
0
  }
579
0
  Uninit();
580
0
  mType = eString;
581
0
  return mValue.mString.SetValue();
582
0
}
583
584
bool
585
OwningElementCreationOptionsOrString::TrySetToString(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl)
586
0
{
587
0
  tryNext = false;
588
0
  { // scope for memberSlot
589
0
    nsString& memberSlot = RawSetAsString();
590
0
    if (!ConvertJSValueToString(cx, value, eStringify, eStringify, memberSlot)) {
591
0
      return false;
592
0
    }
593
0
  }
594
0
  return true;
595
0
}
596
597
598
void
599
OwningElementCreationOptionsOrString::DestroyString()
600
0
{
601
0
  MOZ_ASSERT(IsString(), "Wrong type!");
602
0
  mValue.mString.Destroy();
603
0
  mType = eUninitialized;
604
0
}
605
606
607
608
609
void
610
OwningElementCreationOptionsOrString::Uninit()
611
{
612
  switch (mType) {
613
    case eUninitialized: {
614
      break;
615
    }
616
    case eElementCreationOptions: {
617
      DestroyElementCreationOptions();
618
      break;
619
    }
620
    case eString: {
621
      DestroyString();
622
      break;
623
    }
624
  }
625
}
626
627
bool
628
OwningElementCreationOptionsOrString::ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const
629
0
{
630
0
  switch (mType) {
631
0
    case eUninitialized: {
632
0
      return false;
633
0
      break;
634
0
    }
635
0
    case eElementCreationOptions: {
636
0
      if (!mValue.mElementCreationOptions.Value().ToObjectInternal(cx, rval)) {
637
0
        return false;
638
0
      }
639
0
      return true;
640
0
      break;
641
0
    }
642
0
    case eString: {
643
0
      if (!xpc::NonVoidStringToJsval(cx, mValue.mString.Value(), rval)) {
644
0
        return false;
645
0
      }
646
0
      return true;
647
0
      break;
648
0
    }
649
0
    default: {
650
0
      return false;
651
0
      break;
652
0
    }
653
0
  }
654
0
655
0
  return false;
656
0
}
657
658
void
659
OwningElementCreationOptionsOrString::TraceUnion(JSTracer* trc)
660
0
{
661
0
}
662
663
OwningElementCreationOptionsOrString&
664
OwningElementCreationOptionsOrString::operator=(const OwningElementCreationOptionsOrString& aOther)
665
0
{
666
0
  switch (aOther.mType) {
667
0
    case eUninitialized: {
668
0
      MOZ_ASSERT(mType == eUninitialized,
669
0
                 "We need to destroy ourselves?");
670
0
      break;
671
0
    }
672
0
    case eElementCreationOptions: {
673
0
      SetAsElementCreationOptions() = aOther.GetAsElementCreationOptions();
674
0
      break;
675
0
    }
676
0
    case eString: {
677
0
      SetAsString() = aOther.GetAsString();
678
0
      break;
679
0
    }
680
0
  }
681
0
  return *this;
682
0
}
683
684
685
namespace Document_Binding {
686
687
static_assert(IsRefcounted<NativeType>::value == IsRefcounted<Node_Binding::NativeType>::value,
688
              "Can't inherit from an interface with a different ownership model.");
689
690
MOZ_CAN_RUN_SCRIPT static bool
691
get_implementation(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
692
0
{
693
0
  AUTO_PROFILER_LABEL_FAST("get Document.implementation", DOM, cx);
694
0
695
0
  FastErrorResult rv;
696
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMImplementation>(self->GetImplementation(rv)));
697
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
698
0
    return false;
699
0
  }
700
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
701
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
702
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
703
0
    return false;
704
0
  }
705
0
  return true;
706
0
}
707
708
static const JSJitInfo implementation_getterinfo = {
709
  { (JSJitGetterOp)get_implementation },
710
  { prototypes::id::Document },
711
  { PrototypeTraits<prototypes::id::Document>::Depth },
712
  JSJitInfo::Getter,
713
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
714
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
715
  false,  /* isInfallible. False in setters. */
716
  false,  /* isMovable.  Not relevant for setters. */
717
  false, /* isEliminatable.  Not relevant for setters. */
718
  false, /* isAlwaysInSlot.  Only relevant for getters. */
719
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
720
  false,  /* isTypedMethod.  Only relevant for methods. */
721
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
722
};
723
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
724
static_assert(0 < 1, "There is no slot for us");
725
726
MOZ_CAN_RUN_SCRIPT static bool
727
get_URL(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
728
0
{
729
0
  AUTO_PROFILER_LABEL_FAST("get Document.URL", DOM, cx);
730
0
731
0
  FastErrorResult rv;
732
0
  DOMString result;
733
0
  self->GetDocumentURIFromJS(result, nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv);
734
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
735
0
    return false;
736
0
  }
737
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
738
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
739
0
    return false;
740
0
  }
741
0
  return true;
742
0
}
743
744
static const JSJitInfo URL_getterinfo = {
745
  { (JSJitGetterOp)get_URL },
746
  { prototypes::id::Document },
747
  { PrototypeTraits<prototypes::id::Document>::Depth },
748
  JSJitInfo::Getter,
749
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
750
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
751
  false,  /* isInfallible. False in setters. */
752
  false,  /* isMovable.  Not relevant for setters. */
753
  false, /* isEliminatable.  Not relevant for setters. */
754
  false, /* isAlwaysInSlot.  Only relevant for getters. */
755
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
756
  false,  /* isTypedMethod.  Only relevant for methods. */
757
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
758
};
759
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
760
static_assert(0 < 1, "There is no slot for us");
761
762
MOZ_CAN_RUN_SCRIPT static bool
763
get_documentURI(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
764
0
{
765
0
  AUTO_PROFILER_LABEL_FAST("get Document.documentURI", DOM, cx);
766
0
767
0
  FastErrorResult rv;
768
0
  DOMString result;
769
0
  self->GetDocumentURIFromJS(result, nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv);
770
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
771
0
    return false;
772
0
  }
773
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
774
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
775
0
    return false;
776
0
  }
777
0
  return true;
778
0
}
779
780
static const JSJitInfo documentURI_getterinfo = {
781
  { (JSJitGetterOp)get_documentURI },
782
  { prototypes::id::Document },
783
  { PrototypeTraits<prototypes::id::Document>::Depth },
784
  JSJitInfo::Getter,
785
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
786
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
787
  false,  /* isInfallible. False in setters. */
788
  false,  /* isMovable.  Not relevant for setters. */
789
  false, /* isEliminatable.  Not relevant for setters. */
790
  false, /* isAlwaysInSlot.  Only relevant for getters. */
791
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
792
  false,  /* isTypedMethod.  Only relevant for methods. */
793
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
794
};
795
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
796
static_assert(0 < 1, "There is no slot for us");
797
798
MOZ_CAN_RUN_SCRIPT static bool
799
get_compatMode(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
800
0
{
801
0
  AUTO_PROFILER_LABEL_FAST("get Document.compatMode", DOM, cx);
802
0
803
0
  DOMString result;
804
0
  self->GetCompatMode(result);
805
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
806
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
807
0
    return false;
808
0
  }
809
0
  return true;
810
0
}
811
812
static const JSJitInfo compatMode_getterinfo = {
813
  { (JSJitGetterOp)get_compatMode },
814
  { prototypes::id::Document },
815
  { PrototypeTraits<prototypes::id::Document>::Depth },
816
  JSJitInfo::Getter,
817
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
818
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
819
  false,  /* isInfallible. False in setters. */
820
  true,  /* isMovable.  Not relevant for setters. */
821
  true, /* isEliminatable.  Not relevant for setters. */
822
  false, /* isAlwaysInSlot.  Only relevant for getters. */
823
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
824
  false,  /* isTypedMethod.  Only relevant for methods. */
825
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
826
};
827
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
828
static_assert(0 < 1, "There is no slot for us");
829
830
MOZ_CAN_RUN_SCRIPT static bool
831
get_characterSet(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
832
0
{
833
0
  AUTO_PROFILER_LABEL_FAST("get Document.characterSet", DOM, cx);
834
0
835
0
  DOMString result;
836
0
  self->GetCharacterSet(result);
837
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
838
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
839
0
    return false;
840
0
  }
841
0
  return true;
842
0
}
843
844
static const JSJitInfo characterSet_getterinfo = {
845
  { (JSJitGetterOp)get_characterSet },
846
  { prototypes::id::Document },
847
  { PrototypeTraits<prototypes::id::Document>::Depth },
848
  JSJitInfo::Getter,
849
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
850
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
851
  false,  /* isInfallible. False in setters. */
852
  true,  /* isMovable.  Not relevant for setters. */
853
  true, /* isEliminatable.  Not relevant for setters. */
854
  false, /* isAlwaysInSlot.  Only relevant for getters. */
855
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
856
  false,  /* isTypedMethod.  Only relevant for methods. */
857
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
858
};
859
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
860
static_assert(0 < 1, "There is no slot for us");
861
862
MOZ_CAN_RUN_SCRIPT static bool
863
get_charset(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
864
0
{
865
0
  AUTO_PROFILER_LABEL_FAST("get Document.charset", DOM, cx);
866
0
867
0
  DOMString result;
868
0
  self->GetCharacterSet(result);
869
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
870
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
871
0
    return false;
872
0
  }
873
0
  return true;
874
0
}
875
876
static const JSJitInfo charset_getterinfo = {
877
  { (JSJitGetterOp)get_charset },
878
  { prototypes::id::Document },
879
  { PrototypeTraits<prototypes::id::Document>::Depth },
880
  JSJitInfo::Getter,
881
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
882
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
883
  false,  /* isInfallible. False in setters. */
884
  true,  /* isMovable.  Not relevant for setters. */
885
  true, /* isEliminatable.  Not relevant for setters. */
886
  false, /* isAlwaysInSlot.  Only relevant for getters. */
887
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
888
  false,  /* isTypedMethod.  Only relevant for methods. */
889
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
890
};
891
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
892
static_assert(0 < 1, "There is no slot for us");
893
894
MOZ_CAN_RUN_SCRIPT static bool
895
get_inputEncoding(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
896
0
{
897
0
  AUTO_PROFILER_LABEL_FAST("get Document.inputEncoding", DOM, cx);
898
0
899
0
  DOMString result;
900
0
  self->GetCharacterSet(result);
901
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
902
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
903
0
    return false;
904
0
  }
905
0
  return true;
906
0
}
907
908
static const JSJitInfo inputEncoding_getterinfo = {
909
  { (JSJitGetterOp)get_inputEncoding },
910
  { prototypes::id::Document },
911
  { PrototypeTraits<prototypes::id::Document>::Depth },
912
  JSJitInfo::Getter,
913
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
914
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
915
  false,  /* isInfallible. False in setters. */
916
  true,  /* isMovable.  Not relevant for setters. */
917
  true, /* isEliminatable.  Not relevant for setters. */
918
  false, /* isAlwaysInSlot.  Only relevant for getters. */
919
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
920
  false,  /* isTypedMethod.  Only relevant for methods. */
921
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
922
};
923
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
924
static_assert(0 < 1, "There is no slot for us");
925
926
MOZ_CAN_RUN_SCRIPT static bool
927
get_contentType(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
928
0
{
929
0
  AUTO_PROFILER_LABEL_FAST("get Document.contentType", DOM, cx);
930
0
931
0
  DOMString result;
932
0
  self->GetContentType(result);
933
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
934
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
935
0
    return false;
936
0
  }
937
0
  return true;
938
0
}
939
940
static const JSJitInfo contentType_getterinfo = {
941
  { (JSJitGetterOp)get_contentType },
942
  { prototypes::id::Document },
943
  { PrototypeTraits<prototypes::id::Document>::Depth },
944
  JSJitInfo::Getter,
945
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
946
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
947
  false,  /* isInfallible. False in setters. */
948
  true,  /* isMovable.  Not relevant for setters. */
949
  true, /* isEliminatable.  Not relevant for setters. */
950
  false, /* isAlwaysInSlot.  Only relevant for getters. */
951
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
952
  false,  /* isTypedMethod.  Only relevant for methods. */
953
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
954
};
955
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
956
static_assert(0 < 1, "There is no slot for us");
957
958
MOZ_CAN_RUN_SCRIPT static bool
959
get_doctype(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
960
0
{
961
0
  AUTO_PROFILER_LABEL_FAST("get Document.doctype", DOM, cx);
962
0
963
0
  auto result(StrongOrRawPtr<mozilla::dom::DocumentType>(self->GetDoctype()));
964
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
965
0
  if (!result) {
966
0
    args.rval().setNull();
967
0
    return true;
968
0
  }
969
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
970
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
971
0
    return false;
972
0
  }
973
0
  return true;
974
0
}
975
976
static const JSJitInfo doctype_getterinfo = {
977
  { (JSJitGetterOp)get_doctype },
978
  { prototypes::id::Document },
979
  { PrototypeTraits<prototypes::id::Document>::Depth },
980
  JSJitInfo::Getter,
981
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
982
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
983
  false,  /* isInfallible. False in setters. */
984
  true,  /* isMovable.  Not relevant for setters. */
985
  true, /* isEliminatable.  Not relevant for setters. */
986
  false, /* isAlwaysInSlot.  Only relevant for getters. */
987
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
988
  false,  /* isTypedMethod.  Only relevant for methods. */
989
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
990
};
991
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
992
static_assert(0 < 1, "There is no slot for us");
993
994
MOZ_CAN_RUN_SCRIPT static bool
995
get_documentElement(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
996
0
{
997
0
  AUTO_PROFILER_LABEL_FAST("get Document.documentElement", DOM, cx);
998
0
999
0
  auto result(StrongOrRawPtr<mozilla::dom::Element>(self->GetDocumentElement()));
1000
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1001
0
  if (!result) {
1002
0
    args.rval().setNull();
1003
0
    return true;
1004
0
  }
1005
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1006
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1007
0
    return false;
1008
0
  }
1009
0
  return true;
1010
0
}
1011
1012
static const JSJitInfo documentElement_getterinfo = {
1013
  { (JSJitGetterOp)get_documentElement },
1014
  { prototypes::id::Document },
1015
  { PrototypeTraits<prototypes::id::Document>::Depth },
1016
  JSJitInfo::Getter,
1017
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
1018
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
1019
  false,  /* isInfallible. False in setters. */
1020
  true,  /* isMovable.  Not relevant for setters. */
1021
  true, /* isEliminatable.  Not relevant for setters. */
1022
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1023
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1024
  false,  /* isTypedMethod.  Only relevant for methods. */
1025
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1026
};
1027
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1028
static_assert(0 < 1, "There is no slot for us");
1029
1030
MOZ_CAN_RUN_SCRIPT static bool
1031
getElementsByTagName(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1032
0
{
1033
0
  AUTO_PROFILER_LABEL_FAST("Document.getElementsByTagName", DOM, cx);
1034
0
1035
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1036
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.getElementsByTagName");
1037
0
  }
1038
0
  binding_detail::FakeString arg0;
1039
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1040
0
    return false;
1041
0
  }
1042
0
  auto result(StrongOrRawPtr<nsIHTMLCollection>(self->GetElementsByTagName(NonNullHelper(Constify(arg0)))));
1043
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1044
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1045
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1046
0
    return false;
1047
0
  }
1048
0
  return true;
1049
0
}
1050
1051
static const JSJitInfo::ArgType getElementsByTagName_methodinfo_argTypes[] = { JSJitInfo::String, JSJitInfo::ArgTypeListEnd };
1052
static const JSTypedMethodJitInfo getElementsByTagName_methodinfo = {
1053
  {
1054
    { (JSJitGetterOp)getElementsByTagName },
1055
    { prototypes::id::Document },
1056
    { PrototypeTraits<prototypes::id::Document>::Depth },
1057
    JSJitInfo::Method,
1058
    JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
1059
    JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1060
    false,  /* isInfallible. False in setters. */
1061
    true,  /* isMovable.  Not relevant for setters. */
1062
    true, /* isEliminatable.  Not relevant for setters. */
1063
    false, /* isAlwaysInSlot.  Only relevant for getters. */
1064
    false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1065
    true,  /* isTypedMethod.  Only relevant for methods. */
1066
    0   /* Reserved slot index, if we're stored in a slot, else 0. */
1067
  },
1068
  getElementsByTagName_methodinfo_argTypes
1069
};
1070
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1071
static_assert(0 < 1, "There is no slot for us");
1072
1073
MOZ_CAN_RUN_SCRIPT static bool
1074
getElementsByTagNameNS(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1075
0
{
1076
0
  AUTO_PROFILER_LABEL_FAST("Document.getElementsByTagNameNS", DOM, cx);
1077
0
1078
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
1079
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.getElementsByTagNameNS");
1080
0
  }
1081
0
  binding_detail::FakeString arg0;
1082
0
  if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
1083
0
    return false;
1084
0
  }
1085
0
  binding_detail::FakeString arg1;
1086
0
  if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) {
1087
0
    return false;
1088
0
  }
1089
0
  FastErrorResult rv;
1090
0
  auto result(StrongOrRawPtr<nsIHTMLCollection>(self->GetElementsByTagNameNS(NonNullHelper(Constify(arg0)), NonNullHelper(Constify(arg1)), rv)));
1091
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1092
0
    return false;
1093
0
  }
1094
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1095
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1096
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1097
0
    return false;
1098
0
  }
1099
0
  return true;
1100
0
}
1101
1102
static const JSJitInfo::ArgType getElementsByTagNameNS_methodinfo_argTypes[] = { JSJitInfo::ArgType(JSJitInfo::Null | JSJitInfo::String), JSJitInfo::String, JSJitInfo::ArgTypeListEnd };
1103
static const JSTypedMethodJitInfo getElementsByTagNameNS_methodinfo = {
1104
  {
1105
    { (JSJitGetterOp)getElementsByTagNameNS },
1106
    { prototypes::id::Document },
1107
    { PrototypeTraits<prototypes::id::Document>::Depth },
1108
    JSJitInfo::Method,
1109
    JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
1110
    JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1111
    false,  /* isInfallible. False in setters. */
1112
    false,  /* isMovable.  Not relevant for setters. */
1113
    false, /* isEliminatable.  Not relevant for setters. */
1114
    false, /* isAlwaysInSlot.  Only relevant for getters. */
1115
    false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1116
    true,  /* isTypedMethod.  Only relevant for methods. */
1117
    0   /* Reserved slot index, if we're stored in a slot, else 0. */
1118
  },
1119
  getElementsByTagNameNS_methodinfo_argTypes
1120
};
1121
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1122
static_assert(0 < 1, "There is no slot for us");
1123
1124
MOZ_CAN_RUN_SCRIPT static bool
1125
getElementsByClassName(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1126
0
{
1127
0
  AUTO_PROFILER_LABEL_FAST("Document.getElementsByClassName", DOM, cx);
1128
0
1129
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1130
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.getElementsByClassName");
1131
0
  }
1132
0
  binding_detail::FakeString arg0;
1133
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1134
0
    return false;
1135
0
  }
1136
0
  auto result(StrongOrRawPtr<nsIHTMLCollection>(self->GetElementsByClassName(NonNullHelper(Constify(arg0)))));
1137
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1138
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1139
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1140
0
    return false;
1141
0
  }
1142
0
  return true;
1143
0
}
1144
1145
static const JSJitInfo::ArgType getElementsByClassName_methodinfo_argTypes[] = { JSJitInfo::String, JSJitInfo::ArgTypeListEnd };
1146
static const JSTypedMethodJitInfo getElementsByClassName_methodinfo = {
1147
  {
1148
    { (JSJitGetterOp)getElementsByClassName },
1149
    { prototypes::id::Document },
1150
    { PrototypeTraits<prototypes::id::Document>::Depth },
1151
    JSJitInfo::Method,
1152
    JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
1153
    JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1154
    false,  /* isInfallible. False in setters. */
1155
    true,  /* isMovable.  Not relevant for setters. */
1156
    true, /* isEliminatable.  Not relevant for setters. */
1157
    false, /* isAlwaysInSlot.  Only relevant for getters. */
1158
    false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1159
    true,  /* isTypedMethod.  Only relevant for methods. */
1160
    0   /* Reserved slot index, if we're stored in a slot, else 0. */
1161
  },
1162
  getElementsByClassName_methodinfo_argTypes
1163
};
1164
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1165
static_assert(0 < 1, "There is no slot for us");
1166
1167
MOZ_CAN_RUN_SCRIPT static bool
1168
getElementById(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1169
0
{
1170
0
  AUTO_PROFILER_LABEL_FAST("Document.getElementById", DOM, cx);
1171
0
1172
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1173
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.getElementById");
1174
0
  }
1175
0
  binding_detail::FakeString arg0;
1176
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1177
0
    return false;
1178
0
  }
1179
0
  auto result(StrongOrRawPtr<mozilla::dom::Element>(self->GetElementById(NonNullHelper(Constify(arg0)))));
1180
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1181
0
  if (!result) {
1182
0
    args.rval().setNull();
1183
0
    return true;
1184
0
  }
1185
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1186
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1187
0
    return false;
1188
0
  }
1189
0
  return true;
1190
0
}
1191
1192
static const JSJitInfo::ArgType getElementById_methodinfo_argTypes[] = { JSJitInfo::String, JSJitInfo::ArgTypeListEnd };
1193
static const JSTypedMethodJitInfo getElementById_methodinfo = {
1194
  {
1195
    { (JSJitGetterOp)getElementById },
1196
    { prototypes::id::Document },
1197
    { PrototypeTraits<prototypes::id::Document>::Depth },
1198
    JSJitInfo::Method,
1199
    JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
1200
    JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
1201
    false,  /* isInfallible. False in setters. */
1202
    true,  /* isMovable.  Not relevant for setters. */
1203
    true, /* isEliminatable.  Not relevant for setters. */
1204
    false, /* isAlwaysInSlot.  Only relevant for getters. */
1205
    false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1206
    true,  /* isTypedMethod.  Only relevant for methods. */
1207
    0   /* Reserved slot index, if we're stored in a slot, else 0. */
1208
  },
1209
  getElementById_methodinfo_argTypes
1210
};
1211
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1212
static_assert(0 < 1, "There is no slot for us");
1213
1214
MOZ_CAN_RUN_SCRIPT static bool
1215
createElement(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1216
0
{
1217
0
  AUTO_PROFILER_LABEL_FAST("Document.createElement", DOM, cx);
1218
0
1219
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1220
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.createElement");
1221
0
  }
1222
0
  binding_detail::FakeString arg0;
1223
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1224
0
    return false;
1225
0
  }
1226
0
  ElementCreationOptionsOrString arg1;
1227
0
  ElementCreationOptionsOrStringArgument arg1_holder(arg1);
1228
0
  if (!(args.hasDefined(1))) {
1229
0
    if (!arg1.RawSetAsElementCreationOptions().Init(cx, JS::NullHandleValue, "Member of ElementCreationOptionsOrString")) {
1230
0
      return false;
1231
0
    }
1232
0
  } else {
1233
0
    {
1234
0
      bool done = false, failed = false, tryNext;
1235
0
      if (!done) {
1236
0
        done = (failed = !arg1_holder.TrySetToElementCreationOptions(cx, args[1], tryNext, false)) || !tryNext;
1237
0
      }
1238
0
      if (!done) {
1239
0
        do {
1240
0
          done = (failed = !arg1_holder.TrySetToString(cx, args[1], tryNext)) || !tryNext;
1241
0
          break;
1242
0
        } while (false);
1243
0
      }
1244
0
      if (failed) {
1245
0
        return false;
1246
0
      }
1247
0
      if (!done) {
1248
0
        ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of Document.createElement", "ElementCreationOptions");
1249
0
        return false;
1250
0
      }
1251
0
    }
1252
0
  }
1253
0
  Maybe<AutoCEReaction> ceReaction;
1254
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
1255
0
    DocGroup* docGroup = self->GetDocGroup();
1256
0
    if (docGroup) {
1257
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
1258
0
    }
1259
0
  }
1260
0
  FastErrorResult rv;
1261
0
  auto result(StrongOrRawPtr<mozilla::dom::Element>(self->CreateElement(NonNullHelper(Constify(arg0)), Constify(arg1), rv)));
1262
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1263
0
    return false;
1264
0
  }
1265
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1266
0
  static_assert(!IsPointer<decltype(result)>::value,
1267
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
1268
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1269
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1270
0
    return false;
1271
0
  }
1272
0
  return true;
1273
0
}
1274
1275
static const JSJitInfo createElement_methodinfo = {
1276
  { (JSJitGetterOp)createElement },
1277
  { prototypes::id::Document },
1278
  { PrototypeTraits<prototypes::id::Document>::Depth },
1279
  JSJitInfo::Method,
1280
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1281
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1282
  false,  /* isInfallible. False in setters. */
1283
  false,  /* isMovable.  Not relevant for setters. */
1284
  false, /* isEliminatable.  Not relevant for setters. */
1285
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1286
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1287
  false,  /* isTypedMethod.  Only relevant for methods. */
1288
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1289
};
1290
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1291
static_assert(0 < 1, "There is no slot for us");
1292
1293
MOZ_CAN_RUN_SCRIPT static bool
1294
createElementNS(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1295
0
{
1296
0
  AUTO_PROFILER_LABEL_FAST("Document.createElementNS", DOM, cx);
1297
0
1298
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
1299
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.createElementNS");
1300
0
  }
1301
0
  binding_detail::FakeString arg0;
1302
0
  if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
1303
0
    return false;
1304
0
  }
1305
0
  binding_detail::FakeString arg1;
1306
0
  if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) {
1307
0
    return false;
1308
0
  }
1309
0
  ElementCreationOptionsOrString arg2;
1310
0
  ElementCreationOptionsOrStringArgument arg2_holder(arg2);
1311
0
  if (!(args.hasDefined(2))) {
1312
0
    if (!arg2.RawSetAsElementCreationOptions().Init(cx, JS::NullHandleValue, "Member of ElementCreationOptionsOrString")) {
1313
0
      return false;
1314
0
    }
1315
0
  } else {
1316
0
    {
1317
0
      bool done = false, failed = false, tryNext;
1318
0
      if (!done) {
1319
0
        done = (failed = !arg2_holder.TrySetToElementCreationOptions(cx, args[2], tryNext, false)) || !tryNext;
1320
0
      }
1321
0
      if (!done) {
1322
0
        do {
1323
0
          done = (failed = !arg2_holder.TrySetToString(cx, args[2], tryNext)) || !tryNext;
1324
0
          break;
1325
0
        } while (false);
1326
0
      }
1327
0
      if (failed) {
1328
0
        return false;
1329
0
      }
1330
0
      if (!done) {
1331
0
        ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 3 of Document.createElementNS", "ElementCreationOptions");
1332
0
        return false;
1333
0
      }
1334
0
    }
1335
0
  }
1336
0
  Maybe<AutoCEReaction> ceReaction;
1337
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
1338
0
    DocGroup* docGroup = self->GetDocGroup();
1339
0
    if (docGroup) {
1340
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
1341
0
    }
1342
0
  }
1343
0
  FastErrorResult rv;
1344
0
  auto result(StrongOrRawPtr<mozilla::dom::Element>(self->CreateElementNS(NonNullHelper(Constify(arg0)), NonNullHelper(Constify(arg1)), Constify(arg2), rv)));
1345
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1346
0
    return false;
1347
0
  }
1348
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1349
0
  static_assert(!IsPointer<decltype(result)>::value,
1350
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
1351
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1352
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1353
0
    return false;
1354
0
  }
1355
0
  return true;
1356
0
}
1357
1358
static const JSJitInfo createElementNS_methodinfo = {
1359
  { (JSJitGetterOp)createElementNS },
1360
  { prototypes::id::Document },
1361
  { PrototypeTraits<prototypes::id::Document>::Depth },
1362
  JSJitInfo::Method,
1363
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1364
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1365
  false,  /* isInfallible. False in setters. */
1366
  false,  /* isMovable.  Not relevant for setters. */
1367
  false, /* isEliminatable.  Not relevant for setters. */
1368
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1369
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1370
  false,  /* isTypedMethod.  Only relevant for methods. */
1371
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1372
};
1373
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1374
static_assert(0 < 1, "There is no slot for us");
1375
1376
MOZ_CAN_RUN_SCRIPT static bool
1377
createDocumentFragment(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1378
0
{
1379
0
  AUTO_PROFILER_LABEL_FAST("Document.createDocumentFragment", DOM, cx);
1380
0
1381
0
  auto result(StrongOrRawPtr<mozilla::dom::DocumentFragment>(self->CreateDocumentFragment()));
1382
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1383
0
  static_assert(!IsPointer<decltype(result)>::value,
1384
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
1385
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1386
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1387
0
    return false;
1388
0
  }
1389
0
  return true;
1390
0
}
1391
1392
static const JSJitInfo createDocumentFragment_methodinfo = {
1393
  { (JSJitGetterOp)createDocumentFragment },
1394
  { prototypes::id::Document },
1395
  { PrototypeTraits<prototypes::id::Document>::Depth },
1396
  JSJitInfo::Method,
1397
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1398
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1399
  false,  /* isInfallible. False in setters. */
1400
  false,  /* isMovable.  Not relevant for setters. */
1401
  false, /* isEliminatable.  Not relevant for setters. */
1402
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1403
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1404
  false,  /* isTypedMethod.  Only relevant for methods. */
1405
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1406
};
1407
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1408
static_assert(0 < 1, "There is no slot for us");
1409
1410
MOZ_CAN_RUN_SCRIPT static bool
1411
createTextNode(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1412
0
{
1413
0
  AUTO_PROFILER_LABEL_FAST("Document.createTextNode", DOM, cx);
1414
0
1415
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1416
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.createTextNode");
1417
0
  }
1418
0
  binding_detail::FakeString arg0;
1419
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1420
0
    return false;
1421
0
  }
1422
0
  auto result(StrongOrRawPtr<mozilla::dom::Text>(self->CreateTextNode(NonNullHelper(Constify(arg0)))));
1423
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1424
0
  static_assert(!IsPointer<decltype(result)>::value,
1425
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
1426
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1427
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1428
0
    return false;
1429
0
  }
1430
0
  return true;
1431
0
}
1432
1433
static const JSJitInfo createTextNode_methodinfo = {
1434
  { (JSJitGetterOp)createTextNode },
1435
  { prototypes::id::Document },
1436
  { PrototypeTraits<prototypes::id::Document>::Depth },
1437
  JSJitInfo::Method,
1438
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1439
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1440
  false,  /* isInfallible. False in setters. */
1441
  false,  /* isMovable.  Not relevant for setters. */
1442
  false, /* isEliminatable.  Not relevant for setters. */
1443
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1444
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1445
  false,  /* isTypedMethod.  Only relevant for methods. */
1446
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1447
};
1448
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1449
static_assert(0 < 1, "There is no slot for us");
1450
1451
MOZ_CAN_RUN_SCRIPT static bool
1452
createComment(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1453
0
{
1454
0
  AUTO_PROFILER_LABEL_FAST("Document.createComment", DOM, cx);
1455
0
1456
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1457
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.createComment");
1458
0
  }
1459
0
  binding_detail::FakeString arg0;
1460
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1461
0
    return false;
1462
0
  }
1463
0
  auto result(StrongOrRawPtr<mozilla::dom::Comment>(self->CreateComment(NonNullHelper(Constify(arg0)))));
1464
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1465
0
  static_assert(!IsPointer<decltype(result)>::value,
1466
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
1467
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1468
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1469
0
    return false;
1470
0
  }
1471
0
  return true;
1472
0
}
1473
1474
static const JSJitInfo createComment_methodinfo = {
1475
  { (JSJitGetterOp)createComment },
1476
  { prototypes::id::Document },
1477
  { PrototypeTraits<prototypes::id::Document>::Depth },
1478
  JSJitInfo::Method,
1479
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1480
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1481
  false,  /* isInfallible. False in setters. */
1482
  false,  /* isMovable.  Not relevant for setters. */
1483
  false, /* isEliminatable.  Not relevant for setters. */
1484
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1485
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1486
  false,  /* isTypedMethod.  Only relevant for methods. */
1487
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1488
};
1489
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1490
static_assert(0 < 1, "There is no slot for us");
1491
1492
MOZ_CAN_RUN_SCRIPT static bool
1493
createProcessingInstruction(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1494
0
{
1495
0
  AUTO_PROFILER_LABEL_FAST("Document.createProcessingInstruction", DOM, cx);
1496
0
1497
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
1498
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.createProcessingInstruction");
1499
0
  }
1500
0
  binding_detail::FakeString arg0;
1501
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1502
0
    return false;
1503
0
  }
1504
0
  binding_detail::FakeString arg1;
1505
0
  if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) {
1506
0
    return false;
1507
0
  }
1508
0
  FastErrorResult rv;
1509
0
  auto result(StrongOrRawPtr<mozilla::dom::ProcessingInstruction>(self->CreateProcessingInstruction(NonNullHelper(Constify(arg0)), NonNullHelper(Constify(arg1)), rv)));
1510
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1511
0
    return false;
1512
0
  }
1513
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1514
0
  static_assert(!IsPointer<decltype(result)>::value,
1515
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
1516
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1517
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1518
0
    return false;
1519
0
  }
1520
0
  return true;
1521
0
}
1522
1523
static const JSJitInfo createProcessingInstruction_methodinfo = {
1524
  { (JSJitGetterOp)createProcessingInstruction },
1525
  { prototypes::id::Document },
1526
  { PrototypeTraits<prototypes::id::Document>::Depth },
1527
  JSJitInfo::Method,
1528
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1529
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1530
  false,  /* isInfallible. False in setters. */
1531
  false,  /* isMovable.  Not relevant for setters. */
1532
  false, /* isEliminatable.  Not relevant for setters. */
1533
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1534
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1535
  false,  /* isTypedMethod.  Only relevant for methods. */
1536
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1537
};
1538
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1539
static_assert(0 < 1, "There is no slot for us");
1540
1541
MOZ_CAN_RUN_SCRIPT static bool
1542
importNode(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1543
0
{
1544
0
  AUTO_PROFILER_LABEL_FAST("Document.importNode", DOM, cx);
1545
0
1546
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1547
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.importNode");
1548
0
  }
1549
0
  NonNull<nsINode> arg0;
1550
0
  if (args[0].isObject()) {
1551
0
    {
1552
0
      nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(args[0], arg0);
1553
0
      if (NS_FAILED(rv)) {
1554
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of Document.importNode", "Node");
1555
0
        return false;
1556
0
      }
1557
0
    }
1558
0
  } else {
1559
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of Document.importNode");
1560
0
    return false;
1561
0
  }
1562
0
  bool arg1;
1563
0
  if (args.hasDefined(1)) {
1564
0
    if (!ValueToPrimitive<bool, eDefault>(cx, args[1], &arg1)) {
1565
0
      return false;
1566
0
    }
1567
0
  } else {
1568
0
    arg1 = false;
1569
0
  }
1570
0
  Maybe<AutoCEReaction> ceReaction;
1571
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
1572
0
    DocGroup* docGroup = self->GetDocGroup();
1573
0
    if (docGroup) {
1574
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
1575
0
    }
1576
0
  }
1577
0
  FastErrorResult rv;
1578
0
  auto result(StrongOrRawPtr<nsINode>(self->ImportNode(MOZ_KnownLive(NonNullHelper(arg0)), arg1, rv)));
1579
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1580
0
    return false;
1581
0
  }
1582
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1583
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1584
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1585
0
    return false;
1586
0
  }
1587
0
  return true;
1588
0
}
1589
1590
static const JSJitInfo importNode_methodinfo = {
1591
  { (JSJitGetterOp)importNode },
1592
  { prototypes::id::Document },
1593
  { PrototypeTraits<prototypes::id::Document>::Depth },
1594
  JSJitInfo::Method,
1595
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1596
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1597
  false,  /* isInfallible. False in setters. */
1598
  false,  /* isMovable.  Not relevant for setters. */
1599
  false, /* isEliminatable.  Not relevant for setters. */
1600
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1601
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1602
  false,  /* isTypedMethod.  Only relevant for methods. */
1603
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1604
};
1605
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1606
static_assert(0 < 1, "There is no slot for us");
1607
1608
MOZ_CAN_RUN_SCRIPT static bool
1609
adoptNode(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1610
0
{
1611
0
  AUTO_PROFILER_LABEL_FAST("Document.adoptNode", DOM, cx);
1612
0
1613
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1614
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.adoptNode");
1615
0
  }
1616
0
  NonNull<nsINode> arg0;
1617
0
  if (args[0].isObject()) {
1618
0
    {
1619
0
      nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(args[0], arg0);
1620
0
      if (NS_FAILED(rv)) {
1621
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of Document.adoptNode", "Node");
1622
0
        return false;
1623
0
      }
1624
0
    }
1625
0
  } else {
1626
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of Document.adoptNode");
1627
0
    return false;
1628
0
  }
1629
0
  Maybe<AutoCEReaction> ceReaction;
1630
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
1631
0
    DocGroup* docGroup = self->GetDocGroup();
1632
0
    if (docGroup) {
1633
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
1634
0
    }
1635
0
  }
1636
0
  FastErrorResult rv;
1637
0
  auto result(StrongOrRawPtr<nsINode>(self->AdoptNode(MOZ_KnownLive(NonNullHelper(arg0)), rv)));
1638
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1639
0
    return false;
1640
0
  }
1641
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1642
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1643
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1644
0
    return false;
1645
0
  }
1646
0
  return true;
1647
0
}
1648
1649
static const JSJitInfo adoptNode_methodinfo = {
1650
  { (JSJitGetterOp)adoptNode },
1651
  { prototypes::id::Document },
1652
  { PrototypeTraits<prototypes::id::Document>::Depth },
1653
  JSJitInfo::Method,
1654
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1655
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1656
  false,  /* isInfallible. False in setters. */
1657
  false,  /* isMovable.  Not relevant for setters. */
1658
  false, /* isEliminatable.  Not relevant for setters. */
1659
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1660
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1661
  false,  /* isTypedMethod.  Only relevant for methods. */
1662
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1663
};
1664
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1665
static_assert(0 < 1, "There is no slot for us");
1666
1667
MOZ_CAN_RUN_SCRIPT static bool
1668
createEvent(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1669
0
{
1670
0
  AUTO_PROFILER_LABEL_FAST("Document.createEvent", DOM, cx);
1671
0
1672
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1673
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.createEvent");
1674
0
  }
1675
0
  binding_detail::FakeString arg0;
1676
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1677
0
    return false;
1678
0
  }
1679
0
  FastErrorResult rv;
1680
0
  auto result(StrongOrRawPtr<mozilla::dom::Event>(self->CreateEvent(NonNullHelper(Constify(arg0)), nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv)));
1681
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1682
0
    return false;
1683
0
  }
1684
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1685
0
  static_assert(!IsPointer<decltype(result)>::value,
1686
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
1687
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1688
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1689
0
    return false;
1690
0
  }
1691
0
  return true;
1692
0
}
1693
1694
static const JSJitInfo createEvent_methodinfo = {
1695
  { (JSJitGetterOp)createEvent },
1696
  { prototypes::id::Document },
1697
  { PrototypeTraits<prototypes::id::Document>::Depth },
1698
  JSJitInfo::Method,
1699
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1700
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1701
  false,  /* isInfallible. False in setters. */
1702
  false,  /* isMovable.  Not relevant for setters. */
1703
  false, /* isEliminatable.  Not relevant for setters. */
1704
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1705
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1706
  false,  /* isTypedMethod.  Only relevant for methods. */
1707
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1708
};
1709
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1710
static_assert(0 < 1, "There is no slot for us");
1711
1712
MOZ_CAN_RUN_SCRIPT static bool
1713
createRange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1714
0
{
1715
0
  AUTO_PROFILER_LABEL_FAST("Document.createRange", DOM, cx);
1716
0
1717
0
  FastErrorResult rv;
1718
0
  auto result(StrongOrRawPtr<nsRange>(self->CreateRange(rv)));
1719
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1720
0
    return false;
1721
0
  }
1722
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1723
0
  static_assert(!IsPointer<decltype(result)>::value,
1724
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
1725
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1726
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1727
0
    return false;
1728
0
  }
1729
0
  return true;
1730
0
}
1731
1732
static const JSJitInfo createRange_methodinfo = {
1733
  { (JSJitGetterOp)createRange },
1734
  { prototypes::id::Document },
1735
  { PrototypeTraits<prototypes::id::Document>::Depth },
1736
  JSJitInfo::Method,
1737
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1738
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1739
  false,  /* isInfallible. False in setters. */
1740
  false,  /* isMovable.  Not relevant for setters. */
1741
  false, /* isEliminatable.  Not relevant for setters. */
1742
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1743
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1744
  false,  /* isTypedMethod.  Only relevant for methods. */
1745
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1746
};
1747
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1748
static_assert(0 < 1, "There is no slot for us");
1749
1750
MOZ_CAN_RUN_SCRIPT static bool
1751
createNodeIterator(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1752
0
{
1753
0
  AUTO_PROFILER_LABEL_FAST("Document.createNodeIterator", DOM, cx);
1754
0
1755
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1756
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.createNodeIterator");
1757
0
  }
1758
0
  NonNull<nsINode> arg0;
1759
0
  if (args[0].isObject()) {
1760
0
    {
1761
0
      nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(args[0], arg0);
1762
0
      if (NS_FAILED(rv)) {
1763
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of Document.createNodeIterator", "Node");
1764
0
        return false;
1765
0
      }
1766
0
    }
1767
0
  } else {
1768
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of Document.createNodeIterator");
1769
0
    return false;
1770
0
  }
1771
0
  uint32_t arg1;
1772
0
  if (args.hasDefined(1)) {
1773
0
    if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) {
1774
0
      return false;
1775
0
    }
1776
0
  } else {
1777
0
    arg1 = 4294967295U;
1778
0
  }
1779
0
  RootedCallback<RefPtr<binding_detail::FastNodeFilter>> arg2(cx);
1780
0
  if (args.hasDefined(2)) {
1781
0
    if (args[2].isObject()) {
1782
0
      { // scope for tempRoot and tempGlobalRoot if needed
1783
0
        arg2 = new binding_detail::FastNodeFilter(&args[2].toObject(), JS::CurrentGlobalOrNull(cx));
1784
0
      }
1785
0
    } else if (args[2].isNullOrUndefined()) {
1786
0
      arg2 = nullptr;
1787
0
    } else {
1788
0
      ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 3 of Document.createNodeIterator");
1789
0
      return false;
1790
0
    }
1791
0
  } else {
1792
0
    arg2 = nullptr;
1793
0
  }
1794
0
  FastErrorResult rv;
1795
0
  auto result(StrongOrRawPtr<mozilla::dom::NodeIterator>(self->CreateNodeIterator(MOZ_KnownLive(NonNullHelper(arg0)), arg1, MOZ_KnownLive(Constify(arg2)), rv)));
1796
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1797
0
    return false;
1798
0
  }
1799
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1800
0
  static_assert(!IsPointer<decltype(result)>::value,
1801
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
1802
0
  if (!WrapNewBindingNonWrapperCachedObject(cx, obj, result, args.rval())) {
1803
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1804
0
    return false;
1805
0
  }
1806
0
  return true;
1807
0
}
1808
1809
static const JSJitInfo createNodeIterator_methodinfo = {
1810
  { (JSJitGetterOp)createNodeIterator },
1811
  { prototypes::id::Document },
1812
  { PrototypeTraits<prototypes::id::Document>::Depth },
1813
  JSJitInfo::Method,
1814
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1815
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1816
  false,  /* isInfallible. False in setters. */
1817
  false,  /* isMovable.  Not relevant for setters. */
1818
  false, /* isEliminatable.  Not relevant for setters. */
1819
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1820
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1821
  false,  /* isTypedMethod.  Only relevant for methods. */
1822
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1823
};
1824
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1825
static_assert(0 < 1, "There is no slot for us");
1826
1827
MOZ_CAN_RUN_SCRIPT static bool
1828
createTreeWalker(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1829
0
{
1830
0
  AUTO_PROFILER_LABEL_FAST("Document.createTreeWalker", DOM, cx);
1831
0
1832
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1833
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.createTreeWalker");
1834
0
  }
1835
0
  NonNull<nsINode> arg0;
1836
0
  if (args[0].isObject()) {
1837
0
    {
1838
0
      nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(args[0], arg0);
1839
0
      if (NS_FAILED(rv)) {
1840
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of Document.createTreeWalker", "Node");
1841
0
        return false;
1842
0
      }
1843
0
    }
1844
0
  } else {
1845
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of Document.createTreeWalker");
1846
0
    return false;
1847
0
  }
1848
0
  uint32_t arg1;
1849
0
  if (args.hasDefined(1)) {
1850
0
    if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) {
1851
0
      return false;
1852
0
    }
1853
0
  } else {
1854
0
    arg1 = 4294967295U;
1855
0
  }
1856
0
  RootedCallback<RefPtr<binding_detail::FastNodeFilter>> arg2(cx);
1857
0
  if (args.hasDefined(2)) {
1858
0
    if (args[2].isObject()) {
1859
0
      { // scope for tempRoot and tempGlobalRoot if needed
1860
0
        arg2 = new binding_detail::FastNodeFilter(&args[2].toObject(), JS::CurrentGlobalOrNull(cx));
1861
0
      }
1862
0
    } else if (args[2].isNullOrUndefined()) {
1863
0
      arg2 = nullptr;
1864
0
    } else {
1865
0
      ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 3 of Document.createTreeWalker");
1866
0
      return false;
1867
0
    }
1868
0
  } else {
1869
0
    arg2 = nullptr;
1870
0
  }
1871
0
  FastErrorResult rv;
1872
0
  auto result(StrongOrRawPtr<mozilla::dom::TreeWalker>(self->CreateTreeWalker(MOZ_KnownLive(NonNullHelper(arg0)), arg1, MOZ_KnownLive(Constify(arg2)), rv)));
1873
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1874
0
    return false;
1875
0
  }
1876
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1877
0
  static_assert(!IsPointer<decltype(result)>::value,
1878
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
1879
0
  if (!WrapNewBindingNonWrapperCachedObject(cx, obj, result, args.rval())) {
1880
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1881
0
    return false;
1882
0
  }
1883
0
  return true;
1884
0
}
1885
1886
static const JSJitInfo createTreeWalker_methodinfo = {
1887
  { (JSJitGetterOp)createTreeWalker },
1888
  { prototypes::id::Document },
1889
  { PrototypeTraits<prototypes::id::Document>::Depth },
1890
  JSJitInfo::Method,
1891
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1892
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1893
  false,  /* isInfallible. False in setters. */
1894
  false,  /* isMovable.  Not relevant for setters. */
1895
  false, /* isEliminatable.  Not relevant for setters. */
1896
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1897
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1898
  false,  /* isTypedMethod.  Only relevant for methods. */
1899
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1900
};
1901
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1902
static_assert(0 < 1, "There is no slot for us");
1903
1904
MOZ_CAN_RUN_SCRIPT static bool
1905
createCDATASection(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1906
0
{
1907
0
  AUTO_PROFILER_LABEL_FAST("Document.createCDATASection", DOM, cx);
1908
0
1909
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1910
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.createCDATASection");
1911
0
  }
1912
0
  binding_detail::FakeString arg0;
1913
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1914
0
    return false;
1915
0
  }
1916
0
  FastErrorResult rv;
1917
0
  auto result(StrongOrRawPtr<mozilla::dom::CDATASection>(self->CreateCDATASection(NonNullHelper(Constify(arg0)), rv)));
1918
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1919
0
    return false;
1920
0
  }
1921
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1922
0
  static_assert(!IsPointer<decltype(result)>::value,
1923
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
1924
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1925
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1926
0
    return false;
1927
0
  }
1928
0
  return true;
1929
0
}
1930
1931
static const JSJitInfo createCDATASection_methodinfo = {
1932
  { (JSJitGetterOp)createCDATASection },
1933
  { prototypes::id::Document },
1934
  { PrototypeTraits<prototypes::id::Document>::Depth },
1935
  JSJitInfo::Method,
1936
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1937
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1938
  false,  /* isInfallible. False in setters. */
1939
  false,  /* isMovable.  Not relevant for setters. */
1940
  false, /* isEliminatable.  Not relevant for setters. */
1941
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1942
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1943
  false,  /* isTypedMethod.  Only relevant for methods. */
1944
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1945
};
1946
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1947
static_assert(0 < 1, "There is no slot for us");
1948
1949
MOZ_CAN_RUN_SCRIPT static bool
1950
createAttribute(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1951
0
{
1952
0
  AUTO_PROFILER_LABEL_FAST("Document.createAttribute", DOM, cx);
1953
0
1954
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1955
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.createAttribute");
1956
0
  }
1957
0
  binding_detail::FakeString arg0;
1958
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1959
0
    return false;
1960
0
  }
1961
0
  FastErrorResult rv;
1962
0
  auto result(StrongOrRawPtr<mozilla::dom::Attr>(self->CreateAttribute(NonNullHelper(Constify(arg0)), rv)));
1963
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1964
0
    return false;
1965
0
  }
1966
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1967
0
  static_assert(!IsPointer<decltype(result)>::value,
1968
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
1969
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1970
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1971
0
    return false;
1972
0
  }
1973
0
  return true;
1974
0
}
1975
1976
static const JSJitInfo createAttribute_methodinfo = {
1977
  { (JSJitGetterOp)createAttribute },
1978
  { prototypes::id::Document },
1979
  { PrototypeTraits<prototypes::id::Document>::Depth },
1980
  JSJitInfo::Method,
1981
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1982
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1983
  false,  /* isInfallible. False in setters. */
1984
  false,  /* isMovable.  Not relevant for setters. */
1985
  false, /* isEliminatable.  Not relevant for setters. */
1986
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1987
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1988
  false,  /* isTypedMethod.  Only relevant for methods. */
1989
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1990
};
1991
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1992
static_assert(0 < 1, "There is no slot for us");
1993
1994
MOZ_CAN_RUN_SCRIPT static bool
1995
createAttributeNS(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
1996
0
{
1997
0
  AUTO_PROFILER_LABEL_FAST("Document.createAttributeNS", DOM, cx);
1998
0
1999
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
2000
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.createAttributeNS");
2001
0
  }
2002
0
  binding_detail::FakeString arg0;
2003
0
  if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
2004
0
    return false;
2005
0
  }
2006
0
  binding_detail::FakeString arg1;
2007
0
  if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) {
2008
0
    return false;
2009
0
  }
2010
0
  FastErrorResult rv;
2011
0
  auto result(StrongOrRawPtr<mozilla::dom::Attr>(self->CreateAttributeNS(NonNullHelper(Constify(arg0)), NonNullHelper(Constify(arg1)), rv)));
2012
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2013
0
    return false;
2014
0
  }
2015
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2016
0
  static_assert(!IsPointer<decltype(result)>::value,
2017
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
2018
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2019
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2020
0
    return false;
2021
0
  }
2022
0
  return true;
2023
0
}
2024
2025
static const JSJitInfo createAttributeNS_methodinfo = {
2026
  { (JSJitGetterOp)createAttributeNS },
2027
  { prototypes::id::Document },
2028
  { PrototypeTraits<prototypes::id::Document>::Depth },
2029
  JSJitInfo::Method,
2030
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2031
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2032
  false,  /* isInfallible. False in setters. */
2033
  false,  /* isMovable.  Not relevant for setters. */
2034
  false, /* isEliminatable.  Not relevant for setters. */
2035
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2036
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2037
  false,  /* isTypedMethod.  Only relevant for methods. */
2038
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2039
};
2040
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2041
static_assert(0 < 1, "There is no slot for us");
2042
2043
MOZ_CAN_RUN_SCRIPT static bool
2044
get_location(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
2045
0
{
2046
0
  AUTO_PROFILER_LABEL_FAST("get Document.location", DOM, cx);
2047
0
2048
0
  auto result(StrongOrRawPtr<mozilla::dom::Location>(self->GetLocation()));
2049
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2050
0
  if (!result) {
2051
0
    args.rval().setNull();
2052
0
    return true;
2053
0
  }
2054
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2055
0
    MOZ_CRASH("Looks like bug 1488480/1405521, with getting the reflector failing");
2056
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2057
0
    return false;
2058
0
  }
2059
0
  return true;
2060
0
}
2061
2062
MOZ_CAN_RUN_SCRIPT static bool
2063
set_location(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
2064
0
{
2065
0
  AUTO_PROFILER_LABEL_FAST("set Document.location", DOM, cx);
2066
0
2067
0
  JS::Rooted<JS::Value> v(cx);
2068
0
  if (!JS_GetProperty(cx, obj, "location", &v)) {
2069
0
    return false;
2070
0
  }
2071
0
2072
0
  if (!v.isObject()) {
2073
0
    return ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Document.location");
2074
0
  }
2075
0
2076
0
  JS::Rooted<JSObject*> targetObj(cx, &v.toObject());
2077
0
  return JS_SetProperty(cx, targetObj, "href", args[0]);
2078
0
}
2079
2080
static const JSJitInfo location_getterinfo = {
2081
  { (JSJitGetterOp)get_location },
2082
  { prototypes::id::Document },
2083
  { PrototypeTraits<prototypes::id::Document>::Depth },
2084
  JSJitInfo::Getter,
2085
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2086
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
2087
  false,  /* isInfallible. False in setters. */
2088
  false,  /* isMovable.  Not relevant for setters. */
2089
  false, /* isEliminatable.  Not relevant for setters. */
2090
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2091
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2092
  false,  /* isTypedMethod.  Only relevant for methods. */
2093
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2094
};
2095
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2096
static_assert(0 < 1, "There is no slot for us");
2097
static const JSJitInfo location_setterinfo = {
2098
  { (JSJitGetterOp)set_location },
2099
  { prototypes::id::Document },
2100
  { PrototypeTraits<prototypes::id::Document>::Depth },
2101
  JSJitInfo::Setter,
2102
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2103
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
2104
  false,  /* isInfallible. False in setters. */
2105
  false,  /* isMovable.  Not relevant for setters. */
2106
  false, /* isEliminatable.  Not relevant for setters. */
2107
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2108
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2109
  false,  /* isTypedMethod.  Only relevant for methods. */
2110
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2111
};
2112
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2113
static_assert(0 < 1, "There is no slot for us");
2114
2115
MOZ_CAN_RUN_SCRIPT static bool
2116
get_referrer(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
2117
0
{
2118
0
  AUTO_PROFILER_LABEL_FAST("get Document.referrer", DOM, cx);
2119
0
2120
0
  DOMString result;
2121
0
  self->GetReferrer(result);
2122
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2123
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
2124
0
    return false;
2125
0
  }
2126
0
  return true;
2127
0
}
2128
2129
static const JSJitInfo referrer_getterinfo = {
2130
  { (JSJitGetterOp)get_referrer },
2131
  { prototypes::id::Document },
2132
  { PrototypeTraits<prototypes::id::Document>::Depth },
2133
  JSJitInfo::Getter,
2134
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2135
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
2136
  false,  /* isInfallible. False in setters. */
2137
  false,  /* isMovable.  Not relevant for setters. */
2138
  false, /* isEliminatable.  Not relevant for setters. */
2139
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2140
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2141
  false,  /* isTypedMethod.  Only relevant for methods. */
2142
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2143
};
2144
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2145
static_assert(0 < 1, "There is no slot for us");
2146
2147
MOZ_CAN_RUN_SCRIPT static bool
2148
get_lastModified(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
2149
0
{
2150
0
  AUTO_PROFILER_LABEL_FAST("get Document.lastModified", DOM, cx);
2151
0
2152
0
  DOMString result;
2153
0
  self->GetLastModified(result);
2154
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2155
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
2156
0
    return false;
2157
0
  }
2158
0
  return true;
2159
0
}
2160
2161
static const JSJitInfo lastModified_getterinfo = {
2162
  { (JSJitGetterOp)get_lastModified },
2163
  { prototypes::id::Document },
2164
  { PrototypeTraits<prototypes::id::Document>::Depth },
2165
  JSJitInfo::Getter,
2166
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2167
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
2168
  false,  /* isInfallible. False in setters. */
2169
  false,  /* isMovable.  Not relevant for setters. */
2170
  false, /* isEliminatable.  Not relevant for setters. */
2171
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2172
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2173
  false,  /* isTypedMethod.  Only relevant for methods. */
2174
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2175
};
2176
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2177
static_assert(0 < 1, "There is no slot for us");
2178
2179
MOZ_CAN_RUN_SCRIPT static bool
2180
get_readyState(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
2181
0
{
2182
0
  AUTO_PROFILER_LABEL_FAST("get Document.readyState", DOM, cx);
2183
0
2184
0
  DOMString result;
2185
0
  self->GetReadyState(result);
2186
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2187
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
2188
0
    return false;
2189
0
  }
2190
0
  return true;
2191
0
}
2192
2193
static const JSJitInfo readyState_getterinfo = {
2194
  { (JSJitGetterOp)get_readyState },
2195
  { prototypes::id::Document },
2196
  { PrototypeTraits<prototypes::id::Document>::Depth },
2197
  JSJitInfo::Getter,
2198
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2199
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
2200
  false,  /* isInfallible. False in setters. */
2201
  false,  /* isMovable.  Not relevant for setters. */
2202
  false, /* isEliminatable.  Not relevant for setters. */
2203
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2204
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2205
  false,  /* isTypedMethod.  Only relevant for methods. */
2206
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2207
};
2208
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2209
static_assert(0 < 1, "There is no slot for us");
2210
2211
MOZ_CAN_RUN_SCRIPT static bool
2212
get_title(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
2213
0
{
2214
0
  AUTO_PROFILER_LABEL_FAST("get Document.title", DOM, cx);
2215
0
2216
0
  DOMString result;
2217
0
  self->GetTitle(result);
2218
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2219
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
2220
0
    return false;
2221
0
  }
2222
0
  return true;
2223
0
}
2224
2225
MOZ_CAN_RUN_SCRIPT static bool
2226
set_title(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
2227
0
{
2228
0
  AUTO_PROFILER_LABEL_FAST("set Document.title", DOM, cx);
2229
0
2230
0
  binding_detail::FakeString arg0;
2231
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
2232
0
    return false;
2233
0
  }
2234
0
  Maybe<AutoCEReaction> ceReaction;
2235
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
2236
0
    DocGroup* docGroup = self->GetDocGroup();
2237
0
    if (docGroup) {
2238
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
2239
0
    }
2240
0
  }
2241
0
  FastErrorResult rv;
2242
0
  self->SetTitle(NonNullHelper(Constify(arg0)), rv);
2243
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2244
0
    return false;
2245
0
  }
2246
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2247
0
2248
0
  return true;
2249
0
}
2250
2251
static const JSJitInfo title_getterinfo = {
2252
  { (JSJitGetterOp)get_title },
2253
  { prototypes::id::Document },
2254
  { PrototypeTraits<prototypes::id::Document>::Depth },
2255
  JSJitInfo::Getter,
2256
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
2257
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
2258
  false,  /* isInfallible. False in setters. */
2259
  true,  /* isMovable.  Not relevant for setters. */
2260
  true, /* isEliminatable.  Not relevant for setters. */
2261
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2262
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2263
  false,  /* isTypedMethod.  Only relevant for methods. */
2264
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2265
};
2266
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2267
static_assert(0 < 1, "There is no slot for us");
2268
static const JSJitInfo title_setterinfo = {
2269
  { (JSJitGetterOp)set_title },
2270
  { prototypes::id::Document },
2271
  { PrototypeTraits<prototypes::id::Document>::Depth },
2272
  JSJitInfo::Setter,
2273
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2274
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
2275
  false,  /* isInfallible. False in setters. */
2276
  false,  /* isMovable.  Not relevant for setters. */
2277
  false, /* isEliminatable.  Not relevant for setters. */
2278
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2279
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2280
  false,  /* isTypedMethod.  Only relevant for methods. */
2281
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2282
};
2283
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2284
static_assert(0 < 1, "There is no slot for us");
2285
2286
MOZ_CAN_RUN_SCRIPT static bool
2287
get_dir(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
2288
0
{
2289
0
  AUTO_PROFILER_LABEL_FAST("get Document.dir", DOM, cx);
2290
0
2291
0
  DOMString result;
2292
0
  self->GetDir(result);
2293
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2294
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
2295
0
    return false;
2296
0
  }
2297
0
  return true;
2298
0
}
2299
2300
MOZ_CAN_RUN_SCRIPT static bool
2301
set_dir(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
2302
0
{
2303
0
  AUTO_PROFILER_LABEL_FAST("set Document.dir", DOM, cx);
2304
0
2305
0
  binding_detail::FakeString arg0;
2306
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
2307
0
    return false;
2308
0
  }
2309
0
  Maybe<AutoCEReaction> ceReaction;
2310
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
2311
0
    DocGroup* docGroup = self->GetDocGroup();
2312
0
    if (docGroup) {
2313
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
2314
0
    }
2315
0
  }
2316
0
  self->SetDir(NonNullHelper(Constify(arg0)));
2317
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2318
0
2319
0
  return true;
2320
0
}
2321
2322
static const JSJitInfo dir_getterinfo = {
2323
  { (JSJitGetterOp)get_dir },
2324
  { prototypes::id::Document },
2325
  { PrototypeTraits<prototypes::id::Document>::Depth },
2326
  JSJitInfo::Getter,
2327
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
2328
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
2329
  false,  /* isInfallible. False in setters. */
2330
  true,  /* isMovable.  Not relevant for setters. */
2331
  true, /* isEliminatable.  Not relevant for setters. */
2332
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2333
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2334
  false,  /* isTypedMethod.  Only relevant for methods. */
2335
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2336
};
2337
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2338
static_assert(0 < 1, "There is no slot for us");
2339
static const JSJitInfo dir_setterinfo = {
2340
  { (JSJitGetterOp)set_dir },
2341
  { prototypes::id::Document },
2342
  { PrototypeTraits<prototypes::id::Document>::Depth },
2343
  JSJitInfo::Setter,
2344
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2345
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
2346
  false,  /* isInfallible. False in setters. */
2347
  false,  /* isMovable.  Not relevant for setters. */
2348
  false, /* isEliminatable.  Not relevant for setters. */
2349
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2350
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2351
  false,  /* isTypedMethod.  Only relevant for methods. */
2352
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2353
};
2354
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2355
static_assert(0 < 1, "There is no slot for us");
2356
2357
MOZ_CAN_RUN_SCRIPT static bool
2358
get_body(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
2359
0
{
2360
0
  AUTO_PROFILER_LABEL_FAST("get Document.body", DOM, cx);
2361
0
2362
0
  auto result(StrongOrRawPtr<nsGenericHTMLElement>(self->GetBody()));
2363
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2364
0
  if (!result) {
2365
0
    args.rval().setNull();
2366
0
    return true;
2367
0
  }
2368
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2369
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2370
0
    return false;
2371
0
  }
2372
0
  return true;
2373
0
}
2374
2375
MOZ_CAN_RUN_SCRIPT static bool
2376
set_body(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
2377
0
{
2378
0
  AUTO_PROFILER_LABEL_FAST("set Document.body", DOM, cx);
2379
0
2380
0
  nsGenericHTMLElement* arg0;
2381
0
  if (args[0].isObject()) {
2382
0
    {
2383
0
      nsresult rv = UnwrapObject<prototypes::id::HTMLElement, nsGenericHTMLElement>(args[0], arg0);
2384
0
      if (NS_FAILED(rv)) {
2385
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Value being assigned to Document.body", "HTMLElement");
2386
0
        return false;
2387
0
      }
2388
0
    }
2389
0
  } else if (args[0].isNullOrUndefined()) {
2390
0
    arg0 = nullptr;
2391
0
  } else {
2392
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Value being assigned to Document.body");
2393
0
    return false;
2394
0
  }
2395
0
  Maybe<AutoCEReaction> ceReaction;
2396
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
2397
0
    DocGroup* docGroup = self->GetDocGroup();
2398
0
    if (docGroup) {
2399
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
2400
0
    }
2401
0
  }
2402
0
  FastErrorResult rv;
2403
0
  self->SetBody(MOZ_KnownLive(Constify(arg0)), rv);
2404
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2405
0
    return false;
2406
0
  }
2407
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2408
0
2409
0
  return true;
2410
0
}
2411
2412
static const JSJitInfo body_getterinfo = {
2413
  { (JSJitGetterOp)get_body },
2414
  { prototypes::id::Document },
2415
  { PrototypeTraits<prototypes::id::Document>::Depth },
2416
  JSJitInfo::Getter,
2417
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
2418
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
2419
  false,  /* isInfallible. False in setters. */
2420
  true,  /* isMovable.  Not relevant for setters. */
2421
  true, /* isEliminatable.  Not relevant for setters. */
2422
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2423
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2424
  false,  /* isTypedMethod.  Only relevant for methods. */
2425
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2426
};
2427
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2428
static_assert(0 < 1, "There is no slot for us");
2429
static const JSJitInfo body_setterinfo = {
2430
  { (JSJitGetterOp)set_body },
2431
  { prototypes::id::Document },
2432
  { PrototypeTraits<prototypes::id::Document>::Depth },
2433
  JSJitInfo::Setter,
2434
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2435
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
2436
  false,  /* isInfallible. False in setters. */
2437
  false,  /* isMovable.  Not relevant for setters. */
2438
  false, /* isEliminatable.  Not relevant for setters. */
2439
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2440
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2441
  false,  /* isTypedMethod.  Only relevant for methods. */
2442
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2443
};
2444
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2445
static_assert(0 < 1, "There is no slot for us");
2446
2447
MOZ_CAN_RUN_SCRIPT static bool
2448
get_head(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
2449
0
{
2450
0
  AUTO_PROFILER_LABEL_FAST("get Document.head", DOM, cx);
2451
0
2452
0
  auto result(StrongOrRawPtr<mozilla::dom::HTMLSharedElement>(self->GetHead()));
2453
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2454
0
  if (!result) {
2455
0
    args.rval().setNull();
2456
0
    return true;
2457
0
  }
2458
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2459
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2460
0
    return false;
2461
0
  }
2462
0
  return true;
2463
0
}
2464
2465
static const JSJitInfo head_getterinfo = {
2466
  { (JSJitGetterOp)get_head },
2467
  { prototypes::id::Document },
2468
  { PrototypeTraits<prototypes::id::Document>::Depth },
2469
  JSJitInfo::Getter,
2470
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
2471
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
2472
  false,  /* isInfallible. False in setters. */
2473
  true,  /* isMovable.  Not relevant for setters. */
2474
  true, /* isEliminatable.  Not relevant for setters. */
2475
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2476
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2477
  false,  /* isTypedMethod.  Only relevant for methods. */
2478
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2479
};
2480
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2481
static_assert(0 < 1, "There is no slot for us");
2482
2483
MOZ_CAN_RUN_SCRIPT static bool
2484
get_images(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
2485
0
{
2486
0
  AUTO_PROFILER_LABEL_FAST("get Document.images", DOM, cx);
2487
0
2488
0
  auto result(StrongOrRawPtr<nsIHTMLCollection>(self->Images()));
2489
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2490
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2491
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2492
0
    return false;
2493
0
  }
2494
0
  return true;
2495
0
}
2496
2497
static const JSJitInfo images_getterinfo = {
2498
  { (JSJitGetterOp)get_images },
2499
  { prototypes::id::Document },
2500
  { PrototypeTraits<prototypes::id::Document>::Depth },
2501
  JSJitInfo::Getter,
2502
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
2503
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2504
  false,  /* isInfallible. False in setters. */
2505
  true,  /* isMovable.  Not relevant for setters. */
2506
  true, /* isEliminatable.  Not relevant for setters. */
2507
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2508
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2509
  false,  /* isTypedMethod.  Only relevant for methods. */
2510
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2511
};
2512
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2513
static_assert(0 < 1, "There is no slot for us");
2514
2515
MOZ_CAN_RUN_SCRIPT static bool
2516
get_embeds(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
2517
0
{
2518
0
  AUTO_PROFILER_LABEL_FAST("get Document.embeds", DOM, cx);
2519
0
2520
0
  auto result(StrongOrRawPtr<nsIHTMLCollection>(self->Embeds()));
2521
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2522
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2523
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2524
0
    return false;
2525
0
  }
2526
0
  return true;
2527
0
}
2528
2529
static const JSJitInfo embeds_getterinfo = {
2530
  { (JSJitGetterOp)get_embeds },
2531
  { prototypes::id::Document },
2532
  { PrototypeTraits<prototypes::id::Document>::Depth },
2533
  JSJitInfo::Getter,
2534
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
2535
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2536
  false,  /* isInfallible. False in setters. */
2537
  true,  /* isMovable.  Not relevant for setters. */
2538
  true, /* isEliminatable.  Not relevant for setters. */
2539
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2540
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2541
  false,  /* isTypedMethod.  Only relevant for methods. */
2542
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2543
};
2544
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2545
static_assert(0 < 1, "There is no slot for us");
2546
2547
MOZ_CAN_RUN_SCRIPT static bool
2548
get_plugins(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
2549
0
{
2550
0
  AUTO_PROFILER_LABEL_FAST("get Document.plugins", DOM, cx);
2551
0
2552
0
  auto result(StrongOrRawPtr<nsIHTMLCollection>(self->Plugins()));
2553
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2554
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2555
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2556
0
    return false;
2557
0
  }
2558
0
  return true;
2559
0
}
2560
2561
static const JSJitInfo plugins_getterinfo = {
2562
  { (JSJitGetterOp)get_plugins },
2563
  { prototypes::id::Document },
2564
  { PrototypeTraits<prototypes::id::Document>::Depth },
2565
  JSJitInfo::Getter,
2566
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
2567
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2568
  false,  /* isInfallible. False in setters. */
2569
  true,  /* isMovable.  Not relevant for setters. */
2570
  true, /* isEliminatable.  Not relevant for setters. */
2571
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2572
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2573
  false,  /* isTypedMethod.  Only relevant for methods. */
2574
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2575
};
2576
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2577
static_assert(0 < 1, "There is no slot for us");
2578
2579
MOZ_CAN_RUN_SCRIPT static bool
2580
get_links(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
2581
0
{
2582
0
  AUTO_PROFILER_LABEL_FAST("get Document.links", DOM, cx);
2583
0
2584
0
  auto result(StrongOrRawPtr<nsIHTMLCollection>(self->Links()));
2585
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2586
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2587
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2588
0
    return false;
2589
0
  }
2590
0
  return true;
2591
0
}
2592
2593
static const JSJitInfo links_getterinfo = {
2594
  { (JSJitGetterOp)get_links },
2595
  { prototypes::id::Document },
2596
  { PrototypeTraits<prototypes::id::Document>::Depth },
2597
  JSJitInfo::Getter,
2598
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
2599
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2600
  false,  /* isInfallible. False in setters. */
2601
  true,  /* isMovable.  Not relevant for setters. */
2602
  true, /* isEliminatable.  Not relevant for setters. */
2603
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2604
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2605
  false,  /* isTypedMethod.  Only relevant for methods. */
2606
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2607
};
2608
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2609
static_assert(0 < 1, "There is no slot for us");
2610
2611
MOZ_CAN_RUN_SCRIPT static bool
2612
get_forms(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
2613
0
{
2614
0
  AUTO_PROFILER_LABEL_FAST("get Document.forms", DOM, cx);
2615
0
2616
0
  auto result(StrongOrRawPtr<nsIHTMLCollection>(self->Forms()));
2617
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2618
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2619
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2620
0
    return false;
2621
0
  }
2622
0
  return true;
2623
0
}
2624
2625
static const JSJitInfo forms_getterinfo = {
2626
  { (JSJitGetterOp)get_forms },
2627
  { prototypes::id::Document },
2628
  { PrototypeTraits<prototypes::id::Document>::Depth },
2629
  JSJitInfo::Getter,
2630
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
2631
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2632
  false,  /* isInfallible. False in setters. */
2633
  true,  /* isMovable.  Not relevant for setters. */
2634
  true, /* isEliminatable.  Not relevant for setters. */
2635
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2636
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2637
  false,  /* isTypedMethod.  Only relevant for methods. */
2638
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2639
};
2640
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2641
static_assert(0 < 1, "There is no slot for us");
2642
2643
MOZ_CAN_RUN_SCRIPT static bool
2644
get_scripts(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
2645
0
{
2646
0
  AUTO_PROFILER_LABEL_FAST("get Document.scripts", DOM, cx);
2647
0
2648
0
  auto result(StrongOrRawPtr<nsIHTMLCollection>(self->Scripts()));
2649
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2650
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2651
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2652
0
    return false;
2653
0
  }
2654
0
  return true;
2655
0
}
2656
2657
static const JSJitInfo scripts_getterinfo = {
2658
  { (JSJitGetterOp)get_scripts },
2659
  { prototypes::id::Document },
2660
  { PrototypeTraits<prototypes::id::Document>::Depth },
2661
  JSJitInfo::Getter,
2662
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
2663
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2664
  false,  /* isInfallible. False in setters. */
2665
  true,  /* isMovable.  Not relevant for setters. */
2666
  true, /* isEliminatable.  Not relevant for setters. */
2667
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2668
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2669
  false,  /* isTypedMethod.  Only relevant for methods. */
2670
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2671
};
2672
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2673
static_assert(0 < 1, "There is no slot for us");
2674
2675
MOZ_CAN_RUN_SCRIPT static bool
2676
getElementsByName(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
2677
0
{
2678
0
  AUTO_PROFILER_LABEL_FAST("Document.getElementsByName", DOM, cx);
2679
0
2680
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
2681
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.getElementsByName");
2682
0
  }
2683
0
  binding_detail::FakeString arg0;
2684
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
2685
0
    return false;
2686
0
  }
2687
0
  auto result(StrongOrRawPtr<nsINodeList>(self->GetElementsByName(NonNullHelper(Constify(arg0)))));
2688
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2689
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2690
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2691
0
    return false;
2692
0
  }
2693
0
  return true;
2694
0
}
2695
2696
static const JSJitInfo::ArgType getElementsByName_methodinfo_argTypes[] = { JSJitInfo::String, JSJitInfo::ArgTypeListEnd };
2697
static const JSTypedMethodJitInfo getElementsByName_methodinfo = {
2698
  {
2699
    { (JSJitGetterOp)getElementsByName },
2700
    { prototypes::id::Document },
2701
    { PrototypeTraits<prototypes::id::Document>::Depth },
2702
    JSJitInfo::Method,
2703
    JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
2704
    JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2705
    false,  /* isInfallible. False in setters. */
2706
    true,  /* isMovable.  Not relevant for setters. */
2707
    true, /* isEliminatable.  Not relevant for setters. */
2708
    false, /* isAlwaysInSlot.  Only relevant for getters. */
2709
    false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2710
    true,  /* isTypedMethod.  Only relevant for methods. */
2711
    0   /* Reserved slot index, if we're stored in a slot, else 0. */
2712
  },
2713
  getElementsByName_methodinfo_argTypes
2714
};
2715
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2716
static_assert(0 < 1, "There is no slot for us");
2717
2718
MOZ_CAN_RUN_SCRIPT static bool
2719
get_defaultView(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
2720
0
{
2721
0
  AUTO_PROFILER_LABEL_FAST("get Document.defaultView", DOM, cx);
2722
0
2723
0
  auto result(StrongOrRawPtr<nsPIDOMWindowOuter>(self->GetDefaultView()));
2724
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2725
0
  if (!result) {
2726
0
    args.rval().setNull();
2727
0
    return true;
2728
0
  }
2729
0
  if (!WrapObject(cx, result, args.rval())) {
2730
0
    return false;
2731
0
  }
2732
0
  return true;
2733
0
}
2734
2735
static const JSJitInfo defaultView_getterinfo = {
2736
  { (JSJitGetterOp)get_defaultView },
2737
  { prototypes::id::Document },
2738
  { PrototypeTraits<prototypes::id::Document>::Depth },
2739
  JSJitInfo::Getter,
2740
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
2741
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
2742
  false,  /* isInfallible. False in setters. */
2743
  true,  /* isMovable.  Not relevant for setters. */
2744
  true, /* isEliminatable.  Not relevant for setters. */
2745
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2746
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2747
  false,  /* isTypedMethod.  Only relevant for methods. */
2748
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2749
};
2750
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2751
static_assert(0 < 1, "There is no slot for us");
2752
2753
MOZ_CAN_RUN_SCRIPT static bool
2754
hasFocus(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
2755
0
{
2756
0
  AUTO_PROFILER_LABEL_FAST("Document.hasFocus", DOM, cx);
2757
0
2758
0
  FastErrorResult rv;
2759
0
  bool result(self->HasFocus(rv));
2760
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2761
0
    return false;
2762
0
  }
2763
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2764
0
  args.rval().setBoolean(result);
2765
0
  return true;
2766
0
}
2767
2768
static const JSJitInfo hasFocus_methodinfo = {
2769
  { (JSJitGetterOp)hasFocus },
2770
  { prototypes::id::Document },
2771
  { PrototypeTraits<prototypes::id::Document>::Depth },
2772
  JSJitInfo::Method,
2773
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2774
  JSVAL_TYPE_BOOLEAN,  /* returnType.  Not relevant for setters. */
2775
  false,  /* isInfallible. False in setters. */
2776
  false,  /* isMovable.  Not relevant for setters. */
2777
  false, /* isEliminatable.  Not relevant for setters. */
2778
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2779
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2780
  false,  /* isTypedMethod.  Only relevant for methods. */
2781
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2782
};
2783
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2784
static_assert(0 < 1, "There is no slot for us");
2785
2786
MOZ_CAN_RUN_SCRIPT static bool
2787
get_onreadystatechange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
2788
0
{
2789
0
  AUTO_PROFILER_LABEL_FAST("get Document.onreadystatechange", DOM, cx);
2790
0
2791
0
  RefPtr<EventHandlerNonNull> result(self->GetOnreadystatechange());
2792
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2793
0
  if (result) {
2794
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
2795
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
2796
0
      return false;
2797
0
    }
2798
0
    return true;
2799
0
  } else {
2800
0
    args.rval().setNull();
2801
0
    return true;
2802
0
  }
2803
0
}
2804
2805
MOZ_CAN_RUN_SCRIPT static bool
2806
set_onreadystatechange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
2807
0
{
2808
0
  AUTO_PROFILER_LABEL_FAST("set Document.onreadystatechange", DOM, cx);
2809
0
2810
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
2811
0
  if (args[0].isObject()) {
2812
0
    { // scope for tempRoot and tempGlobalRoot if needed
2813
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
2814
0
    }
2815
0
  } else {
2816
0
    arg0 = nullptr;
2817
0
  }
2818
0
  self->SetOnreadystatechange(Constify(arg0));
2819
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2820
0
2821
0
  return true;
2822
0
}
2823
2824
static const JSJitInfo onreadystatechange_getterinfo = {
2825
  { (JSJitGetterOp)get_onreadystatechange },
2826
  { prototypes::id::Document },
2827
  { PrototypeTraits<prototypes::id::Document>::Depth },
2828
  JSJitInfo::Getter,
2829
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2830
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
2831
  false,  /* isInfallible. False in setters. */
2832
  false,  /* isMovable.  Not relevant for setters. */
2833
  false, /* isEliminatable.  Not relevant for setters. */
2834
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2835
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2836
  false,  /* isTypedMethod.  Only relevant for methods. */
2837
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2838
};
2839
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2840
static_assert(0 < 1, "There is no slot for us");
2841
static const JSJitInfo onreadystatechange_setterinfo = {
2842
  { (JSJitGetterOp)set_onreadystatechange },
2843
  { prototypes::id::Document },
2844
  { PrototypeTraits<prototypes::id::Document>::Depth },
2845
  JSJitInfo::Setter,
2846
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2847
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
2848
  false,  /* isInfallible. False in setters. */
2849
  false,  /* isMovable.  Not relevant for setters. */
2850
  false, /* isEliminatable.  Not relevant for setters. */
2851
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2852
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2853
  false,  /* isTypedMethod.  Only relevant for methods. */
2854
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2855
};
2856
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2857
static_assert(0 < 1, "There is no slot for us");
2858
2859
MOZ_CAN_RUN_SCRIPT static bool
2860
get_onbeforescriptexecute(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
2861
0
{
2862
0
  AUTO_PROFILER_LABEL_FAST("get Document.onbeforescriptexecute", DOM, cx);
2863
0
2864
0
  RefPtr<EventHandlerNonNull> result(self->GetOnbeforescriptexecute());
2865
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2866
0
  if (result) {
2867
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
2868
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
2869
0
      return false;
2870
0
    }
2871
0
    return true;
2872
0
  } else {
2873
0
    args.rval().setNull();
2874
0
    return true;
2875
0
  }
2876
0
}
2877
2878
MOZ_CAN_RUN_SCRIPT static bool
2879
set_onbeforescriptexecute(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
2880
0
{
2881
0
  AUTO_PROFILER_LABEL_FAST("set Document.onbeforescriptexecute", DOM, cx);
2882
0
2883
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
2884
0
  if (args[0].isObject()) {
2885
0
    { // scope for tempRoot and tempGlobalRoot if needed
2886
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
2887
0
    }
2888
0
  } else {
2889
0
    arg0 = nullptr;
2890
0
  }
2891
0
  self->SetOnbeforescriptexecute(Constify(arg0));
2892
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2893
0
2894
0
  return true;
2895
0
}
2896
2897
static const JSJitInfo onbeforescriptexecute_getterinfo = {
2898
  { (JSJitGetterOp)get_onbeforescriptexecute },
2899
  { prototypes::id::Document },
2900
  { PrototypeTraits<prototypes::id::Document>::Depth },
2901
  JSJitInfo::Getter,
2902
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2903
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
2904
  false,  /* isInfallible. False in setters. */
2905
  false,  /* isMovable.  Not relevant for setters. */
2906
  false, /* isEliminatable.  Not relevant for setters. */
2907
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2908
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2909
  false,  /* isTypedMethod.  Only relevant for methods. */
2910
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2911
};
2912
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2913
static_assert(0 < 1, "There is no slot for us");
2914
static const JSJitInfo onbeforescriptexecute_setterinfo = {
2915
  { (JSJitGetterOp)set_onbeforescriptexecute },
2916
  { prototypes::id::Document },
2917
  { PrototypeTraits<prototypes::id::Document>::Depth },
2918
  JSJitInfo::Setter,
2919
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2920
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
2921
  false,  /* isInfallible. False in setters. */
2922
  false,  /* isMovable.  Not relevant for setters. */
2923
  false, /* isEliminatable.  Not relevant for setters. */
2924
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2925
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2926
  false,  /* isTypedMethod.  Only relevant for methods. */
2927
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2928
};
2929
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2930
static_assert(0 < 1, "There is no slot for us");
2931
2932
MOZ_CAN_RUN_SCRIPT static bool
2933
get_onafterscriptexecute(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
2934
0
{
2935
0
  AUTO_PROFILER_LABEL_FAST("get Document.onafterscriptexecute", DOM, cx);
2936
0
2937
0
  RefPtr<EventHandlerNonNull> result(self->GetOnafterscriptexecute());
2938
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2939
0
  if (result) {
2940
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
2941
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
2942
0
      return false;
2943
0
    }
2944
0
    return true;
2945
0
  } else {
2946
0
    args.rval().setNull();
2947
0
    return true;
2948
0
  }
2949
0
}
2950
2951
MOZ_CAN_RUN_SCRIPT static bool
2952
set_onafterscriptexecute(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
2953
0
{
2954
0
  AUTO_PROFILER_LABEL_FAST("set Document.onafterscriptexecute", DOM, cx);
2955
0
2956
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
2957
0
  if (args[0].isObject()) {
2958
0
    { // scope for tempRoot and tempGlobalRoot if needed
2959
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
2960
0
    }
2961
0
  } else {
2962
0
    arg0 = nullptr;
2963
0
  }
2964
0
  self->SetOnafterscriptexecute(Constify(arg0));
2965
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2966
0
2967
0
  return true;
2968
0
}
2969
2970
static const JSJitInfo onafterscriptexecute_getterinfo = {
2971
  { (JSJitGetterOp)get_onafterscriptexecute },
2972
  { prototypes::id::Document },
2973
  { PrototypeTraits<prototypes::id::Document>::Depth },
2974
  JSJitInfo::Getter,
2975
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2976
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
2977
  false,  /* isInfallible. False in setters. */
2978
  false,  /* isMovable.  Not relevant for setters. */
2979
  false, /* isEliminatable.  Not relevant for setters. */
2980
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2981
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2982
  false,  /* isTypedMethod.  Only relevant for methods. */
2983
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2984
};
2985
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2986
static_assert(0 < 1, "There is no slot for us");
2987
static const JSJitInfo onafterscriptexecute_setterinfo = {
2988
  { (JSJitGetterOp)set_onafterscriptexecute },
2989
  { prototypes::id::Document },
2990
  { PrototypeTraits<prototypes::id::Document>::Depth },
2991
  JSJitInfo::Setter,
2992
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2993
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
2994
  false,  /* isInfallible. False in setters. */
2995
  false,  /* isMovable.  Not relevant for setters. */
2996
  false, /* isEliminatable.  Not relevant for setters. */
2997
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2998
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2999
  false,  /* isTypedMethod.  Only relevant for methods. */
3000
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3001
};
3002
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3003
static_assert(0 < 1, "There is no slot for us");
3004
3005
MOZ_CAN_RUN_SCRIPT static bool
3006
get_onselectionchange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
3007
0
{
3008
0
  AUTO_PROFILER_LABEL_FAST("get Document.onselectionchange", DOM, cx);
3009
0
3010
0
  RefPtr<EventHandlerNonNull> result(self->GetOnselectionchange());
3011
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3012
0
  if (result) {
3013
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
3014
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
3015
0
      return false;
3016
0
    }
3017
0
    return true;
3018
0
  } else {
3019
0
    args.rval().setNull();
3020
0
    return true;
3021
0
  }
3022
0
}
3023
3024
MOZ_CAN_RUN_SCRIPT static bool
3025
set_onselectionchange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
3026
0
{
3027
0
  AUTO_PROFILER_LABEL_FAST("set Document.onselectionchange", DOM, cx);
3028
0
3029
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
3030
0
  if (args[0].isObject()) {
3031
0
    { // scope for tempRoot and tempGlobalRoot if needed
3032
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
3033
0
    }
3034
0
  } else {
3035
0
    arg0 = nullptr;
3036
0
  }
3037
0
  self->SetOnselectionchange(Constify(arg0));
3038
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3039
0
3040
0
  return true;
3041
0
}
3042
3043
static const JSJitInfo onselectionchange_getterinfo = {
3044
  { (JSJitGetterOp)get_onselectionchange },
3045
  { prototypes::id::Document },
3046
  { PrototypeTraits<prototypes::id::Document>::Depth },
3047
  JSJitInfo::Getter,
3048
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3049
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
3050
  false,  /* isInfallible. False in setters. */
3051
  false,  /* isMovable.  Not relevant for setters. */
3052
  false, /* isEliminatable.  Not relevant for setters. */
3053
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3054
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3055
  false,  /* isTypedMethod.  Only relevant for methods. */
3056
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3057
};
3058
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3059
static_assert(0 < 1, "There is no slot for us");
3060
static const JSJitInfo onselectionchange_setterinfo = {
3061
  { (JSJitGetterOp)set_onselectionchange },
3062
  { prototypes::id::Document },
3063
  { PrototypeTraits<prototypes::id::Document>::Depth },
3064
  JSJitInfo::Setter,
3065
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3066
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
3067
  false,  /* isInfallible. False in setters. */
3068
  false,  /* isMovable.  Not relevant for setters. */
3069
  false, /* isEliminatable.  Not relevant for setters. */
3070
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3071
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3072
  false,  /* isTypedMethod.  Only relevant for methods. */
3073
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3074
};
3075
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3076
static_assert(0 < 1, "There is no slot for us");
3077
3078
MOZ_CAN_RUN_SCRIPT static bool
3079
get_mozSyntheticDocument(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
3080
0
{
3081
0
  AUTO_PROFILER_LABEL_FAST("get Document.mozSyntheticDocument", DOM, cx);
3082
0
3083
0
  bool result(self->MozSyntheticDocument());
3084
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3085
0
  args.rval().setBoolean(result);
3086
0
  return true;
3087
0
}
3088
3089
static const JSJitInfo mozSyntheticDocument_getterinfo = {
3090
  { (JSJitGetterOp)get_mozSyntheticDocument },
3091
  { prototypes::id::Document },
3092
  { PrototypeTraits<prototypes::id::Document>::Depth },
3093
  JSJitInfo::Getter,
3094
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3095
  JSVAL_TYPE_BOOLEAN,  /* returnType.  Not relevant for setters. */
3096
  true,  /* isInfallible. False in setters. */
3097
  false,  /* isMovable.  Not relevant for setters. */
3098
  false, /* isEliminatable.  Not relevant for setters. */
3099
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3100
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3101
  false,  /* isTypedMethod.  Only relevant for methods. */
3102
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3103
};
3104
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3105
static_assert(0 < 1, "There is no slot for us");
3106
3107
MOZ_CAN_RUN_SCRIPT static bool
3108
getBoxObjectFor(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
3109
0
{
3110
0
  AUTO_PROFILER_LABEL_FAST("Document.getBoxObjectFor", DOM, cx);
3111
0
3112
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
3113
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.getBoxObjectFor");
3114
0
  }
3115
0
  mozilla::dom::Element* arg0;
3116
0
  if (args[0].isObject()) {
3117
0
    {
3118
0
      nsresult rv = UnwrapObject<prototypes::id::Element, mozilla::dom::Element>(args[0], arg0);
3119
0
      if (NS_FAILED(rv)) {
3120
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of Document.getBoxObjectFor", "Element");
3121
0
        return false;
3122
0
      }
3123
0
    }
3124
0
  } else if (args[0].isNullOrUndefined()) {
3125
0
    arg0 = nullptr;
3126
0
  } else {
3127
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of Document.getBoxObjectFor");
3128
0
    return false;
3129
0
  }
3130
0
  FastErrorResult rv;
3131
0
  auto result(StrongOrRawPtr<mozilla::dom::BoxObject>(self->GetBoxObjectFor(MOZ_KnownLive(Constify(arg0)), rv)));
3132
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
3133
0
    return false;
3134
0
  }
3135
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3136
0
  if (!result) {
3137
0
    args.rval().setNull();
3138
0
    return true;
3139
0
  }
3140
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
3141
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
3142
0
    return false;
3143
0
  }
3144
0
  return true;
3145
0
}
3146
3147
static const JSJitInfo getBoxObjectFor_methodinfo = {
3148
  { (JSJitGetterOp)getBoxObjectFor },
3149
  { prototypes::id::Document },
3150
  { PrototypeTraits<prototypes::id::Document>::Depth },
3151
  JSJitInfo::Method,
3152
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3153
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
3154
  false,  /* isInfallible. False in setters. */
3155
  false,  /* isMovable.  Not relevant for setters. */
3156
  false, /* isEliminatable.  Not relevant for setters. */
3157
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3158
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3159
  false,  /* isTypedMethod.  Only relevant for methods. */
3160
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3161
};
3162
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3163
static_assert(0 < 1, "There is no slot for us");
3164
3165
MOZ_CAN_RUN_SCRIPT static bool
3166
get_currentScript(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
3167
0
{
3168
0
  AUTO_PROFILER_LABEL_FAST("get Document.currentScript", DOM, cx);
3169
0
3170
0
  auto result(StrongOrRawPtr<mozilla::dom::Element>(self->GetCurrentScript()));
3171
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3172
0
  if (!result) {
3173
0
    args.rval().setNull();
3174
0
    return true;
3175
0
  }
3176
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
3177
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
3178
0
    return false;
3179
0
  }
3180
0
  return true;
3181
0
}
3182
3183
static const JSJitInfo currentScript_getterinfo = {
3184
  { (JSJitGetterOp)get_currentScript },
3185
  { prototypes::id::Document },
3186
  { PrototypeTraits<prototypes::id::Document>::Depth },
3187
  JSJitInfo::Getter,
3188
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
3189
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
3190
  false,  /* isInfallible. False in setters. */
3191
  true,  /* isMovable.  Not relevant for setters. */
3192
  true, /* isEliminatable.  Not relevant for setters. */
3193
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3194
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3195
  false,  /* isTypedMethod.  Only relevant for methods. */
3196
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3197
};
3198
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3199
static_assert(0 < 1, "There is no slot for us");
3200
3201
MOZ_CAN_RUN_SCRIPT static bool
3202
releaseCapture(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
3203
0
{
3204
0
  AUTO_PROFILER_LABEL_FAST("Document.releaseCapture", DOM, cx);
3205
0
3206
0
  self->ReleaseCapture();
3207
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3208
0
  args.rval().setUndefined();
3209
0
  return true;
3210
0
}
3211
3212
static const JSJitInfo releaseCapture_methodinfo = {
3213
  { (JSJitGetterOp)releaseCapture },
3214
  { prototypes::id::Document },
3215
  { PrototypeTraits<prototypes::id::Document>::Depth },
3216
  JSJitInfo::Method,
3217
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3218
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
3219
  true,  /* isInfallible. False in setters. */
3220
  false,  /* isMovable.  Not relevant for setters. */
3221
  false, /* isEliminatable.  Not relevant for setters. */
3222
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3223
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3224
  false,  /* isTypedMethod.  Only relevant for methods. */
3225
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3226
};
3227
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3228
static_assert(0 < 1, "There is no slot for us");
3229
3230
MOZ_CAN_RUN_SCRIPT static bool
3231
mozSetImageElement(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
3232
0
{
3233
0
  AUTO_PROFILER_LABEL_FAST("Document.mozSetImageElement", DOM, cx);
3234
0
3235
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
3236
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.mozSetImageElement");
3237
0
  }
3238
0
  binding_detail::FakeString arg0;
3239
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
3240
0
    return false;
3241
0
  }
3242
0
  mozilla::dom::Element* arg1;
3243
0
  if (args[1].isObject()) {
3244
0
    {
3245
0
      nsresult rv = UnwrapObject<prototypes::id::Element, mozilla::dom::Element>(args[1], arg1);
3246
0
      if (NS_FAILED(rv)) {
3247
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of Document.mozSetImageElement", "Element");
3248
0
        return false;
3249
0
      }
3250
0
    }
3251
0
  } else if (args[1].isNullOrUndefined()) {
3252
0
    arg1 = nullptr;
3253
0
  } else {
3254
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of Document.mozSetImageElement");
3255
0
    return false;
3256
0
  }
3257
0
  self->MozSetImageElement(NonNullHelper(Constify(arg0)), MOZ_KnownLive(Constify(arg1)));
3258
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3259
0
  args.rval().setUndefined();
3260
0
  return true;
3261
0
}
3262
3263
static const JSJitInfo mozSetImageElement_methodinfo = {
3264
  { (JSJitGetterOp)mozSetImageElement },
3265
  { prototypes::id::Document },
3266
  { PrototypeTraits<prototypes::id::Document>::Depth },
3267
  JSJitInfo::Method,
3268
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3269
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
3270
  false,  /* isInfallible. False in setters. */
3271
  false,  /* isMovable.  Not relevant for setters. */
3272
  false, /* isEliminatable.  Not relevant for setters. */
3273
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3274
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3275
  false,  /* isTypedMethod.  Only relevant for methods. */
3276
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3277
};
3278
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3279
static_assert(0 < 1, "There is no slot for us");
3280
3281
MOZ_CAN_RUN_SCRIPT static bool
3282
get_documentURIObject(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
3283
0
{
3284
0
  AUTO_PROFILER_LABEL_FAST("get Document.documentURIObject", DOM, cx);
3285
0
3286
0
  auto result(StrongOrRawPtr<nsIURI>(self->GetDocumentURIObject()));
3287
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3288
0
  if (!result) {
3289
0
    args.rval().setNull();
3290
0
    return true;
3291
0
  }
3292
0
  if (!WrapObject(cx, result, &NS_GET_IID(nsIURI), args.rval())) {
3293
0
    return false;
3294
0
  }
3295
0
  return true;
3296
0
}
3297
3298
static const JSJitInfo documentURIObject_getterinfo = {
3299
  { (JSJitGetterOp)get_documentURIObject },
3300
  { prototypes::id::Document },
3301
  { PrototypeTraits<prototypes::id::Document>::Depth },
3302
  JSJitInfo::Getter,
3303
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3304
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
3305
  false,  /* isInfallible. False in setters. */
3306
  false,  /* isMovable.  Not relevant for setters. */
3307
  false, /* isEliminatable.  Not relevant for setters. */
3308
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3309
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3310
  false,  /* isTypedMethod.  Only relevant for methods. */
3311
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3312
};
3313
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3314
static_assert(0 < 1, "There is no slot for us");
3315
3316
MOZ_CAN_RUN_SCRIPT static bool
3317
get_referrerPolicy(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
3318
0
{
3319
0
  AUTO_PROFILER_LABEL_FAST("get Document.referrerPolicy", DOM, cx);
3320
0
3321
0
  uint32_t result(self->ReferrerPolicy());
3322
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3323
0
  args.rval().setNumber(result);
3324
0
  return true;
3325
0
}
3326
3327
static const JSJitInfo referrerPolicy_getterinfo = {
3328
  { (JSJitGetterOp)get_referrerPolicy },
3329
  { prototypes::id::Document },
3330
  { PrototypeTraits<prototypes::id::Document>::Depth },
3331
  JSJitInfo::Getter,
3332
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3333
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3334
  true,  /* isInfallible. False in setters. */
3335
  false,  /* isMovable.  Not relevant for setters. */
3336
  false, /* isEliminatable.  Not relevant for setters. */
3337
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3338
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3339
  false,  /* isTypedMethod.  Only relevant for methods. */
3340
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3341
};
3342
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3343
static_assert(0 < 1, "There is no slot for us");
3344
3345
MOZ_CAN_RUN_SCRIPT static bool
3346
get_anchors(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
3347
0
{
3348
0
  AUTO_PROFILER_LABEL_FAST("get Document.anchors", DOM, cx);
3349
0
3350
0
  auto result(StrongOrRawPtr<nsIHTMLCollection>(self->Anchors()));
3351
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3352
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
3353
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
3354
0
    return false;
3355
0
  }
3356
0
  return true;
3357
0
}
3358
3359
static const JSJitInfo anchors_getterinfo = {
3360
  { (JSJitGetterOp)get_anchors },
3361
  { prototypes::id::Document },
3362
  { PrototypeTraits<prototypes::id::Document>::Depth },
3363
  JSJitInfo::Getter,
3364
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
3365
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
3366
  false,  /* isInfallible. False in setters. */
3367
  true,  /* isMovable.  Not relevant for setters. */
3368
  true, /* isEliminatable.  Not relevant for setters. */
3369
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3370
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3371
  false,  /* isTypedMethod.  Only relevant for methods. */
3372
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3373
};
3374
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3375
static_assert(0 < 1, "There is no slot for us");
3376
3377
MOZ_CAN_RUN_SCRIPT static bool
3378
get_applets(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
3379
0
{
3380
0
  AUTO_PROFILER_LABEL_FAST("get Document.applets", DOM, cx);
3381
0
3382
0
  auto result(StrongOrRawPtr<nsIHTMLCollection>(self->Applets()));
3383
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3384
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
3385
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
3386
0
    return false;
3387
0
  }
3388
0
  return true;
3389
0
}
3390
3391
static const JSJitInfo applets_getterinfo = {
3392
  { (JSJitGetterOp)get_applets },
3393
  { prototypes::id::Document },
3394
  { PrototypeTraits<prototypes::id::Document>::Depth },
3395
  JSJitInfo::Getter,
3396
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
3397
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
3398
  false,  /* isInfallible. False in setters. */
3399
  true,  /* isMovable.  Not relevant for setters. */
3400
  true, /* isEliminatable.  Not relevant for setters. */
3401
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3402
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3403
  false,  /* isTypedMethod.  Only relevant for methods. */
3404
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3405
};
3406
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3407
static_assert(0 < 1, "There is no slot for us");
3408
3409
MOZ_CAN_RUN_SCRIPT static bool
3410
get_fullscreen(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
3411
0
{
3412
0
  AUTO_PROFILER_LABEL_FAST("get Document.fullscreen", DOM, cx);
3413
0
3414
0
  bool result(self->Fullscreen());
3415
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3416
0
  args.rval().setBoolean(result);
3417
0
  return true;
3418
0
}
3419
3420
MOZ_CAN_RUN_SCRIPT static bool
3421
set_fullscreen(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
3422
0
{
3423
0
  AUTO_PROFILER_LABEL_FAST("set Document.fullscreen", DOM, cx);
3424
0
3425
0
  DeprecationWarning(cx, obj, nsIDocument::eLenientSetter);
3426
0
  return true;
3427
0
}
3428
3429
static const JSJitInfo fullscreen_getterinfo = {
3430
  { (JSJitGetterOp)get_fullscreen },
3431
  { prototypes::id::Document },
3432
  { PrototypeTraits<prototypes::id::Document>::Depth },
3433
  JSJitInfo::Getter,
3434
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3435
  JSVAL_TYPE_BOOLEAN,  /* returnType.  Not relevant for setters. */
3436
  true,  /* isInfallible. False in setters. */
3437
  false,  /* isMovable.  Not relevant for setters. */
3438
  false, /* isEliminatable.  Not relevant for setters. */
3439
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3440
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3441
  false,  /* isTypedMethod.  Only relevant for methods. */
3442
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3443
};
3444
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3445
static_assert(0 < 1, "There is no slot for us");
3446
static const JSJitInfo fullscreen_setterinfo = {
3447
  { (JSJitGetterOp)set_fullscreen },
3448
  { prototypes::id::Document },
3449
  { PrototypeTraits<prototypes::id::Document>::Depth },
3450
  JSJitInfo::Setter,
3451
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3452
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
3453
  false,  /* isInfallible. False in setters. */
3454
  false,  /* isMovable.  Not relevant for setters. */
3455
  false, /* isEliminatable.  Not relevant for setters. */
3456
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3457
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3458
  false,  /* isTypedMethod.  Only relevant for methods. */
3459
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3460
};
3461
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3462
static_assert(0 < 1, "There is no slot for us");
3463
3464
MOZ_CAN_RUN_SCRIPT static bool
3465
get_mozFullScreen(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
3466
0
{
3467
0
  AUTO_PROFILER_LABEL_FAST("get Document.mozFullScreen", DOM, cx);
3468
0
3469
0
  bool result(self->Fullscreen());
3470
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3471
0
  args.rval().setBoolean(result);
3472
0
  return true;
3473
0
}
3474
3475
static const JSJitInfo mozFullScreen_getterinfo = {
3476
  { (JSJitGetterOp)get_mozFullScreen },
3477
  { prototypes::id::Document },
3478
  { PrototypeTraits<prototypes::id::Document>::Depth },
3479
  JSJitInfo::Getter,
3480
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3481
  JSVAL_TYPE_BOOLEAN,  /* returnType.  Not relevant for setters. */
3482
  true,  /* isInfallible. False in setters. */
3483
  false,  /* isMovable.  Not relevant for setters. */
3484
  false, /* isEliminatable.  Not relevant for setters. */
3485
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3486
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3487
  false,  /* isTypedMethod.  Only relevant for methods. */
3488
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3489
};
3490
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3491
static_assert(0 < 1, "There is no slot for us");
3492
3493
MOZ_CAN_RUN_SCRIPT static bool
3494
get_fullscreenEnabled(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
3495
0
{
3496
0
  AUTO_PROFILER_LABEL_FAST("get Document.fullscreenEnabled", DOM, cx);
3497
0
3498
0
  bool result(self->FullscreenEnabled(nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem));
3499
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3500
0
  args.rval().setBoolean(result);
3501
0
  return true;
3502
0
}
3503
3504
MOZ_CAN_RUN_SCRIPT static bool
3505
set_fullscreenEnabled(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
3506
0
{
3507
0
  AUTO_PROFILER_LABEL_FAST("set Document.fullscreenEnabled", DOM, cx);
3508
0
3509
0
  DeprecationWarning(cx, obj, nsIDocument::eLenientSetter);
3510
0
  return true;
3511
0
}
3512
3513
static const JSJitInfo fullscreenEnabled_getterinfo = {
3514
  { (JSJitGetterOp)get_fullscreenEnabled },
3515
  { prototypes::id::Document },
3516
  { PrototypeTraits<prototypes::id::Document>::Depth },
3517
  JSJitInfo::Getter,
3518
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3519
  JSVAL_TYPE_BOOLEAN,  /* returnType.  Not relevant for setters. */
3520
  true,  /* isInfallible. False in setters. */
3521
  false,  /* isMovable.  Not relevant for setters. */
3522
  false, /* isEliminatable.  Not relevant for setters. */
3523
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3524
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3525
  false,  /* isTypedMethod.  Only relevant for methods. */
3526
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3527
};
3528
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3529
static_assert(0 < 1, "There is no slot for us");
3530
static const JSJitInfo fullscreenEnabled_setterinfo = {
3531
  { (JSJitGetterOp)set_fullscreenEnabled },
3532
  { prototypes::id::Document },
3533
  { PrototypeTraits<prototypes::id::Document>::Depth },
3534
  JSJitInfo::Setter,
3535
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3536
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
3537
  false,  /* isInfallible. False in setters. */
3538
  false,  /* isMovable.  Not relevant for setters. */
3539
  false, /* isEliminatable.  Not relevant for setters. */
3540
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3541
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3542
  false,  /* isTypedMethod.  Only relevant for methods. */
3543
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3544
};
3545
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3546
static_assert(0 < 1, "There is no slot for us");
3547
3548
MOZ_CAN_RUN_SCRIPT static bool
3549
get_mozFullScreenEnabled(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
3550
0
{
3551
0
  AUTO_PROFILER_LABEL_FAST("get Document.mozFullScreenEnabled", DOM, cx);
3552
0
3553
0
  bool result(self->FullscreenEnabled(nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem));
3554
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3555
0
  args.rval().setBoolean(result);
3556
0
  return true;
3557
0
}
3558
3559
static const JSJitInfo mozFullScreenEnabled_getterinfo = {
3560
  { (JSJitGetterOp)get_mozFullScreenEnabled },
3561
  { prototypes::id::Document },
3562
  { PrototypeTraits<prototypes::id::Document>::Depth },
3563
  JSJitInfo::Getter,
3564
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3565
  JSVAL_TYPE_BOOLEAN,  /* returnType.  Not relevant for setters. */
3566
  true,  /* isInfallible. False in setters. */
3567
  false,  /* isMovable.  Not relevant for setters. */
3568
  false, /* isEliminatable.  Not relevant for setters. */
3569
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3570
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3571
  false,  /* isTypedMethod.  Only relevant for methods. */
3572
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3573
};
3574
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3575
static_assert(0 < 1, "There is no slot for us");
3576
3577
MOZ_CAN_RUN_SCRIPT static bool
3578
exitFullscreen(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
3579
0
{
3580
0
  AUTO_PROFILER_LABEL_FAST("Document.exitFullscreen", DOM, cx);
3581
0
3582
0
  FastErrorResult rv;
3583
0
  auto result(StrongOrRawPtr<Promise>(self->ExitFullscreen(rv)));
3584
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
3585
0
    return false;
3586
0
  }
3587
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3588
0
  if (!ToJSValue(cx, result, args.rval())) {
3589
0
    return false;
3590
0
  }
3591
0
  return true;
3592
0
}
3593
3594
MOZ_CAN_RUN_SCRIPT static bool
3595
exitFullscreen_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
3596
0
{
3597
0
  bool ok = exitFullscreen(cx, obj, self, args);
3598
0
  if (ok) {
3599
0
    return true;
3600
0
  }
3601
0
  return ConvertExceptionToPromise(cx, args.rval());
3602
0
}
3603
3604
static const JSJitInfo exitFullscreen_methodinfo = {
3605
  { (JSJitGetterOp)exitFullscreen_promiseWrapper },
3606
  { prototypes::id::Document },
3607
  { PrototypeTraits<prototypes::id::Document>::Depth },
3608
  JSJitInfo::Method,
3609
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3610
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
3611
  false,  /* isInfallible. False in setters. */
3612
  false,  /* isMovable.  Not relevant for setters. */
3613
  false, /* isEliminatable.  Not relevant for setters. */
3614
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3615
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3616
  false,  /* isTypedMethod.  Only relevant for methods. */
3617
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3618
};
3619
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3620
static_assert(0 < 1, "There is no slot for us");
3621
3622
MOZ_CAN_RUN_SCRIPT static bool
3623
mozCancelFullScreen(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
3624
0
{
3625
0
  AUTO_PROFILER_LABEL_FAST("Document.mozCancelFullScreen", DOM, cx);
3626
0
3627
0
  FastErrorResult rv;
3628
0
  auto result(StrongOrRawPtr<Promise>(self->ExitFullscreen(rv)));
3629
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
3630
0
    return false;
3631
0
  }
3632
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3633
0
  if (!ToJSValue(cx, result, args.rval())) {
3634
0
    return false;
3635
0
  }
3636
0
  return true;
3637
0
}
3638
3639
MOZ_CAN_RUN_SCRIPT static bool
3640
mozCancelFullScreen_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
3641
0
{
3642
0
  bool ok = mozCancelFullScreen(cx, obj, self, args);
3643
0
  if (ok) {
3644
0
    return true;
3645
0
  }
3646
0
  return ConvertExceptionToPromise(cx, args.rval());
3647
0
}
3648
3649
static const JSJitInfo mozCancelFullScreen_methodinfo = {
3650
  { (JSJitGetterOp)mozCancelFullScreen_promiseWrapper },
3651
  { prototypes::id::Document },
3652
  { PrototypeTraits<prototypes::id::Document>::Depth },
3653
  JSJitInfo::Method,
3654
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3655
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
3656
  false,  /* isInfallible. False in setters. */
3657
  false,  /* isMovable.  Not relevant for setters. */
3658
  false, /* isEliminatable.  Not relevant for setters. */
3659
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3660
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3661
  false,  /* isTypedMethod.  Only relevant for methods. */
3662
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3663
};
3664
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3665
static_assert(0 < 1, "There is no slot for us");
3666
3667
MOZ_CAN_RUN_SCRIPT static bool
3668
get_onfullscreenchange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
3669
0
{
3670
0
  AUTO_PROFILER_LABEL_FAST("get Document.onfullscreenchange", DOM, cx);
3671
0
3672
0
  RefPtr<EventHandlerNonNull> result(self->GetOnfullscreenchange());
3673
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3674
0
  if (result) {
3675
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
3676
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
3677
0
      return false;
3678
0
    }
3679
0
    return true;
3680
0
  } else {
3681
0
    args.rval().setNull();
3682
0
    return true;
3683
0
  }
3684
0
}
3685
3686
MOZ_CAN_RUN_SCRIPT static bool
3687
set_onfullscreenchange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
3688
0
{
3689
0
  AUTO_PROFILER_LABEL_FAST("set Document.onfullscreenchange", DOM, cx);
3690
0
3691
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
3692
0
  if (args[0].isObject()) {
3693
0
    { // scope for tempRoot and tempGlobalRoot if needed
3694
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
3695
0
    }
3696
0
  } else {
3697
0
    arg0 = nullptr;
3698
0
  }
3699
0
  self->SetOnfullscreenchange(Constify(arg0));
3700
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3701
0
3702
0
  return true;
3703
0
}
3704
3705
static const JSJitInfo onfullscreenchange_getterinfo = {
3706
  { (JSJitGetterOp)get_onfullscreenchange },
3707
  { prototypes::id::Document },
3708
  { PrototypeTraits<prototypes::id::Document>::Depth },
3709
  JSJitInfo::Getter,
3710
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3711
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
3712
  false,  /* isInfallible. False in setters. */
3713
  false,  /* isMovable.  Not relevant for setters. */
3714
  false, /* isEliminatable.  Not relevant for setters. */
3715
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3716
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3717
  false,  /* isTypedMethod.  Only relevant for methods. */
3718
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3719
};
3720
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3721
static_assert(0 < 1, "There is no slot for us");
3722
static const JSJitInfo onfullscreenchange_setterinfo = {
3723
  { (JSJitGetterOp)set_onfullscreenchange },
3724
  { prototypes::id::Document },
3725
  { PrototypeTraits<prototypes::id::Document>::Depth },
3726
  JSJitInfo::Setter,
3727
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3728
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
3729
  false,  /* isInfallible. False in setters. */
3730
  false,  /* isMovable.  Not relevant for setters. */
3731
  false, /* isEliminatable.  Not relevant for setters. */
3732
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3733
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3734
  false,  /* isTypedMethod.  Only relevant for methods. */
3735
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3736
};
3737
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3738
static_assert(0 < 1, "There is no slot for us");
3739
3740
MOZ_CAN_RUN_SCRIPT static bool
3741
get_onfullscreenerror(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
3742
0
{
3743
0
  AUTO_PROFILER_LABEL_FAST("get Document.onfullscreenerror", DOM, cx);
3744
0
3745
0
  RefPtr<EventHandlerNonNull> result(self->GetOnfullscreenerror());
3746
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3747
0
  if (result) {
3748
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
3749
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
3750
0
      return false;
3751
0
    }
3752
0
    return true;
3753
0
  } else {
3754
0
    args.rval().setNull();
3755
0
    return true;
3756
0
  }
3757
0
}
3758
3759
MOZ_CAN_RUN_SCRIPT static bool
3760
set_onfullscreenerror(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
3761
0
{
3762
0
  AUTO_PROFILER_LABEL_FAST("set Document.onfullscreenerror", DOM, cx);
3763
0
3764
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
3765
0
  if (args[0].isObject()) {
3766
0
    { // scope for tempRoot and tempGlobalRoot if needed
3767
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
3768
0
    }
3769
0
  } else {
3770
0
    arg0 = nullptr;
3771
0
  }
3772
0
  self->SetOnfullscreenerror(Constify(arg0));
3773
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3774
0
3775
0
  return true;
3776
0
}
3777
3778
static const JSJitInfo onfullscreenerror_getterinfo = {
3779
  { (JSJitGetterOp)get_onfullscreenerror },
3780
  { prototypes::id::Document },
3781
  { PrototypeTraits<prototypes::id::Document>::Depth },
3782
  JSJitInfo::Getter,
3783
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3784
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
3785
  false,  /* isInfallible. False in setters. */
3786
  false,  /* isMovable.  Not relevant for setters. */
3787
  false, /* isEliminatable.  Not relevant for setters. */
3788
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3789
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3790
  false,  /* isTypedMethod.  Only relevant for methods. */
3791
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3792
};
3793
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3794
static_assert(0 < 1, "There is no slot for us");
3795
static const JSJitInfo onfullscreenerror_setterinfo = {
3796
  { (JSJitGetterOp)set_onfullscreenerror },
3797
  { prototypes::id::Document },
3798
  { PrototypeTraits<prototypes::id::Document>::Depth },
3799
  JSJitInfo::Setter,
3800
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3801
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
3802
  false,  /* isInfallible. False in setters. */
3803
  false,  /* isMovable.  Not relevant for setters. */
3804
  false, /* isEliminatable.  Not relevant for setters. */
3805
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3806
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3807
  false,  /* isTypedMethod.  Only relevant for methods. */
3808
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3809
};
3810
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3811
static_assert(0 < 1, "There is no slot for us");
3812
3813
MOZ_CAN_RUN_SCRIPT static bool
3814
exitPointerLock(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
3815
0
{
3816
0
  AUTO_PROFILER_LABEL_FAST("Document.exitPointerLock", DOM, cx);
3817
0
3818
0
  self->ExitPointerLock();
3819
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3820
0
  args.rval().setUndefined();
3821
0
  return true;
3822
0
}
3823
3824
static const JSJitInfo exitPointerLock_methodinfo = {
3825
  { (JSJitGetterOp)exitPointerLock },
3826
  { prototypes::id::Document },
3827
  { PrototypeTraits<prototypes::id::Document>::Depth },
3828
  JSJitInfo::Method,
3829
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3830
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
3831
  true,  /* isInfallible. False in setters. */
3832
  false,  /* isMovable.  Not relevant for setters. */
3833
  false, /* isEliminatable.  Not relevant for setters. */
3834
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3835
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3836
  false,  /* isTypedMethod.  Only relevant for methods. */
3837
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3838
};
3839
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3840
static_assert(0 < 1, "There is no slot for us");
3841
3842
MOZ_CAN_RUN_SCRIPT static bool
3843
get_onpointerlockchange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
3844
0
{
3845
0
  AUTO_PROFILER_LABEL_FAST("get Document.onpointerlockchange", DOM, cx);
3846
0
3847
0
  RefPtr<EventHandlerNonNull> result(self->GetOnpointerlockchange());
3848
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3849
0
  if (result) {
3850
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
3851
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
3852
0
      return false;
3853
0
    }
3854
0
    return true;
3855
0
  } else {
3856
0
    args.rval().setNull();
3857
0
    return true;
3858
0
  }
3859
0
}
3860
3861
MOZ_CAN_RUN_SCRIPT static bool
3862
set_onpointerlockchange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
3863
0
{
3864
0
  AUTO_PROFILER_LABEL_FAST("set Document.onpointerlockchange", DOM, cx);
3865
0
3866
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
3867
0
  if (args[0].isObject()) {
3868
0
    { // scope for tempRoot and tempGlobalRoot if needed
3869
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
3870
0
    }
3871
0
  } else {
3872
0
    arg0 = nullptr;
3873
0
  }
3874
0
  self->SetOnpointerlockchange(Constify(arg0));
3875
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3876
0
3877
0
  return true;
3878
0
}
3879
3880
static const JSJitInfo onpointerlockchange_getterinfo = {
3881
  { (JSJitGetterOp)get_onpointerlockchange },
3882
  { prototypes::id::Document },
3883
  { PrototypeTraits<prototypes::id::Document>::Depth },
3884
  JSJitInfo::Getter,
3885
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3886
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
3887
  false,  /* isInfallible. False in setters. */
3888
  false,  /* isMovable.  Not relevant for setters. */
3889
  false, /* isEliminatable.  Not relevant for setters. */
3890
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3891
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3892
  false,  /* isTypedMethod.  Only relevant for methods. */
3893
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3894
};
3895
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3896
static_assert(0 < 1, "There is no slot for us");
3897
static const JSJitInfo onpointerlockchange_setterinfo = {
3898
  { (JSJitGetterOp)set_onpointerlockchange },
3899
  { prototypes::id::Document },
3900
  { PrototypeTraits<prototypes::id::Document>::Depth },
3901
  JSJitInfo::Setter,
3902
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3903
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
3904
  false,  /* isInfallible. False in setters. */
3905
  false,  /* isMovable.  Not relevant for setters. */
3906
  false, /* isEliminatable.  Not relevant for setters. */
3907
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3908
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3909
  false,  /* isTypedMethod.  Only relevant for methods. */
3910
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3911
};
3912
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3913
static_assert(0 < 1, "There is no slot for us");
3914
3915
MOZ_CAN_RUN_SCRIPT static bool
3916
get_onpointerlockerror(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
3917
0
{
3918
0
  AUTO_PROFILER_LABEL_FAST("get Document.onpointerlockerror", DOM, cx);
3919
0
3920
0
  RefPtr<EventHandlerNonNull> result(self->GetOnpointerlockerror());
3921
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3922
0
  if (result) {
3923
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
3924
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
3925
0
      return false;
3926
0
    }
3927
0
    return true;
3928
0
  } else {
3929
0
    args.rval().setNull();
3930
0
    return true;
3931
0
  }
3932
0
}
3933
3934
MOZ_CAN_RUN_SCRIPT static bool
3935
set_onpointerlockerror(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
3936
0
{
3937
0
  AUTO_PROFILER_LABEL_FAST("set Document.onpointerlockerror", DOM, cx);
3938
0
3939
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
3940
0
  if (args[0].isObject()) {
3941
0
    { // scope for tempRoot and tempGlobalRoot if needed
3942
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
3943
0
    }
3944
0
  } else {
3945
0
    arg0 = nullptr;
3946
0
  }
3947
0
  self->SetOnpointerlockerror(Constify(arg0));
3948
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3949
0
3950
0
  return true;
3951
0
}
3952
3953
static const JSJitInfo onpointerlockerror_getterinfo = {
3954
  { (JSJitGetterOp)get_onpointerlockerror },
3955
  { prototypes::id::Document },
3956
  { PrototypeTraits<prototypes::id::Document>::Depth },
3957
  JSJitInfo::Getter,
3958
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3959
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
3960
  false,  /* isInfallible. False in setters. */
3961
  false,  /* isMovable.  Not relevant for setters. */
3962
  false, /* isEliminatable.  Not relevant for setters. */
3963
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3964
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3965
  false,  /* isTypedMethod.  Only relevant for methods. */
3966
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3967
};
3968
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3969
static_assert(0 < 1, "There is no slot for us");
3970
static const JSJitInfo onpointerlockerror_setterinfo = {
3971
  { (JSJitGetterOp)set_onpointerlockerror },
3972
  { prototypes::id::Document },
3973
  { PrototypeTraits<prototypes::id::Document>::Depth },
3974
  JSJitInfo::Setter,
3975
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3976
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
3977
  false,  /* isInfallible. False in setters. */
3978
  false,  /* isMovable.  Not relevant for setters. */
3979
  false, /* isEliminatable.  Not relevant for setters. */
3980
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3981
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3982
  false,  /* isTypedMethod.  Only relevant for methods. */
3983
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3984
};
3985
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3986
static_assert(0 < 1, "There is no slot for us");
3987
3988
MOZ_CAN_RUN_SCRIPT static bool
3989
get_hidden(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
3990
0
{
3991
0
  AUTO_PROFILER_LABEL_FAST("get Document.hidden", DOM, cx);
3992
0
3993
0
  bool result(self->Hidden());
3994
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3995
0
  args.rval().setBoolean(result);
3996
0
  return true;
3997
0
}
3998
3999
static const JSJitInfo hidden_getterinfo = {
4000
  { (JSJitGetterOp)get_hidden },
4001
  { prototypes::id::Document },
4002
  { PrototypeTraits<prototypes::id::Document>::Depth },
4003
  JSJitInfo::Getter,
4004
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4005
  JSVAL_TYPE_BOOLEAN,  /* returnType.  Not relevant for setters. */
4006
  true,  /* isInfallible. False in setters. */
4007
  false,  /* isMovable.  Not relevant for setters. */
4008
  false, /* isEliminatable.  Not relevant for setters. */
4009
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4010
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4011
  false,  /* isTypedMethod.  Only relevant for methods. */
4012
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4013
};
4014
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4015
static_assert(0 < 1, "There is no slot for us");
4016
4017
MOZ_CAN_RUN_SCRIPT static bool
4018
get_visibilityState(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
4019
0
{
4020
0
  AUTO_PROFILER_LABEL_FAST("get Document.visibilityState", DOM, cx);
4021
0
4022
0
  VisibilityState result(self->VisibilityState());
4023
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4024
0
  if (!ToJSValue(cx, result, args.rval())) {
4025
0
    return false;
4026
0
  }
4027
0
  return true;
4028
0
}
4029
4030
static const JSJitInfo visibilityState_getterinfo = {
4031
  { (JSJitGetterOp)get_visibilityState },
4032
  { prototypes::id::Document },
4033
  { PrototypeTraits<prototypes::id::Document>::Depth },
4034
  JSJitInfo::Getter,
4035
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4036
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
4037
  false,  /* isInfallible. False in setters. */
4038
  false,  /* isMovable.  Not relevant for setters. */
4039
  false, /* isEliminatable.  Not relevant for setters. */
4040
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4041
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4042
  false,  /* isTypedMethod.  Only relevant for methods. */
4043
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4044
};
4045
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4046
static_assert(0 < 1, "There is no slot for us");
4047
4048
MOZ_CAN_RUN_SCRIPT static bool
4049
get_onvisibilitychange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
4050
0
{
4051
0
  AUTO_PROFILER_LABEL_FAST("get Document.onvisibilitychange", DOM, cx);
4052
0
4053
0
  RefPtr<EventHandlerNonNull> result(self->GetOnvisibilitychange());
4054
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4055
0
  if (result) {
4056
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
4057
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
4058
0
      return false;
4059
0
    }
4060
0
    return true;
4061
0
  } else {
4062
0
    args.rval().setNull();
4063
0
    return true;
4064
0
  }
4065
0
}
4066
4067
MOZ_CAN_RUN_SCRIPT static bool
4068
set_onvisibilitychange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
4069
0
{
4070
0
  AUTO_PROFILER_LABEL_FAST("set Document.onvisibilitychange", DOM, cx);
4071
0
4072
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
4073
0
  if (args[0].isObject()) {
4074
0
    { // scope for tempRoot and tempGlobalRoot if needed
4075
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
4076
0
    }
4077
0
  } else {
4078
0
    arg0 = nullptr;
4079
0
  }
4080
0
  self->SetOnvisibilitychange(Constify(arg0));
4081
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4082
0
4083
0
  return true;
4084
0
}
4085
4086
static const JSJitInfo onvisibilitychange_getterinfo = {
4087
  { (JSJitGetterOp)get_onvisibilitychange },
4088
  { prototypes::id::Document },
4089
  { PrototypeTraits<prototypes::id::Document>::Depth },
4090
  JSJitInfo::Getter,
4091
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4092
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
4093
  false,  /* isInfallible. False in setters. */
4094
  false,  /* isMovable.  Not relevant for setters. */
4095
  false, /* isEliminatable.  Not relevant for setters. */
4096
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4097
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4098
  false,  /* isTypedMethod.  Only relevant for methods. */
4099
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4100
};
4101
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4102
static_assert(0 < 1, "There is no slot for us");
4103
static const JSJitInfo onvisibilitychange_setterinfo = {
4104
  { (JSJitGetterOp)set_onvisibilitychange },
4105
  { prototypes::id::Document },
4106
  { PrototypeTraits<prototypes::id::Document>::Depth },
4107
  JSJitInfo::Setter,
4108
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4109
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
4110
  false,  /* isInfallible. False in setters. */
4111
  false,  /* isMovable.  Not relevant for setters. */
4112
  false, /* isEliminatable.  Not relevant for setters. */
4113
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4114
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4115
  false,  /* isTypedMethod.  Only relevant for methods. */
4116
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4117
};
4118
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4119
static_assert(0 < 1, "There is no slot for us");
4120
4121
MOZ_CAN_RUN_SCRIPT static bool
4122
get_selectedStyleSheetSet(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
4123
0
{
4124
0
  AUTO_PROFILER_LABEL_FAST("get Document.selectedStyleSheetSet", DOM, cx);
4125
0
4126
0
  DOMString result;
4127
0
  self->GetSelectedStyleSheetSet(result);
4128
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4129
0
  if (!xpc::StringToJsval(cx, result, args.rval())) {
4130
0
    return false;
4131
0
  }
4132
0
  return true;
4133
0
}
4134
4135
MOZ_CAN_RUN_SCRIPT static bool
4136
set_selectedStyleSheetSet(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
4137
0
{
4138
0
  AUTO_PROFILER_LABEL_FAST("set Document.selectedStyleSheetSet", DOM, cx);
4139
0
4140
0
  binding_detail::FakeString arg0;
4141
0
  if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
4142
0
    return false;
4143
0
  }
4144
0
  self->SetSelectedStyleSheetSet(NonNullHelper(Constify(arg0)));
4145
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4146
0
4147
0
  return true;
4148
0
}
4149
4150
static const JSJitInfo selectedStyleSheetSet_getterinfo = {
4151
  { (JSJitGetterOp)get_selectedStyleSheetSet },
4152
  { prototypes::id::Document },
4153
  { PrototypeTraits<prototypes::id::Document>::Depth },
4154
  JSJitInfo::Getter,
4155
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4156
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
4157
  false,  /* isInfallible. False in setters. */
4158
  false,  /* isMovable.  Not relevant for setters. */
4159
  false, /* isEliminatable.  Not relevant for setters. */
4160
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4161
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4162
  false,  /* isTypedMethod.  Only relevant for methods. */
4163
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4164
};
4165
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4166
static_assert(0 < 1, "There is no slot for us");
4167
static const JSJitInfo selectedStyleSheetSet_setterinfo = {
4168
  { (JSJitGetterOp)set_selectedStyleSheetSet },
4169
  { prototypes::id::Document },
4170
  { PrototypeTraits<prototypes::id::Document>::Depth },
4171
  JSJitInfo::Setter,
4172
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4173
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
4174
  false,  /* isInfallible. False in setters. */
4175
  false,  /* isMovable.  Not relevant for setters. */
4176
  false, /* isEliminatable.  Not relevant for setters. */
4177
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4178
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4179
  false,  /* isTypedMethod.  Only relevant for methods. */
4180
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4181
};
4182
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4183
static_assert(0 < 1, "There is no slot for us");
4184
4185
MOZ_CAN_RUN_SCRIPT static bool
4186
get_lastStyleSheetSet(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
4187
0
{
4188
0
  AUTO_PROFILER_LABEL_FAST("get Document.lastStyleSheetSet", DOM, cx);
4189
0
4190
0
  DOMString result;
4191
0
  self->GetLastStyleSheetSet(result);
4192
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4193
0
  if (!xpc::StringToJsval(cx, result, args.rval())) {
4194
0
    return false;
4195
0
  }
4196
0
  return true;
4197
0
}
4198
4199
static const JSJitInfo lastStyleSheetSet_getterinfo = {
4200
  { (JSJitGetterOp)get_lastStyleSheetSet },
4201
  { prototypes::id::Document },
4202
  { PrototypeTraits<prototypes::id::Document>::Depth },
4203
  JSJitInfo::Getter,
4204
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4205
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
4206
  false,  /* isInfallible. False in setters. */
4207
  false,  /* isMovable.  Not relevant for setters. */
4208
  false, /* isEliminatable.  Not relevant for setters. */
4209
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4210
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4211
  false,  /* isTypedMethod.  Only relevant for methods. */
4212
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4213
};
4214
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4215
static_assert(0 < 1, "There is no slot for us");
4216
4217
MOZ_CAN_RUN_SCRIPT static bool
4218
get_preferredStyleSheetSet(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
4219
0
{
4220
0
  AUTO_PROFILER_LABEL_FAST("get Document.preferredStyleSheetSet", DOM, cx);
4221
0
4222
0
  DOMString result;
4223
0
  self->GetPreferredStyleSheetSet(result);
4224
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4225
0
  if (!xpc::StringToJsval(cx, result, args.rval())) {
4226
0
    return false;
4227
0
  }
4228
0
  return true;
4229
0
}
4230
4231
static const JSJitInfo preferredStyleSheetSet_getterinfo = {
4232
  { (JSJitGetterOp)get_preferredStyleSheetSet },
4233
  { prototypes::id::Document },
4234
  { PrototypeTraits<prototypes::id::Document>::Depth },
4235
  JSJitInfo::Getter,
4236
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4237
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
4238
  false,  /* isInfallible. False in setters. */
4239
  false,  /* isMovable.  Not relevant for setters. */
4240
  false, /* isEliminatable.  Not relevant for setters. */
4241
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4242
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4243
  false,  /* isTypedMethod.  Only relevant for methods. */
4244
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4245
};
4246
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4247
static_assert(0 < 1, "There is no slot for us");
4248
4249
MOZ_CAN_RUN_SCRIPT static bool
4250
get_styleSheetSets(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
4251
0
{
4252
0
  AUTO_PROFILER_LABEL_FAST("get Document.styleSheetSets", DOM, cx);
4253
0
4254
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMStringList>(self->StyleSheetSets()));
4255
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4256
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
4257
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4258
0
    return false;
4259
0
  }
4260
0
  return true;
4261
0
}
4262
4263
static const JSJitInfo styleSheetSets_getterinfo = {
4264
  { (JSJitGetterOp)get_styleSheetSets },
4265
  { prototypes::id::Document },
4266
  { PrototypeTraits<prototypes::id::Document>::Depth },
4267
  JSJitInfo::Getter,
4268
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
4269
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
4270
  false,  /* isInfallible. False in setters. */
4271
  true,  /* isMovable.  Not relevant for setters. */
4272
  true, /* isEliminatable.  Not relevant for setters. */
4273
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4274
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4275
  false,  /* isTypedMethod.  Only relevant for methods. */
4276
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4277
};
4278
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4279
static_assert(0 < 1, "There is no slot for us");
4280
4281
MOZ_CAN_RUN_SCRIPT static bool
4282
enableStyleSheetsForSet(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
4283
0
{
4284
0
  AUTO_PROFILER_LABEL_FAST("Document.enableStyleSheetsForSet", DOM, cx);
4285
0
4286
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
4287
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.enableStyleSheetsForSet");
4288
0
  }
4289
0
  binding_detail::FakeString arg0;
4290
0
  if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
4291
0
    return false;
4292
0
  }
4293
0
  self->EnableStyleSheetsForSet(NonNullHelper(Constify(arg0)));
4294
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4295
0
  args.rval().setUndefined();
4296
0
  return true;
4297
0
}
4298
4299
static const JSJitInfo enableStyleSheetsForSet_methodinfo = {
4300
  { (JSJitGetterOp)enableStyleSheetsForSet },
4301
  { prototypes::id::Document },
4302
  { PrototypeTraits<prototypes::id::Document>::Depth },
4303
  JSJitInfo::Method,
4304
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4305
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
4306
  false,  /* isInfallible. False in setters. */
4307
  false,  /* isMovable.  Not relevant for setters. */
4308
  false, /* isEliminatable.  Not relevant for setters. */
4309
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4310
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4311
  false,  /* isTypedMethod.  Only relevant for methods. */
4312
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4313
};
4314
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4315
static_assert(0 < 1, "There is no slot for us");
4316
4317
MOZ_CAN_RUN_SCRIPT static bool
4318
caretPositionFromPoint(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
4319
0
{
4320
0
  AUTO_PROFILER_LABEL_FAST("Document.caretPositionFromPoint", DOM, cx);
4321
0
4322
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
4323
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.caretPositionFromPoint");
4324
0
  }
4325
0
  float arg0;
4326
0
  if (!ValueToPrimitive<float, eDefault>(cx, args[0], &arg0)) {
4327
0
    return false;
4328
0
  } else if (!mozilla::IsFinite(arg0)) {
4329
0
    ThrowErrorMessage(cx, MSG_NOT_FINITE, "Argument 1 of Document.caretPositionFromPoint");
4330
0
    return false;
4331
0
  }
4332
0
  float arg1;
4333
0
  if (!ValueToPrimitive<float, eDefault>(cx, args[1], &arg1)) {
4334
0
    return false;
4335
0
  } else if (!mozilla::IsFinite(arg1)) {
4336
0
    ThrowErrorMessage(cx, MSG_NOT_FINITE, "Argument 2 of Document.caretPositionFromPoint");
4337
0
    return false;
4338
0
  }
4339
0
  auto result(StrongOrRawPtr<nsDOMCaretPosition>(self->CaretPositionFromPoint(arg0, arg1)));
4340
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4341
0
  if (!result) {
4342
0
    args.rval().setNull();
4343
0
    return true;
4344
0
  }
4345
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
4346
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4347
0
    return false;
4348
0
  }
4349
0
  return true;
4350
0
}
4351
4352
static const JSJitInfo caretPositionFromPoint_methodinfo = {
4353
  { (JSJitGetterOp)caretPositionFromPoint },
4354
  { prototypes::id::Document },
4355
  { PrototypeTraits<prototypes::id::Document>::Depth },
4356
  JSJitInfo::Method,
4357
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4358
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
4359
  false,  /* isInfallible. False in setters. */
4360
  false,  /* isMovable.  Not relevant for setters. */
4361
  false, /* isEliminatable.  Not relevant for setters. */
4362
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4363
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4364
  false,  /* isTypedMethod.  Only relevant for methods. */
4365
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4366
};
4367
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4368
static_assert(0 < 1, "There is no slot for us");
4369
4370
MOZ_CAN_RUN_SCRIPT static bool
4371
get_scrollingElement(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
4372
0
{
4373
0
  AUTO_PROFILER_LABEL_FAST("get Document.scrollingElement", DOM, cx);
4374
0
4375
0
  auto result(StrongOrRawPtr<mozilla::dom::Element>(self->GetScrollingElement()));
4376
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4377
0
  if (!result) {
4378
0
    args.rval().setNull();
4379
0
    return true;
4380
0
  }
4381
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
4382
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4383
0
    return false;
4384
0
  }
4385
0
  return true;
4386
0
}
4387
4388
static const JSJitInfo scrollingElement_getterinfo = {
4389
  { (JSJitGetterOp)get_scrollingElement },
4390
  { prototypes::id::Document },
4391
  { PrototypeTraits<prototypes::id::Document>::Depth },
4392
  JSJitInfo::Getter,
4393
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4394
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
4395
  false,  /* isInfallible. False in setters. */
4396
  false,  /* isMovable.  Not relevant for setters. */
4397
  false, /* isEliminatable.  Not relevant for setters. */
4398
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4399
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4400
  false,  /* isTypedMethod.  Only relevant for methods. */
4401
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4402
};
4403
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4404
static_assert(0 < 1, "There is no slot for us");
4405
4406
MOZ_CAN_RUN_SCRIPT static bool
4407
querySelector(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
4408
0
{
4409
0
  AUTO_PROFILER_LABEL_FAST("Document.querySelector", DOM, cx);
4410
0
4411
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
4412
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.querySelector");
4413
0
  }
4414
0
  binding_detail::FakeString arg0;
4415
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
4416
0
    return false;
4417
0
  }
4418
0
  FastErrorResult rv;
4419
0
  auto result(StrongOrRawPtr<mozilla::dom::Element>(self->QuerySelector(NonNullHelper(Constify(arg0)), rv)));
4420
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
4421
0
    return false;
4422
0
  }
4423
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4424
0
  if (!result) {
4425
0
    args.rval().setNull();
4426
0
    return true;
4427
0
  }
4428
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
4429
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4430
0
    return false;
4431
0
  }
4432
0
  return true;
4433
0
}
4434
4435
static const JSJitInfo::ArgType querySelector_methodinfo_argTypes[] = { JSJitInfo::String, JSJitInfo::ArgTypeListEnd };
4436
static const JSTypedMethodJitInfo querySelector_methodinfo = {
4437
  {
4438
    { (JSJitGetterOp)querySelector },
4439
    { prototypes::id::Document },
4440
    { PrototypeTraits<prototypes::id::Document>::Depth },
4441
    JSJitInfo::Method,
4442
    JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
4443
    JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
4444
    false,  /* isInfallible. False in setters. */
4445
    false,  /* isMovable.  Not relevant for setters. */
4446
    false, /* isEliminatable.  Not relevant for setters. */
4447
    false, /* isAlwaysInSlot.  Only relevant for getters. */
4448
    false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4449
    true,  /* isTypedMethod.  Only relevant for methods. */
4450
    0   /* Reserved slot index, if we're stored in a slot, else 0. */
4451
  },
4452
  querySelector_methodinfo_argTypes
4453
};
4454
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4455
static_assert(0 < 1, "There is no slot for us");
4456
4457
MOZ_CAN_RUN_SCRIPT static bool
4458
querySelectorAll(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
4459
0
{
4460
0
  AUTO_PROFILER_LABEL_FAST("Document.querySelectorAll", DOM, cx);
4461
0
4462
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
4463
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.querySelectorAll");
4464
0
  }
4465
0
  binding_detail::FakeString arg0;
4466
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
4467
0
    return false;
4468
0
  }
4469
0
  FastErrorResult rv;
4470
0
  auto result(StrongOrRawPtr<nsINodeList>(self->QuerySelectorAll(NonNullHelper(Constify(arg0)), rv)));
4471
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
4472
0
    return false;
4473
0
  }
4474
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4475
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
4476
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4477
0
    return false;
4478
0
  }
4479
0
  return true;
4480
0
}
4481
4482
static const JSJitInfo::ArgType querySelectorAll_methodinfo_argTypes[] = { JSJitInfo::String, JSJitInfo::ArgTypeListEnd };
4483
static const JSTypedMethodJitInfo querySelectorAll_methodinfo = {
4484
  {
4485
    { (JSJitGetterOp)querySelectorAll },
4486
    { prototypes::id::Document },
4487
    { PrototypeTraits<prototypes::id::Document>::Depth },
4488
    JSJitInfo::Method,
4489
    JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
4490
    JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
4491
    false,  /* isInfallible. False in setters. */
4492
    false,  /* isMovable.  Not relevant for setters. */
4493
    false, /* isEliminatable.  Not relevant for setters. */
4494
    false, /* isAlwaysInSlot.  Only relevant for getters. */
4495
    false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4496
    true,  /* isTypedMethod.  Only relevant for methods. */
4497
    0   /* Reserved slot index, if we're stored in a slot, else 0. */
4498
  },
4499
  querySelectorAll_methodinfo_argTypes
4500
};
4501
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4502
static_assert(0 < 1, "There is no slot for us");
4503
4504
MOZ_CAN_RUN_SCRIPT static bool
4505
get_timeline(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
4506
0
{
4507
0
  AUTO_PROFILER_LABEL_FAST("get Document.timeline", DOM, cx);
4508
0
4509
0
  auto result(StrongOrRawPtr<mozilla::dom::DocumentTimeline>(self->Timeline()));
4510
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4511
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
4512
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4513
0
    return false;
4514
0
  }
4515
0
  return true;
4516
0
}
4517
4518
static const JSJitInfo timeline_getterinfo = {
4519
  { (JSJitGetterOp)get_timeline },
4520
  { prototypes::id::Document },
4521
  { PrototypeTraits<prototypes::id::Document>::Depth },
4522
  JSJitInfo::Getter,
4523
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4524
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
4525
  false,  /* isInfallible. False in setters. */
4526
  false,  /* isMovable.  Not relevant for setters. */
4527
  false, /* isEliminatable.  Not relevant for setters. */
4528
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4529
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4530
  false,  /* isTypedMethod.  Only relevant for methods. */
4531
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4532
};
4533
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4534
static_assert(0 < 1, "There is no slot for us");
4535
4536
MOZ_CAN_RUN_SCRIPT static bool
4537
getAnimations(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
4538
0
{
4539
0
  AUTO_PROFILER_LABEL_FAST("Document.getAnimations", DOM, cx);
4540
0
4541
0
  nsTArray<StrongPtrForMember<mozilla::dom::Animation>::Type> result;
4542
0
  self->GetAnimations(result);
4543
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4544
0
4545
0
  uint32_t length = result.Length();
4546
0
  JS::Rooted<JSObject*> returnArray(cx, JS_NewArrayObject(cx, length));
4547
0
  if (!returnArray) {
4548
0
    return false;
4549
0
  }
4550
0
  // Scope for 'tmp'
4551
0
  {
4552
0
    JS::Rooted<JS::Value> tmp(cx);
4553
0
    for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
4554
0
      // Control block to let us common up the JS_DefineElement calls when there
4555
0
      // are different ways to succeed at wrapping the object.
4556
0
      do {
4557
0
        if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) {
4558
0
          MOZ_ASSERT(JS_IsExceptionPending(cx));
4559
0
          return false;
4560
0
        }
4561
0
        break;
4562
0
      } while (false);
4563
0
      if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
4564
0
                            JSPROP_ENUMERATE)) {
4565
0
        return false;
4566
0
      }
4567
0
    }
4568
0
  }
4569
0
  args.rval().setObject(*returnArray);
4570
0
  return true;
4571
0
}
4572
4573
static const JSJitInfo getAnimations_methodinfo = {
4574
  { (JSJitGetterOp)getAnimations },
4575
  { prototypes::id::Document },
4576
  { PrototypeTraits<prototypes::id::Document>::Depth },
4577
  JSJitInfo::Method,
4578
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4579
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
4580
  false,  /* isInfallible. False in setters. */
4581
  false,  /* isMovable.  Not relevant for setters. */
4582
  false, /* isEliminatable.  Not relevant for setters. */
4583
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4584
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4585
  false,  /* isTypedMethod.  Only relevant for methods. */
4586
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4587
};
4588
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4589
static_assert(0 < 1, "There is no slot for us");
4590
4591
MOZ_CAN_RUN_SCRIPT static bool
4592
get_rootElement(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
4593
0
{
4594
0
  AUTO_PROFILER_LABEL_FAST("get Document.rootElement", DOM, cx);
4595
0
4596
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGSVGElement>(self->GetSVGRootElement()));
4597
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4598
0
  if (!result) {
4599
0
    args.rval().setNull();
4600
0
    return true;
4601
0
  }
4602
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
4603
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4604
0
    return false;
4605
0
  }
4606
0
  return true;
4607
0
}
4608
4609
static const JSJitInfo rootElement_getterinfo = {
4610
  { (JSJitGetterOp)get_rootElement },
4611
  { prototypes::id::Document },
4612
  { PrototypeTraits<prototypes::id::Document>::Depth },
4613
  JSJitInfo::Getter,
4614
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4615
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
4616
  false,  /* isInfallible. False in setters. */
4617
  false,  /* isMovable.  Not relevant for setters. */
4618
  false, /* isEliminatable.  Not relevant for setters. */
4619
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4620
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4621
  false,  /* isTypedMethod.  Only relevant for methods. */
4622
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4623
};
4624
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4625
static_assert(0 < 1, "There is no slot for us");
4626
4627
MOZ_CAN_RUN_SCRIPT static bool
4628
getAnonymousNodes(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
4629
0
{
4630
0
  AUTO_PROFILER_LABEL_FAST("Document.getAnonymousNodes", DOM, cx);
4631
0
4632
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
4633
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.getAnonymousNodes");
4634
0
  }
4635
0
  NonNull<mozilla::dom::Element> arg0;
4636
0
  if (args[0].isObject()) {
4637
0
    {
4638
0
      nsresult rv = UnwrapObject<prototypes::id::Element, mozilla::dom::Element>(args[0], arg0);
4639
0
      if (NS_FAILED(rv)) {
4640
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of Document.getAnonymousNodes", "Element");
4641
0
        return false;
4642
0
      }
4643
0
    }
4644
0
  } else {
4645
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of Document.getAnonymousNodes");
4646
0
    return false;
4647
0
  }
4648
0
  auto result(StrongOrRawPtr<nsINodeList>(self->GetAnonymousNodes(MOZ_KnownLive(NonNullHelper(arg0)))));
4649
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4650
0
  if (!result) {
4651
0
    args.rval().setNull();
4652
0
    return true;
4653
0
  }
4654
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
4655
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4656
0
    return false;
4657
0
  }
4658
0
  return true;
4659
0
}
4660
4661
static const JSJitInfo getAnonymousNodes_methodinfo = {
4662
  { (JSJitGetterOp)getAnonymousNodes },
4663
  { prototypes::id::Document },
4664
  { PrototypeTraits<prototypes::id::Document>::Depth },
4665
  JSJitInfo::Method,
4666
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4667
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
4668
  false,  /* isInfallible. False in setters. */
4669
  false,  /* isMovable.  Not relevant for setters. */
4670
  false, /* isEliminatable.  Not relevant for setters. */
4671
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4672
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4673
  false,  /* isTypedMethod.  Only relevant for methods. */
4674
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4675
};
4676
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4677
static_assert(0 < 1, "There is no slot for us");
4678
4679
MOZ_CAN_RUN_SCRIPT static bool
4680
getAnonymousElementByAttribute(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
4681
0
{
4682
0
  AUTO_PROFILER_LABEL_FAST("Document.getAnonymousElementByAttribute", DOM, cx);
4683
0
4684
0
  if (MOZ_UNLIKELY(args.length() < 3)) {
4685
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.getAnonymousElementByAttribute");
4686
0
  }
4687
0
  NonNull<mozilla::dom::Element> arg0;
4688
0
  if (args[0].isObject()) {
4689
0
    {
4690
0
      nsresult rv = UnwrapObject<prototypes::id::Element, mozilla::dom::Element>(args[0], arg0);
4691
0
      if (NS_FAILED(rv)) {
4692
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of Document.getAnonymousElementByAttribute", "Element");
4693
0
        return false;
4694
0
      }
4695
0
    }
4696
0
  } else {
4697
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of Document.getAnonymousElementByAttribute");
4698
0
    return false;
4699
0
  }
4700
0
  binding_detail::FakeString arg1;
4701
0
  if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) {
4702
0
    return false;
4703
0
  }
4704
0
  binding_detail::FakeString arg2;
4705
0
  if (!ConvertJSValueToString(cx, args[2], eStringify, eStringify, arg2)) {
4706
0
    return false;
4707
0
  }
4708
0
  auto result(StrongOrRawPtr<mozilla::dom::Element>(self->GetAnonymousElementByAttribute(MOZ_KnownLive(NonNullHelper(arg0)), NonNullHelper(Constify(arg1)), NonNullHelper(Constify(arg2)))));
4709
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4710
0
  if (!result) {
4711
0
    args.rval().setNull();
4712
0
    return true;
4713
0
  }
4714
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
4715
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4716
0
    return false;
4717
0
  }
4718
0
  return true;
4719
0
}
4720
4721
static const JSJitInfo getAnonymousElementByAttribute_methodinfo = {
4722
  { (JSJitGetterOp)getAnonymousElementByAttribute },
4723
  { prototypes::id::Document },
4724
  { PrototypeTraits<prototypes::id::Document>::Depth },
4725
  JSJitInfo::Method,
4726
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4727
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
4728
  false,  /* isInfallible. False in setters. */
4729
  false,  /* isMovable.  Not relevant for setters. */
4730
  false, /* isEliminatable.  Not relevant for setters. */
4731
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4732
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4733
  false,  /* isTypedMethod.  Only relevant for methods. */
4734
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4735
};
4736
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4737
static_assert(0 < 1, "There is no slot for us");
4738
4739
MOZ_CAN_RUN_SCRIPT static bool
4740
getBindingParent(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
4741
0
{
4742
0
  AUTO_PROFILER_LABEL_FAST("Document.getBindingParent", DOM, cx);
4743
0
4744
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
4745
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.getBindingParent");
4746
0
  }
4747
0
  NonNull<nsINode> arg0;
4748
0
  if (args[0].isObject()) {
4749
0
    {
4750
0
      nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(args[0], arg0);
4751
0
      if (NS_FAILED(rv)) {
4752
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of Document.getBindingParent", "Node");
4753
0
        return false;
4754
0
      }
4755
0
    }
4756
0
  } else {
4757
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of Document.getBindingParent");
4758
0
    return false;
4759
0
  }
4760
0
  auto result(StrongOrRawPtr<mozilla::dom::Element>(self->GetBindingParent(MOZ_KnownLive(NonNullHelper(arg0)))));
4761
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4762
0
  if (!result) {
4763
0
    args.rval().setNull();
4764
0
    return true;
4765
0
  }
4766
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
4767
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4768
0
    return false;
4769
0
  }
4770
0
  return true;
4771
0
}
4772
4773
static const JSJitInfo getBindingParent_methodinfo = {
4774
  { (JSJitGetterOp)getBindingParent },
4775
  { prototypes::id::Document },
4776
  { PrototypeTraits<prototypes::id::Document>::Depth },
4777
  JSJitInfo::Method,
4778
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4779
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
4780
  false,  /* isInfallible. False in setters. */
4781
  false,  /* isMovable.  Not relevant for setters. */
4782
  false, /* isEliminatable.  Not relevant for setters. */
4783
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4784
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4785
  false,  /* isTypedMethod.  Only relevant for methods. */
4786
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4787
};
4788
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4789
static_assert(0 < 1, "There is no slot for us");
4790
4791
MOZ_CAN_RUN_SCRIPT static bool
4792
loadBindingDocument(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
4793
0
{
4794
0
  AUTO_PROFILER_LABEL_FAST("Document.loadBindingDocument", DOM, cx);
4795
0
4796
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
4797
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.loadBindingDocument");
4798
0
  }
4799
0
  binding_detail::FakeString arg0;
4800
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
4801
0
    return false;
4802
0
  }
4803
0
  FastErrorResult rv;
4804
0
  NonNull<nsIPrincipal> subjectPrincipal;
4805
0
  {
4806
0
    JS::Realm* realm = js::GetContextRealm(cx);
4807
0
    MOZ_ASSERT(realm);
4808
0
    JSPrincipals* principals = JS::GetRealmPrincipals(realm);
4809
0
    nsIPrincipal* principal = nsJSPrincipals::get(principals);
4810
0
4811
0
    subjectPrincipal = principal;
4812
0
  }
4813
0
  self->LoadBindingDocument(NonNullHelper(Constify(arg0)), subjectPrincipal, rv);
4814
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
4815
0
    return false;
4816
0
  }
4817
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4818
0
  args.rval().setUndefined();
4819
0
  return true;
4820
0
}
4821
4822
static const JSJitInfo loadBindingDocument_methodinfo = {
4823
  { (JSJitGetterOp)loadBindingDocument },
4824
  { prototypes::id::Document },
4825
  { PrototypeTraits<prototypes::id::Document>::Depth },
4826
  JSJitInfo::Method,
4827
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4828
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
4829
  false,  /* isInfallible. False in setters. */
4830
  false,  /* isMovable.  Not relevant for setters. */
4831
  false, /* isEliminatable.  Not relevant for setters. */
4832
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4833
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4834
  false,  /* isTypedMethod.  Only relevant for methods. */
4835
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4836
};
4837
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4838
static_assert(0 < 1, "There is no slot for us");
4839
4840
MOZ_CAN_RUN_SCRIPT static bool
4841
createXULElement(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
4842
0
{
4843
0
  AUTO_PROFILER_LABEL_FAST("Document.createXULElement", DOM, cx);
4844
0
4845
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
4846
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.createXULElement");
4847
0
  }
4848
0
  binding_detail::FakeString arg0;
4849
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
4850
0
    return false;
4851
0
  }
4852
0
  ElementCreationOptionsOrString arg1;
4853
0
  ElementCreationOptionsOrStringArgument arg1_holder(arg1);
4854
0
  if (!(args.hasDefined(1))) {
4855
0
    if (!arg1.RawSetAsElementCreationOptions().Init(cx, JS::NullHandleValue, "Member of ElementCreationOptionsOrString")) {
4856
0
      return false;
4857
0
    }
4858
0
  } else {
4859
0
    {
4860
0
      bool done = false, failed = false, tryNext;
4861
0
      if (!done) {
4862
0
        done = (failed = !arg1_holder.TrySetToElementCreationOptions(cx, args[1], tryNext, false)) || !tryNext;
4863
0
      }
4864
0
      if (!done) {
4865
0
        do {
4866
0
          done = (failed = !arg1_holder.TrySetToString(cx, args[1], tryNext)) || !tryNext;
4867
0
          break;
4868
0
        } while (false);
4869
0
      }
4870
0
      if (failed) {
4871
0
        return false;
4872
0
      }
4873
0
      if (!done) {
4874
0
        ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of Document.createXULElement", "ElementCreationOptions");
4875
0
        return false;
4876
0
      }
4877
0
    }
4878
0
  }
4879
0
  Maybe<AutoCEReaction> ceReaction;
4880
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
4881
0
    DocGroup* docGroup = self->GetDocGroup();
4882
0
    if (docGroup) {
4883
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
4884
0
    }
4885
0
  }
4886
0
  FastErrorResult rv;
4887
0
  auto result(StrongOrRawPtr<mozilla::dom::Element>(self->CreateXULElement(NonNullHelper(Constify(arg0)), Constify(arg1), rv)));
4888
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
4889
0
    return false;
4890
0
  }
4891
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4892
0
  static_assert(!IsPointer<decltype(result)>::value,
4893
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
4894
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
4895
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4896
0
    return false;
4897
0
  }
4898
0
  return true;
4899
0
}
4900
4901
static const JSJitInfo createXULElement_methodinfo = {
4902
  { (JSJitGetterOp)createXULElement },
4903
  { prototypes::id::Document },
4904
  { PrototypeTraits<prototypes::id::Document>::Depth },
4905
  JSJitInfo::Method,
4906
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4907
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
4908
  false,  /* isInfallible. False in setters. */
4909
  false,  /* isMovable.  Not relevant for setters. */
4910
  false, /* isEliminatable.  Not relevant for setters. */
4911
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4912
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4913
  false,  /* isTypedMethod.  Only relevant for methods. */
4914
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4915
};
4916
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4917
static_assert(0 < 1, "There is no slot for us");
4918
4919
MOZ_CAN_RUN_SCRIPT static bool
4920
createTouch(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
4921
0
{
4922
0
  AUTO_PROFILER_LABEL_FAST("Document.createTouch", DOM, cx);
4923
0
4924
0
  nsGlobalWindowInner* arg0;
4925
0
  if (args.hasDefined(0)) {
4926
0
    if (args[0].isObject()) {
4927
0
      {
4928
0
        nsresult rv = UnwrapObject<prototypes::id::Window, nsGlobalWindowInner>(args[0], arg0);
4929
0
        if (NS_FAILED(rv)) {
4930
0
          ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of Document.createTouch", "Window");
4931
0
          return false;
4932
0
        }
4933
0
      }
4934
0
    } else if (args[0].isNullOrUndefined()) {
4935
0
      arg0 = nullptr;
4936
0
    } else {
4937
0
      ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of Document.createTouch");
4938
0
      return false;
4939
0
    }
4940
0
  } else {
4941
0
    arg0 = nullptr;
4942
0
  }
4943
0
  mozilla::dom::EventTarget* arg1;
4944
0
  if (args.hasDefined(1)) {
4945
0
    if (args[1].isObject()) {
4946
0
      {
4947
0
        nsresult rv = UnwrapObject<prototypes::id::EventTarget, mozilla::dom::EventTarget>(args[1], arg1);
4948
0
        if (NS_FAILED(rv)) {
4949
0
          ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of Document.createTouch", "EventTarget");
4950
0
          return false;
4951
0
        }
4952
0
      }
4953
0
    } else if (args[1].isNullOrUndefined()) {
4954
0
      arg1 = nullptr;
4955
0
    } else {
4956
0
      ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of Document.createTouch");
4957
0
      return false;
4958
0
    }
4959
0
  } else {
4960
0
    arg1 = nullptr;
4961
0
  }
4962
0
  int32_t arg2;
4963
0
  if (args.hasDefined(2)) {
4964
0
    if (!ValueToPrimitive<int32_t, eDefault>(cx, args[2], &arg2)) {
4965
0
      return false;
4966
0
    }
4967
0
  } else {
4968
0
    arg2 = 0;
4969
0
  }
4970
0
  int32_t arg3;
4971
0
  if (args.hasDefined(3)) {
4972
0
    if (!ValueToPrimitive<int32_t, eDefault>(cx, args[3], &arg3)) {
4973
0
      return false;
4974
0
    }
4975
0
  } else {
4976
0
    arg3 = 0;
4977
0
  }
4978
0
  int32_t arg4;
4979
0
  if (args.hasDefined(4)) {
4980
0
    if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], &arg4)) {
4981
0
      return false;
4982
0
    }
4983
0
  } else {
4984
0
    arg4 = 0;
4985
0
  }
4986
0
  int32_t arg5;
4987
0
  if (args.hasDefined(5)) {
4988
0
    if (!ValueToPrimitive<int32_t, eDefault>(cx, args[5], &arg5)) {
4989
0
      return false;
4990
0
    }
4991
0
  } else {
4992
0
    arg5 = 0;
4993
0
  }
4994
0
  int32_t arg6;
4995
0
  if (args.hasDefined(6)) {
4996
0
    if (!ValueToPrimitive<int32_t, eDefault>(cx, args[6], &arg6)) {
4997
0
      return false;
4998
0
    }
4999
0
  } else {
5000
0
    arg6 = 0;
5001
0
  }
5002
0
  int32_t arg7;
5003
0
  if (args.hasDefined(7)) {
5004
0
    if (!ValueToPrimitive<int32_t, eDefault>(cx, args[7], &arg7)) {
5005
0
      return false;
5006
0
    }
5007
0
  } else {
5008
0
    arg7 = 0;
5009
0
  }
5010
0
  int32_t arg8;
5011
0
  if (args.hasDefined(8)) {
5012
0
    if (!ValueToPrimitive<int32_t, eDefault>(cx, args[8], &arg8)) {
5013
0
      return false;
5014
0
    }
5015
0
  } else {
5016
0
    arg8 = 0;
5017
0
  }
5018
0
  int32_t arg9;
5019
0
  if (args.hasDefined(9)) {
5020
0
    if (!ValueToPrimitive<int32_t, eDefault>(cx, args[9], &arg9)) {
5021
0
      return false;
5022
0
    }
5023
0
  } else {
5024
0
    arg9 = 0;
5025
0
  }
5026
0
  int32_t arg10;
5027
0
  if (args.hasDefined(10)) {
5028
0
    if (!ValueToPrimitive<int32_t, eDefault>(cx, args[10], &arg10)) {
5029
0
      return false;
5030
0
    }
5031
0
  } else {
5032
0
    arg10 = 0;
5033
0
  }
5034
0
  float arg11;
5035
0
  if (args.hasDefined(11)) {
5036
0
    if (!ValueToPrimitive<float, eDefault>(cx, args[11], &arg11)) {
5037
0
      return false;
5038
0
    } else if (!mozilla::IsFinite(arg11)) {
5039
0
      ThrowErrorMessage(cx, MSG_NOT_FINITE, "Argument 12 of Document.createTouch");
5040
0
      return false;
5041
0
    }
5042
0
  } else {
5043
0
    arg11 = 0.0F;
5044
0
  }
5045
0
  float arg12;
5046
0
  if (args.hasDefined(12)) {
5047
0
    if (!ValueToPrimitive<float, eDefault>(cx, args[12], &arg12)) {
5048
0
      return false;
5049
0
    } else if (!mozilla::IsFinite(arg12)) {
5050
0
      ThrowErrorMessage(cx, MSG_NOT_FINITE, "Argument 13 of Document.createTouch");
5051
0
      return false;
5052
0
    }
5053
0
  } else {
5054
0
    arg12 = 0.0F;
5055
0
  }
5056
0
  auto result(StrongOrRawPtr<mozilla::dom::Touch>(self->CreateTouch(MOZ_KnownLive(Constify(arg0)), MOZ_KnownLive(Constify(arg1)), arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12)));
5057
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5058
0
  static_assert(!IsPointer<decltype(result)>::value,
5059
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
5060
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
5061
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
5062
0
    return false;
5063
0
  }
5064
0
  return true;
5065
0
}
5066
5067
static const JSJitInfo createTouch_methodinfo = {
5068
  { (JSJitGetterOp)createTouch },
5069
  { prototypes::id::Document },
5070
  { PrototypeTraits<prototypes::id::Document>::Depth },
5071
  JSJitInfo::Method,
5072
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5073
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
5074
  false,  /* isInfallible. False in setters. */
5075
  false,  /* isMovable.  Not relevant for setters. */
5076
  false, /* isEliminatable.  Not relevant for setters. */
5077
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5078
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5079
  false,  /* isTypedMethod.  Only relevant for methods. */
5080
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5081
};
5082
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5083
static_assert(0 < 1, "There is no slot for us");
5084
5085
MOZ_CAN_RUN_SCRIPT static bool
5086
createTouchList(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
5087
0
{
5088
0
  AUTO_PROFILER_LABEL_FAST("Document.createTouchList", DOM, cx);
5089
0
5090
0
  unsigned argcount = std::min(args.length(), 2u);
5091
0
  switch (argcount) {
5092
0
    case 0: {
5093
0
      auto result(StrongOrRawPtr<mozilla::dom::TouchList>(self->CreateTouchList()));
5094
0
      MOZ_ASSERT(!JS_IsExceptionPending(cx));
5095
0
      static_assert(!IsPointer<decltype(result)>::value,
5096
0
                    "NewObject implies that we need to keep the object alive with a strong reference.");
5097
0
      if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
5098
0
        MOZ_ASSERT(JS_IsExceptionPending(cx));
5099
0
        return false;
5100
0
      }
5101
0
      return true;
5102
0
      break;
5103
0
    }
5104
0
    case 1: {
5105
0
      if (args[0].isObject()) {
5106
0
        do {
5107
0
          NonNull<mozilla::dom::Touch> arg0;
5108
0
          {
5109
0
            nsresult rv = UnwrapObject<prototypes::id::Touch, mozilla::dom::Touch>(args[0], arg0);
5110
0
            if (NS_FAILED(rv)) {
5111
0
              break;
5112
0
            }
5113
0
          }
5114
0
          AutoSequence<OwningNonNull<mozilla::dom::Touch>> arg1;
5115
0
          if (args.length() > 1) {
5116
0
            if (!arg1.SetCapacity(args.length() - 1, mozilla::fallible)) {
5117
0
              JS_ReportOutOfMemory(cx);
5118
0
              return false;
5119
0
            }
5120
0
            for (uint32_t variadicArg = 1; variadicArg < args.length(); ++variadicArg) {
5121
0
              OwningNonNull<mozilla::dom::Touch>& slot = *arg1.AppendElement(mozilla::fallible);
5122
0
              if (args[variadicArg].isObject()) {
5123
0
                static_assert(IsRefcounted<mozilla::dom::Touch>::value, "We can only store refcounted classes.");{
5124
0
                  nsresult rv = UnwrapObject<prototypes::id::Touch, mozilla::dom::Touch>(args[variadicArg], slot);
5125
0
                  if (NS_FAILED(rv)) {
5126
0
                    ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of Document.createTouchList", "Touch");
5127
0
                    return false;
5128
0
                  }
5129
0
                }
5130
0
              } else {
5131
0
                ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of Document.createTouchList");
5132
0
                return false;
5133
0
              }
5134
0
            }
5135
0
          }
5136
0
          auto result(StrongOrRawPtr<mozilla::dom::TouchList>(self->CreateTouchList(MOZ_KnownLive(NonNullHelper(arg0)), MOZ_KnownLive(NonNullHelper(Constify(arg1))))));
5137
0
          MOZ_ASSERT(!JS_IsExceptionPending(cx));
5138
0
          static_assert(!IsPointer<decltype(result)>::value,
5139
0
                        "NewObject implies that we need to keep the object alive with a strong reference.");
5140
0
          if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
5141
0
            MOZ_ASSERT(JS_IsExceptionPending(cx));
5142
0
            return false;
5143
0
          }
5144
0
          return true;
5145
0
        } while (false);
5146
0
        do {
5147
0
          binding_detail::AutoSequence<OwningNonNull<mozilla::dom::Touch>> arg0;
5148
0
          JS::ForOfIterator iter(cx);
5149
0
          if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
5150
0
            return false;
5151
0
          }
5152
0
          if (!iter.valueIsIterable()) {
5153
0
            break;
5154
0
          }
5155
0
          binding_detail::AutoSequence<OwningNonNull<mozilla::dom::Touch>> &arr = arg0;
5156
0
          JS::Rooted<JS::Value> temp(cx);
5157
0
          while (true) {
5158
0
            bool done;
5159
0
            if (!iter.next(&temp, &done)) {
5160
0
              return false;
5161
0
            }
5162
0
            if (done) {
5163
0
              break;
5164
0
            }
5165
0
            OwningNonNull<mozilla::dom::Touch>* slotPtr = arr.AppendElement(mozilla::fallible);
5166
0
            if (!slotPtr) {
5167
0
              JS_ReportOutOfMemory(cx);
5168
0
              return false;
5169
0
            }
5170
0
            OwningNonNull<mozilla::dom::Touch>& slot = *slotPtr;
5171
0
            if (temp.isObject()) {
5172
0
              static_assert(IsRefcounted<mozilla::dom::Touch>::value, "We can only store refcounted classes.");{
5173
0
                nsresult rv = UnwrapObject<prototypes::id::Touch, mozilla::dom::Touch>(&temp, slot);
5174
0
                if (NS_FAILED(rv)) {
5175
0
                  ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Element of argument 1 of Document.createTouchList", "Touch");
5176
0
                  return false;
5177
0
                }
5178
0
              }
5179
0
            } else {
5180
0
              ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Element of argument 1 of Document.createTouchList");
5181
0
              return false;
5182
0
            }
5183
0
          }
5184
0
          auto result(StrongOrRawPtr<mozilla::dom::TouchList>(self->CreateTouchList(Constify(arg0))));
5185
0
          MOZ_ASSERT(!JS_IsExceptionPending(cx));
5186
0
          static_assert(!IsPointer<decltype(result)>::value,
5187
0
                        "NewObject implies that we need to keep the object alive with a strong reference.");
5188
0
          if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
5189
0
            MOZ_ASSERT(JS_IsExceptionPending(cx));
5190
0
            return false;
5191
0
          }
5192
0
          return true;
5193
0
        } while (false);
5194
0
      }
5195
0
      return ThrowErrorMessage(cx, MSG_OVERLOAD_RESOLUTION_FAILED, "1", "1", "Document.createTouchList");
5196
0
      break;
5197
0
    }
5198
0
    case 2: {
5199
0
      NonNull<mozilla::dom::Touch> arg0;
5200
0
      if (args[0].isObject()) {
5201
0
        {
5202
0
          nsresult rv = UnwrapObject<prototypes::id::Touch, mozilla::dom::Touch>(args[0], arg0);
5203
0
          if (NS_FAILED(rv)) {
5204
0
            ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of Document.createTouchList", "Touch");
5205
0
            return false;
5206
0
          }
5207
0
        }
5208
0
      } else {
5209
0
        ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of Document.createTouchList");
5210
0
        return false;
5211
0
      }
5212
0
      AutoSequence<OwningNonNull<mozilla::dom::Touch>> arg1;
5213
0
      if (args.length() > 1) {
5214
0
        if (!arg1.SetCapacity(args.length() - 1, mozilla::fallible)) {
5215
0
          JS_ReportOutOfMemory(cx);
5216
0
          return false;
5217
0
        }
5218
0
        for (uint32_t variadicArg = 1; variadicArg < args.length(); ++variadicArg) {
5219
0
          OwningNonNull<mozilla::dom::Touch>& slot = *arg1.AppendElement(mozilla::fallible);
5220
0
          if (args[variadicArg].isObject()) {
5221
0
            static_assert(IsRefcounted<mozilla::dom::Touch>::value, "We can only store refcounted classes.");{
5222
0
              nsresult rv = UnwrapObject<prototypes::id::Touch, mozilla::dom::Touch>(args[variadicArg], slot);
5223
0
              if (NS_FAILED(rv)) {
5224
0
                ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of Document.createTouchList", "Touch");
5225
0
                return false;
5226
0
              }
5227
0
            }
5228
0
          } else {
5229
0
            ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of Document.createTouchList");
5230
0
            return false;
5231
0
          }
5232
0
        }
5233
0
      }
5234
0
      auto result(StrongOrRawPtr<mozilla::dom::TouchList>(self->CreateTouchList(MOZ_KnownLive(NonNullHelper(arg0)), MOZ_KnownLive(NonNullHelper(Constify(arg1))))));
5235
0
      MOZ_ASSERT(!JS_IsExceptionPending(cx));
5236
0
      static_assert(!IsPointer<decltype(result)>::value,
5237
0
                    "NewObject implies that we need to keep the object alive with a strong reference.");
5238
0
      if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
5239
0
        MOZ_ASSERT(JS_IsExceptionPending(cx));
5240
0
        return false;
5241
0
      }
5242
0
      return true;
5243
0
      break;
5244
0
    }
5245
0
    default: {
5246
0
      return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.createTouchList");
5247
0
      break;
5248
0
    }
5249
0
  }
5250
0
  MOZ_CRASH("We have an always-returning default case");
5251
0
  return false;
5252
0
}
5253
5254
static const JSJitInfo createTouchList_methodinfo = {
5255
  { (JSJitGetterOp)createTouchList },
5256
  { prototypes::id::Document },
5257
  { PrototypeTraits<prototypes::id::Document>::Depth },
5258
  JSJitInfo::Method,
5259
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5260
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
5261
  false,  /* isInfallible. False in setters. */
5262
  false,  /* isMovable.  Not relevant for setters. */
5263
  false, /* isEliminatable.  Not relevant for setters. */
5264
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5265
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5266
  false,  /* isTypedMethod.  Only relevant for methods. */
5267
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5268
};
5269
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5270
static_assert(0 < 1, "There is no slot for us");
5271
5272
MOZ_CAN_RUN_SCRIPT static bool
5273
get_styleSheetChangeEventsEnabled(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
5274
0
{
5275
0
  AUTO_PROFILER_LABEL_FAST("get Document.styleSheetChangeEventsEnabled", DOM, cx);
5276
0
5277
0
  bool result(self->StyleSheetChangeEventsEnabled());
5278
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5279
0
  args.rval().setBoolean(result);
5280
0
  return true;
5281
0
}
5282
5283
MOZ_CAN_RUN_SCRIPT static bool
5284
set_styleSheetChangeEventsEnabled(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
5285
0
{
5286
0
  AUTO_PROFILER_LABEL_FAST("set Document.styleSheetChangeEventsEnabled", DOM, cx);
5287
0
5288
0
  bool arg0;
5289
0
  if (!ValueToPrimitive<bool, eDefault>(cx, args[0], &arg0)) {
5290
0
    return false;
5291
0
  }
5292
0
  self->SetStyleSheetChangeEventsEnabled(arg0);
5293
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5294
0
5295
0
  return true;
5296
0
}
5297
5298
static const JSJitInfo styleSheetChangeEventsEnabled_getterinfo = {
5299
  { (JSJitGetterOp)get_styleSheetChangeEventsEnabled },
5300
  { prototypes::id::Document },
5301
  { PrototypeTraits<prototypes::id::Document>::Depth },
5302
  JSJitInfo::Getter,
5303
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5304
  JSVAL_TYPE_BOOLEAN,  /* returnType.  Not relevant for setters. */
5305
  true,  /* isInfallible. False in setters. */
5306
  false,  /* isMovable.  Not relevant for setters. */
5307
  false, /* isEliminatable.  Not relevant for setters. */
5308
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5309
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5310
  false,  /* isTypedMethod.  Only relevant for methods. */
5311
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5312
};
5313
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5314
static_assert(0 < 1, "There is no slot for us");
5315
static const JSJitInfo styleSheetChangeEventsEnabled_setterinfo = {
5316
  { (JSJitGetterOp)set_styleSheetChangeEventsEnabled },
5317
  { prototypes::id::Document },
5318
  { PrototypeTraits<prototypes::id::Document>::Depth },
5319
  JSJitInfo::Setter,
5320
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5321
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
5322
  false,  /* isInfallible. False in setters. */
5323
  false,  /* isMovable.  Not relevant for setters. */
5324
  false, /* isEliminatable.  Not relevant for setters. */
5325
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5326
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5327
  false,  /* isTypedMethod.  Only relevant for methods. */
5328
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5329
};
5330
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5331
static_assert(0 < 1, "There is no slot for us");
5332
5333
MOZ_CAN_RUN_SCRIPT static bool
5334
get_contentLanguage(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
5335
0
{
5336
0
  AUTO_PROFILER_LABEL_FAST("get Document.contentLanguage", DOM, cx);
5337
0
5338
0
  DOMString result;
5339
0
  self->GetContentLanguage(result);
5340
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5341
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
5342
0
    return false;
5343
0
  }
5344
0
  return true;
5345
0
}
5346
5347
static const JSJitInfo contentLanguage_getterinfo = {
5348
  { (JSJitGetterOp)get_contentLanguage },
5349
  { prototypes::id::Document },
5350
  { PrototypeTraits<prototypes::id::Document>::Depth },
5351
  JSJitInfo::Getter,
5352
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5353
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
5354
  false,  /* isInfallible. False in setters. */
5355
  false,  /* isMovable.  Not relevant for setters. */
5356
  false, /* isEliminatable.  Not relevant for setters. */
5357
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5358
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5359
  false,  /* isTypedMethod.  Only relevant for methods. */
5360
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5361
};
5362
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5363
static_assert(0 < 1, "There is no slot for us");
5364
5365
MOZ_CAN_RUN_SCRIPT static bool
5366
get_documentLoadGroup(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
5367
0
{
5368
0
  AUTO_PROFILER_LABEL_FAST("get Document.documentLoadGroup", DOM, cx);
5369
0
5370
0
  auto result(StrongOrRawPtr<nsILoadGroup>(self->GetDocumentLoadGroup()));
5371
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5372
0
  if (!result) {
5373
0
    args.rval().setNull();
5374
0
    return true;
5375
0
  }
5376
0
  if (!WrapObject(cx, result, &NS_GET_IID(nsILoadGroup), args.rval())) {
5377
0
    return false;
5378
0
  }
5379
0
  return true;
5380
0
}
5381
5382
static const JSJitInfo documentLoadGroup_getterinfo = {
5383
  { (JSJitGetterOp)get_documentLoadGroup },
5384
  { prototypes::id::Document },
5385
  { PrototypeTraits<prototypes::id::Document>::Depth },
5386
  JSJitInfo::Getter,
5387
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5388
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
5389
  false,  /* isInfallible. False in setters. */
5390
  false,  /* isMovable.  Not relevant for setters. */
5391
  false, /* isEliminatable.  Not relevant for setters. */
5392
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5393
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5394
  false,  /* isTypedMethod.  Only relevant for methods. */
5395
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5396
};
5397
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5398
static_assert(0 < 1, "There is no slot for us");
5399
5400
MOZ_CAN_RUN_SCRIPT static bool
5401
blockParsing(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
5402
0
{
5403
0
  AUTO_PROFILER_LABEL_FAST("Document.blockParsing", DOM, cx);
5404
0
5405
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
5406
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.blockParsing");
5407
0
  }
5408
0
  OwningNonNull<Promise> arg0;
5409
0
  { // Scope for our GlobalObject, FastErrorResult, JSAutoRealm,
5410
0
    // etc.
5411
0
5412
0
    JS::Rooted<JSObject*> globalObj(cx);
5413
0
    globalObj = JS::CurrentGlobalOrNull(cx);
5414
0
    JSAutoRealm ar(cx, globalObj);
5415
0
    GlobalObject promiseGlobal(cx, globalObj);
5416
0
    if (promiseGlobal.Failed()) {
5417
0
      return false;
5418
0
    }
5419
0
5420
0
    JS::Rooted<JS::Value> valueToResolve(cx, args[0]);
5421
0
    if (!JS_WrapValue(cx, &valueToResolve)) {
5422
0
      return false;
5423
0
    }
5424
0
    binding_detail::FastErrorResult promiseRv;
5425
0
    nsCOMPtr<nsIGlobalObject> global =
5426
0
      do_QueryInterface(promiseGlobal.GetAsSupports());
5427
0
    if (!global) {
5428
0
      promiseRv.ThrowWithCustomCleanup(NS_ERROR_UNEXPECTED);
5429
0
      MOZ_ALWAYS_TRUE(promiseRv.MaybeSetPendingException(cx));
5430
0
      return false;
5431
0
    }
5432
0
    arg0 = Promise::Resolve(global, cx, valueToResolve,
5433
0
                                    promiseRv);
5434
0
    if (promiseRv.MaybeSetPendingException(cx)) {
5435
0
      return false;
5436
0
    }
5437
0
  }
5438
0
  binding_detail::FastBlockParsingOptions arg1;
5439
0
  if (!arg1.Init(cx, (args.hasDefined(1)) ? args[1] : JS::NullHandleValue,  "Argument 2 of Document.blockParsing", false)) {
5440
0
    return false;
5441
0
  }
5442
0
  FastErrorResult rv;
5443
0
  auto result(StrongOrRawPtr<Promise>(self->BlockParsing(NonNullHelper(arg0), Constify(arg1), rv)));
5444
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
5445
0
    return false;
5446
0
  }
5447
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5448
0
  if (!ToJSValue(cx, result, args.rval())) {
5449
0
    return false;
5450
0
  }
5451
0
  return true;
5452
0
}
5453
5454
MOZ_CAN_RUN_SCRIPT static bool
5455
blockParsing_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
5456
0
{
5457
0
  bool ok = blockParsing(cx, obj, self, args);
5458
0
  if (ok) {
5459
0
    return true;
5460
0
  }
5461
0
  return ConvertExceptionToPromise(cx, args.rval());
5462
0
}
5463
5464
static const JSJitInfo blockParsing_methodinfo = {
5465
  { (JSJitGetterOp)blockParsing_promiseWrapper },
5466
  { prototypes::id::Document },
5467
  { PrototypeTraits<prototypes::id::Document>::Depth },
5468
  JSJitInfo::Method,
5469
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5470
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
5471
  false,  /* isInfallible. False in setters. */
5472
  false,  /* isMovable.  Not relevant for setters. */
5473
  false, /* isEliminatable.  Not relevant for setters. */
5474
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5475
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5476
  false,  /* isTypedMethod.  Only relevant for methods. */
5477
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5478
};
5479
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5480
static_assert(0 < 1, "There is no slot for us");
5481
5482
MOZ_CAN_RUN_SCRIPT static bool
5483
get_mozDocumentURIIfNotForErrorPages(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
5484
0
{
5485
0
  AUTO_PROFILER_LABEL_FAST("get Document.mozDocumentURIIfNotForErrorPages", DOM, cx);
5486
0
5487
0
  auto result(StrongOrRawPtr<nsIURI>(self->GetMozDocumentURIIfNotForErrorPages()));
5488
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5489
0
  if (!result) {
5490
0
    args.rval().setNull();
5491
0
    return true;
5492
0
  }
5493
0
  if (!WrapObject(cx, result, &NS_GET_IID(nsIURI), args.rval())) {
5494
0
    return false;
5495
0
  }
5496
0
  return true;
5497
0
}
5498
5499
static const JSJitInfo mozDocumentURIIfNotForErrorPages_getterinfo = {
5500
  { (JSJitGetterOp)get_mozDocumentURIIfNotForErrorPages },
5501
  { prototypes::id::Document },
5502
  { PrototypeTraits<prototypes::id::Document>::Depth },
5503
  JSJitInfo::Getter,
5504
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5505
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
5506
  false,  /* isInfallible. False in setters. */
5507
  false,  /* isMovable.  Not relevant for setters. */
5508
  false, /* isEliminatable.  Not relevant for setters. */
5509
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5510
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5511
  false,  /* isTypedMethod.  Only relevant for methods. */
5512
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5513
};
5514
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5515
static_assert(0 < 1, "There is no slot for us");
5516
5517
MOZ_CAN_RUN_SCRIPT static bool
5518
get_documentReadyForIdle(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
5519
0
{
5520
0
  AUTO_PROFILER_LABEL_FAST("get Document.documentReadyForIdle", DOM, cx);
5521
0
5522
0
  FastErrorResult rv;
5523
0
  auto result(StrongOrRawPtr<Promise>(self->GetDocumentReadyForIdle(rv)));
5524
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
5525
0
    return false;
5526
0
  }
5527
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5528
0
  if (!ToJSValue(cx, result, args.rval())) {
5529
0
    return false;
5530
0
  }
5531
0
  return true;
5532
0
}
5533
5534
MOZ_CAN_RUN_SCRIPT static bool
5535
get_documentReadyForIdle_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
5536
0
{
5537
0
  bool ok = get_documentReadyForIdle(cx, obj, self, args);
5538
0
  if (ok) {
5539
0
    return true;
5540
0
  }
5541
0
  return ConvertExceptionToPromise(cx, args.rval());
5542
0
}
5543
5544
static const JSJitInfo documentReadyForIdle_getterinfo = {
5545
  { (JSJitGetterOp)get_documentReadyForIdle_promiseWrapper },
5546
  { prototypes::id::Document },
5547
  { PrototypeTraits<prototypes::id::Document>::Depth },
5548
  JSJitInfo::Getter,
5549
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5550
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
5551
  false,  /* isInfallible. False in setters. */
5552
  false,  /* isMovable.  Not relevant for setters. */
5553
  false, /* isEliminatable.  Not relevant for setters. */
5554
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5555
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5556
  false,  /* isTypedMethod.  Only relevant for methods. */
5557
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5558
};
5559
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5560
static_assert(0 < 1, "There is no slot for us");
5561
5562
MOZ_CAN_RUN_SCRIPT static bool
5563
get_commandDispatcher(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
5564
0
{
5565
0
  AUTO_PROFILER_LABEL_FAST("get Document.commandDispatcher", DOM, cx);
5566
0
5567
0
  auto result(StrongOrRawPtr<nsIDOMXULCommandDispatcher>(self->GetCommandDispatcher()));
5568
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5569
0
  if (!result) {
5570
0
    args.rval().setNull();
5571
0
    return true;
5572
0
  }
5573
0
  if (!WrapObject(cx, result, &NS_GET_IID(nsIDOMXULCommandDispatcher), args.rval())) {
5574
0
    return false;
5575
0
  }
5576
0
  return true;
5577
0
}
5578
5579
static const JSJitInfo commandDispatcher_getterinfo = {
5580
  { (JSJitGetterOp)get_commandDispatcher },
5581
  { prototypes::id::Document },
5582
  { PrototypeTraits<prototypes::id::Document>::Depth },
5583
  JSJitInfo::Getter,
5584
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5585
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
5586
  false,  /* isInfallible. False in setters. */
5587
  false,  /* isMovable.  Not relevant for setters. */
5588
  false, /* isEliminatable.  Not relevant for setters. */
5589
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5590
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5591
  false,  /* isTypedMethod.  Only relevant for methods. */
5592
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5593
};
5594
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5595
static_assert(0 < 1, "There is no slot for us");
5596
5597
MOZ_CAN_RUN_SCRIPT static bool
5598
get_popupNode(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
5599
0
{
5600
0
  AUTO_PROFILER_LABEL_FAST("get Document.popupNode", DOM, cx);
5601
0
5602
0
  auto result(StrongOrRawPtr<nsINode>(self->GetPopupNode()));
5603
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5604
0
  if (!result) {
5605
0
    args.rval().setNull();
5606
0
    return true;
5607
0
  }
5608
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
5609
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
5610
0
    return false;
5611
0
  }
5612
0
  return true;
5613
0
}
5614
5615
MOZ_CAN_RUN_SCRIPT static bool
5616
set_popupNode(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
5617
0
{
5618
0
  AUTO_PROFILER_LABEL_FAST("set Document.popupNode", DOM, cx);
5619
0
5620
0
  nsINode* arg0;
5621
0
  if (args[0].isObject()) {
5622
0
    {
5623
0
      nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(args[0], arg0);
5624
0
      if (NS_FAILED(rv)) {
5625
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Value being assigned to Document.popupNode", "Node");
5626
0
        return false;
5627
0
      }
5628
0
    }
5629
0
  } else if (args[0].isNullOrUndefined()) {
5630
0
    arg0 = nullptr;
5631
0
  } else {
5632
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Value being assigned to Document.popupNode");
5633
0
    return false;
5634
0
  }
5635
0
  self->SetPopupNode(MOZ_KnownLive(Constify(arg0)));
5636
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5637
0
5638
0
  return true;
5639
0
}
5640
5641
static const JSJitInfo popupNode_getterinfo = {
5642
  { (JSJitGetterOp)get_popupNode },
5643
  { prototypes::id::Document },
5644
  { PrototypeTraits<prototypes::id::Document>::Depth },
5645
  JSJitInfo::Getter,
5646
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5647
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
5648
  false,  /* isInfallible. False in setters. */
5649
  false,  /* isMovable.  Not relevant for setters. */
5650
  false, /* isEliminatable.  Not relevant for setters. */
5651
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5652
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5653
  false,  /* isTypedMethod.  Only relevant for methods. */
5654
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5655
};
5656
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5657
static_assert(0 < 1, "There is no slot for us");
5658
static const JSJitInfo popupNode_setterinfo = {
5659
  { (JSJitGetterOp)set_popupNode },
5660
  { prototypes::id::Document },
5661
  { PrototypeTraits<prototypes::id::Document>::Depth },
5662
  JSJitInfo::Setter,
5663
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5664
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
5665
  false,  /* isInfallible. False in setters. */
5666
  false,  /* isMovable.  Not relevant for setters. */
5667
  false, /* isEliminatable.  Not relevant for setters. */
5668
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5669
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5670
  false,  /* isTypedMethod.  Only relevant for methods. */
5671
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5672
};
5673
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5674
static_assert(0 < 1, "There is no slot for us");
5675
5676
MOZ_CAN_RUN_SCRIPT static bool
5677
get_popupRangeParent(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
5678
0
{
5679
0
  AUTO_PROFILER_LABEL_FAST("get Document.popupRangeParent", DOM, cx);
5680
0
5681
0
  FastErrorResult rv;
5682
0
  auto result(StrongOrRawPtr<nsINode>(self->GetPopupRangeParent(rv)));
5683
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
5684
0
    return false;
5685
0
  }
5686
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5687
0
  if (!result) {
5688
0
    args.rval().setNull();
5689
0
    return true;
5690
0
  }
5691
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
5692
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
5693
0
    return false;
5694
0
  }
5695
0
  return true;
5696
0
}
5697
5698
static const JSJitInfo popupRangeParent_getterinfo = {
5699
  { (JSJitGetterOp)get_popupRangeParent },
5700
  { prototypes::id::Document },
5701
  { PrototypeTraits<prototypes::id::Document>::Depth },
5702
  JSJitInfo::Getter,
5703
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5704
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
5705
  false,  /* isInfallible. False in setters. */
5706
  false,  /* isMovable.  Not relevant for setters. */
5707
  false, /* isEliminatable.  Not relevant for setters. */
5708
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5709
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5710
  false,  /* isTypedMethod.  Only relevant for methods. */
5711
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5712
};
5713
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5714
static_assert(0 < 1, "There is no slot for us");
5715
5716
MOZ_CAN_RUN_SCRIPT static bool
5717
get_popupRangeOffset(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
5718
0
{
5719
0
  AUTO_PROFILER_LABEL_FAST("get Document.popupRangeOffset", DOM, cx);
5720
0
5721
0
  FastErrorResult rv;
5722
0
  int32_t result(self->GetPopupRangeOffset(rv));
5723
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
5724
0
    return false;
5725
0
  }
5726
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5727
0
  args.rval().setInt32(int32_t(result));
5728
0
  return true;
5729
0
}
5730
5731
static const JSJitInfo popupRangeOffset_getterinfo = {
5732
  { (JSJitGetterOp)get_popupRangeOffset },
5733
  { prototypes::id::Document },
5734
  { PrototypeTraits<prototypes::id::Document>::Depth },
5735
  JSJitInfo::Getter,
5736
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5737
  JSVAL_TYPE_INT32,  /* returnType.  Not relevant for setters. */
5738
  false,  /* isInfallible. False in setters. */
5739
  false,  /* isMovable.  Not relevant for setters. */
5740
  false, /* isEliminatable.  Not relevant for setters. */
5741
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5742
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5743
  false,  /* isTypedMethod.  Only relevant for methods. */
5744
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5745
};
5746
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5747
static_assert(0 < 1, "There is no slot for us");
5748
5749
MOZ_CAN_RUN_SCRIPT static bool
5750
get_tooltipNode(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
5751
0
{
5752
0
  AUTO_PROFILER_LABEL_FAST("get Document.tooltipNode", DOM, cx);
5753
0
5754
0
  auto result(StrongOrRawPtr<nsINode>(self->GetTooltipNode()));
5755
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5756
0
  if (!result) {
5757
0
    args.rval().setNull();
5758
0
    return true;
5759
0
  }
5760
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
5761
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
5762
0
    return false;
5763
0
  }
5764
0
  return true;
5765
0
}
5766
5767
MOZ_CAN_RUN_SCRIPT static bool
5768
set_tooltipNode(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
5769
0
{
5770
0
  AUTO_PROFILER_LABEL_FAST("set Document.tooltipNode", DOM, cx);
5771
0
5772
0
  nsINode* arg0;
5773
0
  if (args[0].isObject()) {
5774
0
    {
5775
0
      nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(args[0], arg0);
5776
0
      if (NS_FAILED(rv)) {
5777
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Value being assigned to Document.tooltipNode", "Node");
5778
0
        return false;
5779
0
      }
5780
0
    }
5781
0
  } else if (args[0].isNullOrUndefined()) {
5782
0
    arg0 = nullptr;
5783
0
  } else {
5784
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Value being assigned to Document.tooltipNode");
5785
0
    return false;
5786
0
  }
5787
0
  self->SetTooltipNode(MOZ_KnownLive(Constify(arg0)));
5788
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5789
0
5790
0
  return true;
5791
0
}
5792
5793
static const JSJitInfo tooltipNode_getterinfo = {
5794
  { (JSJitGetterOp)get_tooltipNode },
5795
  { prototypes::id::Document },
5796
  { PrototypeTraits<prototypes::id::Document>::Depth },
5797
  JSJitInfo::Getter,
5798
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5799
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
5800
  false,  /* isInfallible. False in setters. */
5801
  false,  /* isMovable.  Not relevant for setters. */
5802
  false, /* isEliminatable.  Not relevant for setters. */
5803
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5804
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5805
  false,  /* isTypedMethod.  Only relevant for methods. */
5806
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5807
};
5808
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5809
static_assert(0 < 1, "There is no slot for us");
5810
static const JSJitInfo tooltipNode_setterinfo = {
5811
  { (JSJitGetterOp)set_tooltipNode },
5812
  { prototypes::id::Document },
5813
  { PrototypeTraits<prototypes::id::Document>::Depth },
5814
  JSJitInfo::Setter,
5815
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5816
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
5817
  false,  /* isInfallible. False in setters. */
5818
  false,  /* isMovable.  Not relevant for setters. */
5819
  false, /* isEliminatable.  Not relevant for setters. */
5820
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5821
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5822
  false,  /* isTypedMethod.  Only relevant for methods. */
5823
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5824
};
5825
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5826
static_assert(0 < 1, "There is no slot for us");
5827
5828
MOZ_CAN_RUN_SCRIPT static bool
5829
get_isSrcdocDocument(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
5830
0
{
5831
0
  AUTO_PROFILER_LABEL_FAST("get Document.isSrcdocDocument", DOM, cx);
5832
0
5833
0
  bool result(self->IsSrcdocDocument());
5834
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5835
0
  args.rval().setBoolean(result);
5836
0
  return true;
5837
0
}
5838
5839
static const JSJitInfo isSrcdocDocument_getterinfo = {
5840
  { (JSJitGetterOp)get_isSrcdocDocument },
5841
  { prototypes::id::Document },
5842
  { PrototypeTraits<prototypes::id::Document>::Depth },
5843
  JSJitInfo::Getter,
5844
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5845
  JSVAL_TYPE_BOOLEAN,  /* returnType.  Not relevant for setters. */
5846
  true,  /* isInfallible. False in setters. */
5847
  false,  /* isMovable.  Not relevant for setters. */
5848
  false, /* isEliminatable.  Not relevant for setters. */
5849
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5850
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5851
  false,  /* isTypedMethod.  Only relevant for methods. */
5852
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5853
};
5854
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5855
static_assert(0 < 1, "There is no slot for us");
5856
5857
MOZ_CAN_RUN_SCRIPT static bool
5858
get_sandboxFlagsAsString(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
5859
0
{
5860
0
  AUTO_PROFILER_LABEL_FAST("get Document.sandboxFlagsAsString", DOM, cx);
5861
0
5862
0
  DOMString result;
5863
0
  self->GetSandboxFlagsAsString(result);
5864
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5865
0
  if (!xpc::StringToJsval(cx, result, args.rval())) {
5866
0
    return false;
5867
0
  }
5868
0
  return true;
5869
0
}
5870
5871
static const JSJitInfo sandboxFlagsAsString_getterinfo = {
5872
  { (JSJitGetterOp)get_sandboxFlagsAsString },
5873
  { prototypes::id::Document },
5874
  { PrototypeTraits<prototypes::id::Document>::Depth },
5875
  JSJitInfo::Getter,
5876
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5877
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
5878
  false,  /* isInfallible. False in setters. */
5879
  false,  /* isMovable.  Not relevant for setters. */
5880
  false, /* isEliminatable.  Not relevant for setters. */
5881
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5882
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5883
  false,  /* isTypedMethod.  Only relevant for methods. */
5884
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5885
};
5886
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5887
static_assert(0 < 1, "There is no slot for us");
5888
5889
MOZ_CAN_RUN_SCRIPT static bool
5890
insertAnonymousContent(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
5891
0
{
5892
0
  AUTO_PROFILER_LABEL_FAST("Document.insertAnonymousContent", DOM, cx);
5893
0
5894
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
5895
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.insertAnonymousContent");
5896
0
  }
5897
0
  NonNull<mozilla::dom::Element> arg0;
5898
0
  if (args[0].isObject()) {
5899
0
    {
5900
0
      nsresult rv = UnwrapObject<prototypes::id::Element, mozilla::dom::Element>(args[0], arg0);
5901
0
      if (NS_FAILED(rv)) {
5902
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of Document.insertAnonymousContent", "Element");
5903
0
        return false;
5904
0
      }
5905
0
    }
5906
0
  } else {
5907
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of Document.insertAnonymousContent");
5908
0
    return false;
5909
0
  }
5910
0
  FastErrorResult rv;
5911
0
  auto result(StrongOrRawPtr<mozilla::dom::AnonymousContent>(self->InsertAnonymousContent(MOZ_KnownLive(NonNullHelper(arg0)), rv)));
5912
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
5913
0
    return false;
5914
0
  }
5915
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5916
0
  static_assert(!IsPointer<decltype(result)>::value,
5917
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
5918
0
  if (!WrapNewBindingNonWrapperCachedObject(cx, obj, result, args.rval())) {
5919
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
5920
0
    return false;
5921
0
  }
5922
0
  return true;
5923
0
}
5924
5925
static const JSJitInfo insertAnonymousContent_methodinfo = {
5926
  { (JSJitGetterOp)insertAnonymousContent },
5927
  { prototypes::id::Document },
5928
  { PrototypeTraits<prototypes::id::Document>::Depth },
5929
  JSJitInfo::Method,
5930
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5931
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
5932
  false,  /* isInfallible. False in setters. */
5933
  false,  /* isMovable.  Not relevant for setters. */
5934
  false, /* isEliminatable.  Not relevant for setters. */
5935
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5936
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5937
  false,  /* isTypedMethod.  Only relevant for methods. */
5938
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5939
};
5940
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5941
static_assert(0 < 1, "There is no slot for us");
5942
5943
MOZ_CAN_RUN_SCRIPT static bool
5944
removeAnonymousContent(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
5945
0
{
5946
0
  AUTO_PROFILER_LABEL_FAST("Document.removeAnonymousContent", DOM, cx);
5947
0
5948
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
5949
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.removeAnonymousContent");
5950
0
  }
5951
0
  NonNull<mozilla::dom::AnonymousContent> arg0;
5952
0
  if (args[0].isObject()) {
5953
0
    {
5954
0
      nsresult rv = UnwrapObject<prototypes::id::AnonymousContent, mozilla::dom::AnonymousContent>(args[0], arg0);
5955
0
      if (NS_FAILED(rv)) {
5956
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of Document.removeAnonymousContent", "AnonymousContent");
5957
0
        return false;
5958
0
      }
5959
0
    }
5960
0
  } else {
5961
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of Document.removeAnonymousContent");
5962
0
    return false;
5963
0
  }
5964
0
  FastErrorResult rv;
5965
0
  self->RemoveAnonymousContent(MOZ_KnownLive(NonNullHelper(arg0)), rv);
5966
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
5967
0
    return false;
5968
0
  }
5969
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
5970
0
  args.rval().setUndefined();
5971
0
  return true;
5972
0
}
5973
5974
static const JSJitInfo removeAnonymousContent_methodinfo = {
5975
  { (JSJitGetterOp)removeAnonymousContent },
5976
  { prototypes::id::Document },
5977
  { PrototypeTraits<prototypes::id::Document>::Depth },
5978
  JSJitInfo::Method,
5979
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
5980
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
5981
  false,  /* isInfallible. False in setters. */
5982
  false,  /* isMovable.  Not relevant for setters. */
5983
  false, /* isEliminatable.  Not relevant for setters. */
5984
  false, /* isAlwaysInSlot.  Only relevant for getters. */
5985
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
5986
  false,  /* isTypedMethod.  Only relevant for methods. */
5987
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
5988
};
5989
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
5990
static_assert(0 < 1, "There is no slot for us");
5991
5992
MOZ_CAN_RUN_SCRIPT static bool
5993
getSelection(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
5994
0
{
5995
0
  AUTO_PROFILER_LABEL_FAST("Document.getSelection", DOM, cx);
5996
0
5997
0
  FastErrorResult rv;
5998
0
  auto result(StrongOrRawPtr<mozilla::dom::Selection>(self->GetSelection(rv)));
5999
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
6000
0
    return false;
6001
0
  }
6002
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6003
0
  if (!result) {
6004
0
    args.rval().setNull();
6005
0
    return true;
6006
0
  }
6007
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6008
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
6009
0
    return false;
6010
0
  }
6011
0
  return true;
6012
0
}
6013
6014
static const JSJitInfo getSelection_methodinfo = {
6015
  { (JSJitGetterOp)getSelection },
6016
  { prototypes::id::Document },
6017
  { PrototypeTraits<prototypes::id::Document>::Depth },
6018
  JSJitInfo::Method,
6019
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6020
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
6021
  false,  /* isInfallible. False in setters. */
6022
  false,  /* isMovable.  Not relevant for setters. */
6023
  false, /* isEliminatable.  Not relevant for setters. */
6024
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6025
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6026
  false,  /* isTypedMethod.  Only relevant for methods. */
6027
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6028
};
6029
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6030
static_assert(0 < 1, "There is no slot for us");
6031
6032
MOZ_CAN_RUN_SCRIPT static bool
6033
hasStorageAccess(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
6034
0
{
6035
0
  AUTO_PROFILER_LABEL_FAST("Document.hasStorageAccess", DOM, cx);
6036
0
6037
0
  FastErrorResult rv;
6038
0
  auto result(StrongOrRawPtr<Promise>(self->HasStorageAccess(rv)));
6039
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
6040
0
    return false;
6041
0
  }
6042
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6043
0
  if (!ToJSValue(cx, result, args.rval())) {
6044
0
    return false;
6045
0
  }
6046
0
  return true;
6047
0
}
6048
6049
MOZ_CAN_RUN_SCRIPT static bool
6050
hasStorageAccess_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
6051
0
{
6052
0
  bool ok = hasStorageAccess(cx, obj, self, args);
6053
0
  if (ok) {
6054
0
    return true;
6055
0
  }
6056
0
  return ConvertExceptionToPromise(cx, args.rval());
6057
0
}
6058
6059
static const JSJitInfo hasStorageAccess_methodinfo = {
6060
  { (JSJitGetterOp)hasStorageAccess_promiseWrapper },
6061
  { prototypes::id::Document },
6062
  { PrototypeTraits<prototypes::id::Document>::Depth },
6063
  JSJitInfo::Method,
6064
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6065
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
6066
  false,  /* isInfallible. False in setters. */
6067
  false,  /* isMovable.  Not relevant for setters. */
6068
  false, /* isEliminatable.  Not relevant for setters. */
6069
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6070
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6071
  false,  /* isTypedMethod.  Only relevant for methods. */
6072
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6073
};
6074
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6075
static_assert(0 < 1, "There is no slot for us");
6076
6077
MOZ_CAN_RUN_SCRIPT static bool
6078
requestStorageAccess(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
6079
0
{
6080
0
  AUTO_PROFILER_LABEL_FAST("Document.requestStorageAccess", DOM, cx);
6081
0
6082
0
  FastErrorResult rv;
6083
0
  auto result(StrongOrRawPtr<Promise>(self->RequestStorageAccess(rv)));
6084
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
6085
0
    return false;
6086
0
  }
6087
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6088
0
  if (!ToJSValue(cx, result, args.rval())) {
6089
0
    return false;
6090
0
  }
6091
0
  return true;
6092
0
}
6093
6094
MOZ_CAN_RUN_SCRIPT static bool
6095
requestStorageAccess_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
6096
0
{
6097
0
  bool ok = requestStorageAccess(cx, obj, self, args);
6098
0
  if (ok) {
6099
0
    return true;
6100
0
  }
6101
0
  return ConvertExceptionToPromise(cx, args.rval());
6102
0
}
6103
6104
static const JSJitInfo requestStorageAccess_methodinfo = {
6105
  { (JSJitGetterOp)requestStorageAccess_promiseWrapper },
6106
  { prototypes::id::Document },
6107
  { PrototypeTraits<prototypes::id::Document>::Depth },
6108
  JSJitInfo::Method,
6109
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6110
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
6111
  false,  /* isInfallible. False in setters. */
6112
  false,  /* isMovable.  Not relevant for setters. */
6113
  false, /* isEliminatable.  Not relevant for setters. */
6114
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6115
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6116
  false,  /* isTypedMethod.  Only relevant for methods. */
6117
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6118
};
6119
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6120
static_assert(0 < 1, "There is no slot for us");
6121
6122
MOZ_CAN_RUN_SCRIPT static bool
6123
get_userHasInteracted(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
6124
0
{
6125
0
  AUTO_PROFILER_LABEL_FAST("get Document.userHasInteracted", DOM, cx);
6126
0
6127
0
  bool result(self->UserHasInteracted());
6128
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6129
0
  args.rval().setBoolean(result);
6130
0
  return true;
6131
0
}
6132
6133
static const JSJitInfo userHasInteracted_getterinfo = {
6134
  { (JSJitGetterOp)get_userHasInteracted },
6135
  { prototypes::id::Document },
6136
  { PrototypeTraits<prototypes::id::Document>::Depth },
6137
  JSJitInfo::Getter,
6138
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6139
  JSVAL_TYPE_BOOLEAN,  /* returnType.  Not relevant for setters. */
6140
  true,  /* isInfallible. False in setters. */
6141
  false,  /* isMovable.  Not relevant for setters. */
6142
  false, /* isEliminatable.  Not relevant for setters. */
6143
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6144
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6145
  false,  /* isTypedMethod.  Only relevant for methods. */
6146
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6147
};
6148
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6149
static_assert(0 < 1, "There is no slot for us");
6150
6151
MOZ_CAN_RUN_SCRIPT static bool
6152
notifyUserGestureActivation(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
6153
0
{
6154
0
  AUTO_PROFILER_LABEL_FAST("Document.notifyUserGestureActivation", DOM, cx);
6155
0
6156
0
  self->NotifyUserGestureActivation();
6157
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6158
0
  args.rval().setUndefined();
6159
0
  return true;
6160
0
}
6161
6162
static const JSJitInfo notifyUserGestureActivation_methodinfo = {
6163
  { (JSJitGetterOp)notifyUserGestureActivation },
6164
  { prototypes::id::Document },
6165
  { PrototypeTraits<prototypes::id::Document>::Depth },
6166
  JSJitInfo::Method,
6167
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6168
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
6169
  true,  /* isInfallible. False in setters. */
6170
  false,  /* isMovable.  Not relevant for setters. */
6171
  false, /* isEliminatable.  Not relevant for setters. */
6172
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6173
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6174
  false,  /* isTypedMethod.  Only relevant for methods. */
6175
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6176
};
6177
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6178
static_assert(0 < 1, "There is no slot for us");
6179
6180
MOZ_CAN_RUN_SCRIPT static bool
6181
get_hasScriptsBlockedBySandbox(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
6182
0
{
6183
0
  AUTO_PROFILER_LABEL_FAST("get Document.hasScriptsBlockedBySandbox", DOM, cx);
6184
0
6185
0
  bool result(self->HasScriptsBlockedBySandbox());
6186
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6187
0
  args.rval().setBoolean(result);
6188
0
  return true;
6189
0
}
6190
6191
static const JSJitInfo hasScriptsBlockedBySandbox_getterinfo = {
6192
  { (JSJitGetterOp)get_hasScriptsBlockedBySandbox },
6193
  { prototypes::id::Document },
6194
  { PrototypeTraits<prototypes::id::Document>::Depth },
6195
  JSJitInfo::Getter,
6196
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6197
  JSVAL_TYPE_BOOLEAN,  /* returnType.  Not relevant for setters. */
6198
  true,  /* isInfallible. False in setters. */
6199
  false,  /* isMovable.  Not relevant for setters. */
6200
  false, /* isEliminatable.  Not relevant for setters. */
6201
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6202
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6203
  false,  /* isTypedMethod.  Only relevant for methods. */
6204
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6205
};
6206
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6207
static_assert(0 < 1, "There is no slot for us");
6208
6209
MOZ_CAN_RUN_SCRIPT static bool
6210
get_inlineScriptAllowedByCSP(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
6211
0
{
6212
0
  AUTO_PROFILER_LABEL_FAST("get Document.inlineScriptAllowedByCSP", DOM, cx);
6213
0
6214
0
  bool result(self->InlineScriptAllowedByCSP());
6215
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6216
0
  args.rval().setBoolean(result);
6217
0
  return true;
6218
0
}
6219
6220
static const JSJitInfo inlineScriptAllowedByCSP_getterinfo = {
6221
  { (JSJitGetterOp)get_inlineScriptAllowedByCSP },
6222
  { prototypes::id::Document },
6223
  { PrototypeTraits<prototypes::id::Document>::Depth },
6224
  JSJitInfo::Getter,
6225
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6226
  JSVAL_TYPE_BOOLEAN,  /* returnType.  Not relevant for setters. */
6227
  true,  /* isInfallible. False in setters. */
6228
  false,  /* isMovable.  Not relevant for setters. */
6229
  false, /* isEliminatable.  Not relevant for setters. */
6230
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6231
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6232
  false,  /* isTypedMethod.  Only relevant for methods. */
6233
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6234
};
6235
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6236
static_assert(0 < 1, "There is no slot for us");
6237
6238
MOZ_CAN_RUN_SCRIPT static bool
6239
get_documentFlashClassification(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
6240
0
{
6241
0
  AUTO_PROFILER_LABEL_FAST("get Document.documentFlashClassification", DOM, cx);
6242
0
6243
0
  FlashClassification result(self->DocumentFlashClassification());
6244
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6245
0
  if (!ToJSValue(cx, result, args.rval())) {
6246
0
    return false;
6247
0
  }
6248
0
  return true;
6249
0
}
6250
6251
static const JSJitInfo documentFlashClassification_getterinfo = {
6252
  { (JSJitGetterOp)get_documentFlashClassification },
6253
  { prototypes::id::Document },
6254
  { PrototypeTraits<prototypes::id::Document>::Depth },
6255
  JSJitInfo::Getter,
6256
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6257
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
6258
  false,  /* isInfallible. False in setters. */
6259
  false,  /* isMovable.  Not relevant for setters. */
6260
  false, /* isEliminatable.  Not relevant for setters. */
6261
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6262
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6263
  false,  /* isTypedMethod.  Only relevant for methods. */
6264
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6265
};
6266
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6267
static_assert(0 < 1, "There is no slot for us");
6268
6269
MOZ_CAN_RUN_SCRIPT static bool
6270
get_numTrackersFound(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
6271
0
{
6272
0
  AUTO_PROFILER_LABEL_FAST("get Document.numTrackersFound", DOM, cx);
6273
0
6274
0
  uint32_t result(self->NumTrackersFound());
6275
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6276
0
  args.rval().setNumber(result);
6277
0
  return true;
6278
0
}
6279
6280
static const JSJitInfo numTrackersFound_getterinfo = {
6281
  { (JSJitGetterOp)get_numTrackersFound },
6282
  { prototypes::id::Document },
6283
  { PrototypeTraits<prototypes::id::Document>::Depth },
6284
  JSJitInfo::Getter,
6285
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6286
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
6287
  true,  /* isInfallible. False in setters. */
6288
  false,  /* isMovable.  Not relevant for setters. */
6289
  false, /* isEliminatable.  Not relevant for setters. */
6290
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6291
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6292
  false,  /* isTypedMethod.  Only relevant for methods. */
6293
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6294
};
6295
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6296
static_assert(0 < 1, "There is no slot for us");
6297
6298
MOZ_CAN_RUN_SCRIPT static bool
6299
get_numTrackersBlocked(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
6300
0
{
6301
0
  AUTO_PROFILER_LABEL_FAST("get Document.numTrackersBlocked", DOM, cx);
6302
0
6303
0
  uint32_t result(self->NumTrackersBlocked());
6304
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6305
0
  args.rval().setNumber(result);
6306
0
  return true;
6307
0
}
6308
6309
static const JSJitInfo numTrackersBlocked_getterinfo = {
6310
  { (JSJitGetterOp)get_numTrackersBlocked },
6311
  { prototypes::id::Document },
6312
  { PrototypeTraits<prototypes::id::Document>::Depth },
6313
  JSJitInfo::Getter,
6314
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6315
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
6316
  true,  /* isInfallible. False in setters. */
6317
  false,  /* isMovable.  Not relevant for setters. */
6318
  false, /* isEliminatable.  Not relevant for setters. */
6319
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6320
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6321
  false,  /* isTypedMethod.  Only relevant for methods. */
6322
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6323
};
6324
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6325
static_assert(0 < 1, "There is no slot for us");
6326
6327
MOZ_CAN_RUN_SCRIPT static bool
6328
get_l10n(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
6329
0
{
6330
0
  AUTO_PROFILER_LABEL_FAST("get Document.l10n", DOM, cx);
6331
0
6332
0
  auto result(StrongOrRawPtr<mozilla::dom::DocumentL10n>(self->GetL10n()));
6333
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6334
0
  if (!result) {
6335
0
    args.rval().setNull();
6336
0
    return true;
6337
0
  }
6338
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6339
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
6340
0
    return false;
6341
0
  }
6342
0
  return true;
6343
0
}
6344
6345
static const JSJitInfo l10n_getterinfo = {
6346
  { (JSJitGetterOp)get_l10n },
6347
  { prototypes::id::Document },
6348
  { PrototypeTraits<prototypes::id::Document>::Depth },
6349
  JSJitInfo::Getter,
6350
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6351
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
6352
  false,  /* isInfallible. False in setters. */
6353
  false,  /* isMovable.  Not relevant for setters. */
6354
  false, /* isEliminatable.  Not relevant for setters. */
6355
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6356
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6357
  false,  /* isTypedMethod.  Only relevant for methods. */
6358
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6359
};
6360
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6361
static_assert(0 < 1, "There is no slot for us");
6362
6363
MOZ_CAN_RUN_SCRIPT static bool
6364
get_oncopy(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
6365
0
{
6366
0
  AUTO_PROFILER_LABEL_FAST("get Document.oncopy", DOM, cx);
6367
0
6368
0
  RefPtr<EventHandlerNonNull> result(self->GetOncopy());
6369
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6370
0
  if (result) {
6371
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
6372
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
6373
0
      return false;
6374
0
    }
6375
0
    return true;
6376
0
  } else {
6377
0
    args.rval().setNull();
6378
0
    return true;
6379
0
  }
6380
0
}
6381
6382
MOZ_CAN_RUN_SCRIPT static bool
6383
set_oncopy(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
6384
0
{
6385
0
  AUTO_PROFILER_LABEL_FAST("set Document.oncopy", DOM, cx);
6386
0
6387
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
6388
0
  if (args[0].isObject()) {
6389
0
    { // scope for tempRoot and tempGlobalRoot if needed
6390
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
6391
0
    }
6392
0
  } else {
6393
0
    arg0 = nullptr;
6394
0
  }
6395
0
  self->SetOncopy(Constify(arg0));
6396
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6397
0
6398
0
  return true;
6399
0
}
6400
6401
static const JSJitInfo oncopy_getterinfo = {
6402
  { (JSJitGetterOp)get_oncopy },
6403
  { prototypes::id::Document },
6404
  { PrototypeTraits<prototypes::id::Document>::Depth },
6405
  JSJitInfo::Getter,
6406
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6407
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
6408
  false,  /* isInfallible. False in setters. */
6409
  false,  /* isMovable.  Not relevant for setters. */
6410
  false, /* isEliminatable.  Not relevant for setters. */
6411
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6412
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6413
  false,  /* isTypedMethod.  Only relevant for methods. */
6414
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6415
};
6416
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6417
static_assert(0 < 1, "There is no slot for us");
6418
static const JSJitInfo oncopy_setterinfo = {
6419
  { (JSJitGetterOp)set_oncopy },
6420
  { prototypes::id::Document },
6421
  { PrototypeTraits<prototypes::id::Document>::Depth },
6422
  JSJitInfo::Setter,
6423
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6424
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
6425
  false,  /* isInfallible. False in setters. */
6426
  false,  /* isMovable.  Not relevant for setters. */
6427
  false, /* isEliminatable.  Not relevant for setters. */
6428
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6429
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6430
  false,  /* isTypedMethod.  Only relevant for methods. */
6431
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6432
};
6433
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6434
static_assert(0 < 1, "There is no slot for us");
6435
6436
MOZ_CAN_RUN_SCRIPT static bool
6437
get_oncut(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
6438
0
{
6439
0
  AUTO_PROFILER_LABEL_FAST("get Document.oncut", DOM, cx);
6440
0
6441
0
  RefPtr<EventHandlerNonNull> result(self->GetOncut());
6442
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6443
0
  if (result) {
6444
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
6445
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
6446
0
      return false;
6447
0
    }
6448
0
    return true;
6449
0
  } else {
6450
0
    args.rval().setNull();
6451
0
    return true;
6452
0
  }
6453
0
}
6454
6455
MOZ_CAN_RUN_SCRIPT static bool
6456
set_oncut(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
6457
0
{
6458
0
  AUTO_PROFILER_LABEL_FAST("set Document.oncut", DOM, cx);
6459
0
6460
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
6461
0
  if (args[0].isObject()) {
6462
0
    { // scope for tempRoot and tempGlobalRoot if needed
6463
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
6464
0
    }
6465
0
  } else {
6466
0
    arg0 = nullptr;
6467
0
  }
6468
0
  self->SetOncut(Constify(arg0));
6469
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6470
0
6471
0
  return true;
6472
0
}
6473
6474
static const JSJitInfo oncut_getterinfo = {
6475
  { (JSJitGetterOp)get_oncut },
6476
  { prototypes::id::Document },
6477
  { PrototypeTraits<prototypes::id::Document>::Depth },
6478
  JSJitInfo::Getter,
6479
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6480
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
6481
  false,  /* isInfallible. False in setters. */
6482
  false,  /* isMovable.  Not relevant for setters. */
6483
  false, /* isEliminatable.  Not relevant for setters. */
6484
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6485
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6486
  false,  /* isTypedMethod.  Only relevant for methods. */
6487
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6488
};
6489
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6490
static_assert(0 < 1, "There is no slot for us");
6491
static const JSJitInfo oncut_setterinfo = {
6492
  { (JSJitGetterOp)set_oncut },
6493
  { prototypes::id::Document },
6494
  { PrototypeTraits<prototypes::id::Document>::Depth },
6495
  JSJitInfo::Setter,
6496
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6497
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
6498
  false,  /* isInfallible. False in setters. */
6499
  false,  /* isMovable.  Not relevant for setters. */
6500
  false, /* isEliminatable.  Not relevant for setters. */
6501
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6502
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6503
  false,  /* isTypedMethod.  Only relevant for methods. */
6504
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6505
};
6506
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6507
static_assert(0 < 1, "There is no slot for us");
6508
6509
MOZ_CAN_RUN_SCRIPT static bool
6510
get_onpaste(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
6511
0
{
6512
0
  AUTO_PROFILER_LABEL_FAST("get Document.onpaste", DOM, cx);
6513
0
6514
0
  RefPtr<EventHandlerNonNull> result(self->GetOnpaste());
6515
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6516
0
  if (result) {
6517
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
6518
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
6519
0
      return false;
6520
0
    }
6521
0
    return true;
6522
0
  } else {
6523
0
    args.rval().setNull();
6524
0
    return true;
6525
0
  }
6526
0
}
6527
6528
MOZ_CAN_RUN_SCRIPT static bool
6529
set_onpaste(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
6530
0
{
6531
0
  AUTO_PROFILER_LABEL_FAST("set Document.onpaste", DOM, cx);
6532
0
6533
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
6534
0
  if (args[0].isObject()) {
6535
0
    { // scope for tempRoot and tempGlobalRoot if needed
6536
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
6537
0
    }
6538
0
  } else {
6539
0
    arg0 = nullptr;
6540
0
  }
6541
0
  self->SetOnpaste(Constify(arg0));
6542
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6543
0
6544
0
  return true;
6545
0
}
6546
6547
static const JSJitInfo onpaste_getterinfo = {
6548
  { (JSJitGetterOp)get_onpaste },
6549
  { prototypes::id::Document },
6550
  { PrototypeTraits<prototypes::id::Document>::Depth },
6551
  JSJitInfo::Getter,
6552
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6553
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
6554
  false,  /* isInfallible. False in setters. */
6555
  false,  /* isMovable.  Not relevant for setters. */
6556
  false, /* isEliminatable.  Not relevant for setters. */
6557
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6558
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6559
  false,  /* isTypedMethod.  Only relevant for methods. */
6560
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6561
};
6562
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6563
static_assert(0 < 1, "There is no slot for us");
6564
static const JSJitInfo onpaste_setterinfo = {
6565
  { (JSJitGetterOp)set_onpaste },
6566
  { prototypes::id::Document },
6567
  { PrototypeTraits<prototypes::id::Document>::Depth },
6568
  JSJitInfo::Setter,
6569
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6570
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
6571
  false,  /* isInfallible. False in setters. */
6572
  false,  /* isMovable.  Not relevant for setters. */
6573
  false, /* isEliminatable.  Not relevant for setters. */
6574
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6575
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6576
  false,  /* isTypedMethod.  Only relevant for methods. */
6577
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6578
};
6579
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6580
static_assert(0 < 1, "There is no slot for us");
6581
6582
MOZ_CAN_RUN_SCRIPT static bool
6583
elementFromPoint(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
6584
0
{
6585
0
  AUTO_PROFILER_LABEL_FAST("Document.elementFromPoint", DOM, cx);
6586
0
6587
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
6588
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.elementFromPoint");
6589
0
  }
6590
0
  float arg0;
6591
0
  if (!ValueToPrimitive<float, eDefault>(cx, args[0], &arg0)) {
6592
0
    return false;
6593
0
  } else if (!mozilla::IsFinite(arg0)) {
6594
0
    ThrowErrorMessage(cx, MSG_NOT_FINITE, "Argument 1 of Document.elementFromPoint");
6595
0
    return false;
6596
0
  }
6597
0
  float arg1;
6598
0
  if (!ValueToPrimitive<float, eDefault>(cx, args[1], &arg1)) {
6599
0
    return false;
6600
0
  } else if (!mozilla::IsFinite(arg1)) {
6601
0
    ThrowErrorMessage(cx, MSG_NOT_FINITE, "Argument 2 of Document.elementFromPoint");
6602
0
    return false;
6603
0
  }
6604
0
  auto result(StrongOrRawPtr<mozilla::dom::Element>(self->ElementFromPoint(arg0, arg1)));
6605
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6606
0
  if (!result) {
6607
0
    args.rval().setNull();
6608
0
    return true;
6609
0
  }
6610
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6611
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
6612
0
    return false;
6613
0
  }
6614
0
  return true;
6615
0
}
6616
6617
static const JSJitInfo elementFromPoint_methodinfo = {
6618
  { (JSJitGetterOp)elementFromPoint },
6619
  { prototypes::id::Document },
6620
  { PrototypeTraits<prototypes::id::Document>::Depth },
6621
  JSJitInfo::Method,
6622
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6623
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
6624
  false,  /* isInfallible. False in setters. */
6625
  false,  /* isMovable.  Not relevant for setters. */
6626
  false, /* isEliminatable.  Not relevant for setters. */
6627
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6628
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6629
  false,  /* isTypedMethod.  Only relevant for methods. */
6630
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6631
};
6632
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6633
static_assert(0 < 1, "There is no slot for us");
6634
6635
MOZ_CAN_RUN_SCRIPT static bool
6636
elementsFromPoint(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
6637
0
{
6638
0
  AUTO_PROFILER_LABEL_FAST("Document.elementsFromPoint", DOM, cx);
6639
0
6640
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
6641
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.elementsFromPoint");
6642
0
  }
6643
0
  float arg0;
6644
0
  if (!ValueToPrimitive<float, eDefault>(cx, args[0], &arg0)) {
6645
0
    return false;
6646
0
  } else if (!mozilla::IsFinite(arg0)) {
6647
0
    ThrowErrorMessage(cx, MSG_NOT_FINITE, "Argument 1 of Document.elementsFromPoint");
6648
0
    return false;
6649
0
  }
6650
0
  float arg1;
6651
0
  if (!ValueToPrimitive<float, eDefault>(cx, args[1], &arg1)) {
6652
0
    return false;
6653
0
  } else if (!mozilla::IsFinite(arg1)) {
6654
0
    ThrowErrorMessage(cx, MSG_NOT_FINITE, "Argument 2 of Document.elementsFromPoint");
6655
0
    return false;
6656
0
  }
6657
0
  nsTArray<StrongPtrForMember<mozilla::dom::Element>::Type> result;
6658
0
  self->ElementsFromPoint(arg0, arg1, result);
6659
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6660
0
6661
0
  uint32_t length = result.Length();
6662
0
  JS::Rooted<JSObject*> returnArray(cx, JS_NewArrayObject(cx, length));
6663
0
  if (!returnArray) {
6664
0
    return false;
6665
0
  }
6666
0
  // Scope for 'tmp'
6667
0
  {
6668
0
    JS::Rooted<JS::Value> tmp(cx);
6669
0
    for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
6670
0
      // Control block to let us common up the JS_DefineElement calls when there
6671
0
      // are different ways to succeed at wrapping the object.
6672
0
      do {
6673
0
        if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) {
6674
0
          MOZ_ASSERT(JS_IsExceptionPending(cx));
6675
0
          return false;
6676
0
        }
6677
0
        break;
6678
0
      } while (false);
6679
0
      if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
6680
0
                            JSPROP_ENUMERATE)) {
6681
0
        return false;
6682
0
      }
6683
0
    }
6684
0
  }
6685
0
  args.rval().setObject(*returnArray);
6686
0
  return true;
6687
0
}
6688
6689
static const JSJitInfo elementsFromPoint_methodinfo = {
6690
  { (JSJitGetterOp)elementsFromPoint },
6691
  { prototypes::id::Document },
6692
  { PrototypeTraits<prototypes::id::Document>::Depth },
6693
  JSJitInfo::Method,
6694
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6695
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
6696
  false,  /* isInfallible. False in setters. */
6697
  false,  /* isMovable.  Not relevant for setters. */
6698
  false, /* isEliminatable.  Not relevant for setters. */
6699
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6700
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6701
  false,  /* isTypedMethod.  Only relevant for methods. */
6702
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6703
};
6704
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6705
static_assert(0 < 1, "There is no slot for us");
6706
6707
MOZ_CAN_RUN_SCRIPT static bool
6708
get_activeElement(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
6709
0
{
6710
0
  AUTO_PROFILER_LABEL_FAST("get Document.activeElement", DOM, cx);
6711
0
6712
0
  auto result(StrongOrRawPtr<mozilla::dom::Element>(self->GetActiveElement()));
6713
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6714
0
  if (!result) {
6715
0
    args.rval().setNull();
6716
0
    return true;
6717
0
  }
6718
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6719
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
6720
0
    return false;
6721
0
  }
6722
0
  return true;
6723
0
}
6724
6725
static const JSJitInfo activeElement_getterinfo = {
6726
  { (JSJitGetterOp)get_activeElement },
6727
  { prototypes::id::Document },
6728
  { PrototypeTraits<prototypes::id::Document>::Depth },
6729
  JSJitInfo::Getter,
6730
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6731
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
6732
  false,  /* isInfallible. False in setters. */
6733
  false,  /* isMovable.  Not relevant for setters. */
6734
  false, /* isEliminatable.  Not relevant for setters. */
6735
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6736
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6737
  false,  /* isTypedMethod.  Only relevant for methods. */
6738
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6739
};
6740
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6741
static_assert(0 < 1, "There is no slot for us");
6742
6743
MOZ_CAN_RUN_SCRIPT static bool
6744
get_styleSheets(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
6745
0
{
6746
0
  AUTO_PROFILER_LABEL_FAST("get Document.styleSheets", DOM, cx);
6747
0
6748
0
  auto result(StrongOrRawPtr<mozilla::dom::StyleSheetList>(self->StyleSheets()));
6749
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6750
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6751
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
6752
0
    return false;
6753
0
  }
6754
0
  return true;
6755
0
}
6756
6757
static const JSJitInfo styleSheets_getterinfo = {
6758
  { (JSJitGetterOp)get_styleSheets },
6759
  { prototypes::id::Document },
6760
  { PrototypeTraits<prototypes::id::Document>::Depth },
6761
  JSJitInfo::Getter,
6762
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6763
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
6764
  false,  /* isInfallible. False in setters. */
6765
  false,  /* isMovable.  Not relevant for setters. */
6766
  false, /* isEliminatable.  Not relevant for setters. */
6767
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6768
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6769
  false,  /* isTypedMethod.  Only relevant for methods. */
6770
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6771
};
6772
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6773
static_assert(0 < 1, "There is no slot for us");
6774
6775
MOZ_CAN_RUN_SCRIPT static bool
6776
get_pointerLockElement(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
6777
0
{
6778
0
  AUTO_PROFILER_LABEL_FAST("get Document.pointerLockElement", DOM, cx);
6779
0
6780
0
  auto result(StrongOrRawPtr<mozilla::dom::Element>(self->GetPointerLockElement()));
6781
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6782
0
  if (!result) {
6783
0
    args.rval().setNull();
6784
0
    return true;
6785
0
  }
6786
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6787
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
6788
0
    return false;
6789
0
  }
6790
0
  return true;
6791
0
}
6792
6793
static const JSJitInfo pointerLockElement_getterinfo = {
6794
  { (JSJitGetterOp)get_pointerLockElement },
6795
  { prototypes::id::Document },
6796
  { PrototypeTraits<prototypes::id::Document>::Depth },
6797
  JSJitInfo::Getter,
6798
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6799
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
6800
  false,  /* isInfallible. False in setters. */
6801
  false,  /* isMovable.  Not relevant for setters. */
6802
  false, /* isEliminatable.  Not relevant for setters. */
6803
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6804
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6805
  false,  /* isTypedMethod.  Only relevant for methods. */
6806
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6807
};
6808
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6809
static_assert(0 < 1, "There is no slot for us");
6810
6811
MOZ_CAN_RUN_SCRIPT static bool
6812
get_fullscreenElement(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
6813
0
{
6814
0
  AUTO_PROFILER_LABEL_FAST("get Document.fullscreenElement", DOM, cx);
6815
0
6816
0
  auto result(StrongOrRawPtr<mozilla::dom::Element>(self->GetFullscreenElement()));
6817
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6818
0
  if (!result) {
6819
0
    args.rval().setNull();
6820
0
    return true;
6821
0
  }
6822
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6823
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
6824
0
    return false;
6825
0
  }
6826
0
  return true;
6827
0
}
6828
6829
MOZ_CAN_RUN_SCRIPT static bool
6830
set_fullscreenElement(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
6831
0
{
6832
0
  AUTO_PROFILER_LABEL_FAST("set Document.fullscreenElement", DOM, cx);
6833
0
6834
0
  DeprecationWarning(cx, obj, nsIDocument::eLenientSetter);
6835
0
  return true;
6836
0
}
6837
6838
static const JSJitInfo fullscreenElement_getterinfo = {
6839
  { (JSJitGetterOp)get_fullscreenElement },
6840
  { prototypes::id::Document },
6841
  { PrototypeTraits<prototypes::id::Document>::Depth },
6842
  JSJitInfo::Getter,
6843
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6844
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
6845
  false,  /* isInfallible. False in setters. */
6846
  false,  /* isMovable.  Not relevant for setters. */
6847
  false, /* isEliminatable.  Not relevant for setters. */
6848
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6849
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6850
  false,  /* isTypedMethod.  Only relevant for methods. */
6851
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6852
};
6853
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6854
static_assert(0 < 1, "There is no slot for us");
6855
static const JSJitInfo fullscreenElement_setterinfo = {
6856
  { (JSJitGetterOp)set_fullscreenElement },
6857
  { prototypes::id::Document },
6858
  { PrototypeTraits<prototypes::id::Document>::Depth },
6859
  JSJitInfo::Setter,
6860
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6861
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
6862
  false,  /* isInfallible. False in setters. */
6863
  false,  /* isMovable.  Not relevant for setters. */
6864
  false, /* isEliminatable.  Not relevant for setters. */
6865
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6866
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6867
  false,  /* isTypedMethod.  Only relevant for methods. */
6868
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6869
};
6870
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6871
static_assert(0 < 1, "There is no slot for us");
6872
6873
MOZ_CAN_RUN_SCRIPT static bool
6874
get_mozFullScreenElement(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
6875
0
{
6876
0
  AUTO_PROFILER_LABEL_FAST("get Document.mozFullScreenElement", DOM, cx);
6877
0
6878
0
  auto result(StrongOrRawPtr<mozilla::dom::Element>(self->GetFullscreenElement()));
6879
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6880
0
  if (!result) {
6881
0
    args.rval().setNull();
6882
0
    return true;
6883
0
  }
6884
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6885
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
6886
0
    return false;
6887
0
  }
6888
0
  return true;
6889
0
}
6890
6891
static const JSJitInfo mozFullScreenElement_getterinfo = {
6892
  { (JSJitGetterOp)get_mozFullScreenElement },
6893
  { prototypes::id::Document },
6894
  { PrototypeTraits<prototypes::id::Document>::Depth },
6895
  JSJitInfo::Getter,
6896
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6897
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
6898
  false,  /* isInfallible. False in setters. */
6899
  false,  /* isMovable.  Not relevant for setters. */
6900
  false, /* isEliminatable.  Not relevant for setters. */
6901
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6902
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6903
  false,  /* isTypedMethod.  Only relevant for methods. */
6904
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6905
};
6906
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6907
static_assert(0 < 1, "There is no slot for us");
6908
6909
MOZ_CAN_RUN_SCRIPT static bool
6910
get_fonts(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
6911
0
{
6912
0
  AUTO_PROFILER_LABEL_FAST("get Document.fonts", DOM, cx);
6913
0
6914
0
  auto result(StrongOrRawPtr<mozilla::dom::FontFaceSet>(self->Fonts()));
6915
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6916
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6917
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
6918
0
    return false;
6919
0
  }
6920
0
  return true;
6921
0
}
6922
6923
static const JSJitInfo fonts_getterinfo = {
6924
  { (JSJitGetterOp)get_fonts },
6925
  { prototypes::id::Document },
6926
  { PrototypeTraits<prototypes::id::Document>::Depth },
6927
  JSJitInfo::Getter,
6928
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6929
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
6930
  false,  /* isInfallible. False in setters. */
6931
  false,  /* isMovable.  Not relevant for setters. */
6932
  false, /* isEliminatable.  Not relevant for setters. */
6933
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6934
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6935
  false,  /* isTypedMethod.  Only relevant for methods. */
6936
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
6937
};
6938
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
6939
static_assert(0 < 1, "There is no slot for us");
6940
6941
MOZ_CAN_RUN_SCRIPT static bool
6942
getBoxQuads(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
6943
0
{
6944
0
  AUTO_PROFILER_LABEL_FAST("Document.getBoxQuads", DOM, cx);
6945
0
6946
0
  binding_detail::FastBoxQuadOptions arg0;
6947
0
  if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue,  "Argument 1 of Document.getBoxQuads", false)) {
6948
0
    return false;
6949
0
  }
6950
0
  FastErrorResult rv;
6951
0
  nsTArray<StrongPtrForMember<mozilla::dom::DOMQuad>::Type> result;
6952
0
  self->GetBoxQuads(Constify(arg0), result, nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv);
6953
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
6954
0
    return false;
6955
0
  }
6956
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
6957
0
6958
0
  uint32_t length = result.Length();
6959
0
  JS::Rooted<JSObject*> returnArray(cx, JS_NewArrayObject(cx, length));
6960
0
  if (!returnArray) {
6961
0
    return false;
6962
0
  }
6963
0
  // Scope for 'tmp'
6964
0
  {
6965
0
    JS::Rooted<JS::Value> tmp(cx);
6966
0
    for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
6967
0
      // Control block to let us common up the JS_DefineElement calls when there
6968
0
      // are different ways to succeed at wrapping the object.
6969
0
      do {
6970
0
        if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) {
6971
0
          MOZ_ASSERT(JS_IsExceptionPending(cx));
6972
0
          return false;
6973
0
        }
6974
0
        break;
6975
0
      } while (false);
6976
0
      if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
6977
0
                            JSPROP_ENUMERATE)) {
6978
0
        return false;
6979
0
      }
6980
0
    }
6981
0
  }
6982
0
  args.rval().setObject(*returnArray);
6983
0
  return true;
6984
0
}
6985
6986
static const JSJitInfo getBoxQuads_methodinfo = {
6987
  { (JSJitGetterOp)getBoxQuads },
6988
  { prototypes::id::Document },
6989
  { PrototypeTraits<prototypes::id::Document>::Depth },
6990
  JSJitInfo::Method,
6991
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
6992
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
6993
  false,  /* isInfallible. False in setters. */
6994
  false,  /* isMovable.  Not relevant for setters. */
6995
  false, /* isEliminatable.  Not relevant for setters. */
6996
  false, /* isAlwaysInSlot.  Only relevant for getters. */
6997
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
6998
  false,  /* isTypedMethod.  Only relevant for methods. */
6999
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7000
};
7001
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7002
static_assert(0 < 1, "There is no slot for us");
7003
7004
MOZ_CAN_RUN_SCRIPT static bool
7005
convertQuadFromNode(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
7006
0
{
7007
0
  AUTO_PROFILER_LABEL_FAST("Document.convertQuadFromNode", DOM, cx);
7008
0
7009
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
7010
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.convertQuadFromNode");
7011
0
  }
7012
0
  NonNull<mozilla::dom::DOMQuad> arg0;
7013
0
  if (args[0].isObject()) {
7014
0
    {
7015
0
      nsresult rv = UnwrapObject<prototypes::id::DOMQuad, mozilla::dom::DOMQuad>(args[0], arg0);
7016
0
      if (NS_FAILED(rv)) {
7017
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of Document.convertQuadFromNode", "DOMQuad");
7018
0
        return false;
7019
0
      }
7020
0
    }
7021
0
  } else {
7022
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of Document.convertQuadFromNode");
7023
0
    return false;
7024
0
  }
7025
0
  TextOrElementOrDocument arg1;
7026
0
  TextOrElementOrDocumentArgument arg1_holder(arg1);
7027
0
  {
7028
0
    bool done = false, failed = false, tryNext;
7029
0
    if (args[1].isObject()) {
7030
0
      done = (failed = !arg1_holder.TrySetToText(cx, args[1], tryNext, false)) || !tryNext ||
7031
0
             (failed = !arg1_holder.TrySetToElement(cx, args[1], tryNext, false)) || !tryNext ||
7032
0
             (failed = !arg1_holder.TrySetToDocument(cx, args[1], tryNext, false)) || !tryNext;
7033
0
7034
0
    }
7035
0
    if (failed) {
7036
0
      return false;
7037
0
    }
7038
0
    if (!done) {
7039
0
      ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of Document.convertQuadFromNode", "Text, Element, Document");
7040
0
      return false;
7041
0
    }
7042
0
  }
7043
0
  binding_detail::FastConvertCoordinateOptions arg2;
7044
0
  if (!arg2.Init(cx, (args.hasDefined(2)) ? args[2] : JS::NullHandleValue,  "Argument 3 of Document.convertQuadFromNode", false)) {
7045
0
    return false;
7046
0
  }
7047
0
  FastErrorResult rv;
7048
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMQuad>(self->ConvertQuadFromNode(MOZ_KnownLive(NonNullHelper(arg0)), Constify(arg1), Constify(arg2), nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv)));
7049
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
7050
0
    return false;
7051
0
  }
7052
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7053
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
7054
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
7055
0
    return false;
7056
0
  }
7057
0
  return true;
7058
0
}
7059
7060
static const JSJitInfo convertQuadFromNode_methodinfo = {
7061
  { (JSJitGetterOp)convertQuadFromNode },
7062
  { prototypes::id::Document },
7063
  { PrototypeTraits<prototypes::id::Document>::Depth },
7064
  JSJitInfo::Method,
7065
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7066
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
7067
  false,  /* isInfallible. False in setters. */
7068
  false,  /* isMovable.  Not relevant for setters. */
7069
  false, /* isEliminatable.  Not relevant for setters. */
7070
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7071
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7072
  false,  /* isTypedMethod.  Only relevant for methods. */
7073
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7074
};
7075
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7076
static_assert(0 < 1, "There is no slot for us");
7077
7078
MOZ_CAN_RUN_SCRIPT static bool
7079
convertRectFromNode(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
7080
0
{
7081
0
  AUTO_PROFILER_LABEL_FAST("Document.convertRectFromNode", DOM, cx);
7082
0
7083
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
7084
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.convertRectFromNode");
7085
0
  }
7086
0
  NonNull<mozilla::dom::DOMRectReadOnly> arg0;
7087
0
  if (args[0].isObject()) {
7088
0
    {
7089
0
      nsresult rv = UnwrapObject<prototypes::id::DOMRectReadOnly, mozilla::dom::DOMRectReadOnly>(args[0], arg0);
7090
0
      if (NS_FAILED(rv)) {
7091
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of Document.convertRectFromNode", "DOMRectReadOnly");
7092
0
        return false;
7093
0
      }
7094
0
    }
7095
0
  } else {
7096
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of Document.convertRectFromNode");
7097
0
    return false;
7098
0
  }
7099
0
  TextOrElementOrDocument arg1;
7100
0
  TextOrElementOrDocumentArgument arg1_holder(arg1);
7101
0
  {
7102
0
    bool done = false, failed = false, tryNext;
7103
0
    if (args[1].isObject()) {
7104
0
      done = (failed = !arg1_holder.TrySetToText(cx, args[1], tryNext, false)) || !tryNext ||
7105
0
             (failed = !arg1_holder.TrySetToElement(cx, args[1], tryNext, false)) || !tryNext ||
7106
0
             (failed = !arg1_holder.TrySetToDocument(cx, args[1], tryNext, false)) || !tryNext;
7107
0
7108
0
    }
7109
0
    if (failed) {
7110
0
      return false;
7111
0
    }
7112
0
    if (!done) {
7113
0
      ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of Document.convertRectFromNode", "Text, Element, Document");
7114
0
      return false;
7115
0
    }
7116
0
  }
7117
0
  binding_detail::FastConvertCoordinateOptions arg2;
7118
0
  if (!arg2.Init(cx, (args.hasDefined(2)) ? args[2] : JS::NullHandleValue,  "Argument 3 of Document.convertRectFromNode", false)) {
7119
0
    return false;
7120
0
  }
7121
0
  FastErrorResult rv;
7122
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMQuad>(self->ConvertRectFromNode(MOZ_KnownLive(NonNullHelper(arg0)), Constify(arg1), Constify(arg2), nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv)));
7123
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
7124
0
    return false;
7125
0
  }
7126
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7127
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
7128
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
7129
0
    return false;
7130
0
  }
7131
0
  return true;
7132
0
}
7133
7134
static const JSJitInfo convertRectFromNode_methodinfo = {
7135
  { (JSJitGetterOp)convertRectFromNode },
7136
  { prototypes::id::Document },
7137
  { PrototypeTraits<prototypes::id::Document>::Depth },
7138
  JSJitInfo::Method,
7139
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7140
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
7141
  false,  /* isInfallible. False in setters. */
7142
  false,  /* isMovable.  Not relevant for setters. */
7143
  false, /* isEliminatable.  Not relevant for setters. */
7144
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7145
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7146
  false,  /* isTypedMethod.  Only relevant for methods. */
7147
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7148
};
7149
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7150
static_assert(0 < 1, "There is no slot for us");
7151
7152
MOZ_CAN_RUN_SCRIPT static bool
7153
convertPointFromNode(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
7154
0
{
7155
0
  AUTO_PROFILER_LABEL_FAST("Document.convertPointFromNode", DOM, cx);
7156
0
7157
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
7158
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.convertPointFromNode");
7159
0
  }
7160
0
  binding_detail::FastDOMPointInit arg0;
7161
0
  if (!arg0.Init(cx, args[0],  "Argument 1 of Document.convertPointFromNode", false)) {
7162
0
    return false;
7163
0
  }
7164
0
  TextOrElementOrDocument arg1;
7165
0
  TextOrElementOrDocumentArgument arg1_holder(arg1);
7166
0
  {
7167
0
    bool done = false, failed = false, tryNext;
7168
0
    if (args[1].isObject()) {
7169
0
      done = (failed = !arg1_holder.TrySetToText(cx, args[1], tryNext, false)) || !tryNext ||
7170
0
             (failed = !arg1_holder.TrySetToElement(cx, args[1], tryNext, false)) || !tryNext ||
7171
0
             (failed = !arg1_holder.TrySetToDocument(cx, args[1], tryNext, false)) || !tryNext;
7172
0
7173
0
    }
7174
0
    if (failed) {
7175
0
      return false;
7176
0
    }
7177
0
    if (!done) {
7178
0
      ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 2 of Document.convertPointFromNode", "Text, Element, Document");
7179
0
      return false;
7180
0
    }
7181
0
  }
7182
0
  binding_detail::FastConvertCoordinateOptions arg2;
7183
0
  if (!arg2.Init(cx, (args.hasDefined(2)) ? args[2] : JS::NullHandleValue,  "Argument 3 of Document.convertPointFromNode", false)) {
7184
0
    return false;
7185
0
  }
7186
0
  FastErrorResult rv;
7187
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMPoint>(self->ConvertPointFromNode(Constify(arg0), Constify(arg1), Constify(arg2), nsContentUtils::IsSystemCaller(cx) ? CallerType::System : CallerType::NonSystem, rv)));
7188
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
7189
0
    return false;
7190
0
  }
7191
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7192
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
7193
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
7194
0
    return false;
7195
0
  }
7196
0
  return true;
7197
0
}
7198
7199
static const JSJitInfo convertPointFromNode_methodinfo = {
7200
  { (JSJitGetterOp)convertPointFromNode },
7201
  { prototypes::id::Document },
7202
  { PrototypeTraits<prototypes::id::Document>::Depth },
7203
  JSJitInfo::Method,
7204
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7205
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
7206
  false,  /* isInfallible. False in setters. */
7207
  false,  /* isMovable.  Not relevant for setters. */
7208
  false, /* isEliminatable.  Not relevant for setters. */
7209
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7210
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7211
  false,  /* isTypedMethod.  Only relevant for methods. */
7212
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7213
};
7214
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7215
static_assert(0 < 1, "There is no slot for us");
7216
7217
MOZ_CAN_RUN_SCRIPT static bool
7218
get_onabort(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
7219
0
{
7220
0
  AUTO_PROFILER_LABEL_FAST("get Document.onabort", DOM, cx);
7221
0
7222
0
  RefPtr<EventHandlerNonNull> result(self->GetOnabort());
7223
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7224
0
  if (result) {
7225
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
7226
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
7227
0
      return false;
7228
0
    }
7229
0
    return true;
7230
0
  } else {
7231
0
    args.rval().setNull();
7232
0
    return true;
7233
0
  }
7234
0
}
7235
7236
MOZ_CAN_RUN_SCRIPT static bool
7237
set_onabort(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
7238
0
{
7239
0
  AUTO_PROFILER_LABEL_FAST("set Document.onabort", DOM, cx);
7240
0
7241
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
7242
0
  if (args[0].isObject()) {
7243
0
    { // scope for tempRoot and tempGlobalRoot if needed
7244
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
7245
0
    }
7246
0
  } else {
7247
0
    arg0 = nullptr;
7248
0
  }
7249
0
  self->SetOnabort(Constify(arg0));
7250
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7251
0
7252
0
  return true;
7253
0
}
7254
7255
static const JSJitInfo onabort_getterinfo = {
7256
  { (JSJitGetterOp)get_onabort },
7257
  { prototypes::id::Document },
7258
  { PrototypeTraits<prototypes::id::Document>::Depth },
7259
  JSJitInfo::Getter,
7260
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7261
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
7262
  false,  /* isInfallible. False in setters. */
7263
  false,  /* isMovable.  Not relevant for setters. */
7264
  false, /* isEliminatable.  Not relevant for setters. */
7265
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7266
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7267
  false,  /* isTypedMethod.  Only relevant for methods. */
7268
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7269
};
7270
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7271
static_assert(0 < 1, "There is no slot for us");
7272
static const JSJitInfo onabort_setterinfo = {
7273
  { (JSJitGetterOp)set_onabort },
7274
  { prototypes::id::Document },
7275
  { PrototypeTraits<prototypes::id::Document>::Depth },
7276
  JSJitInfo::Setter,
7277
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7278
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
7279
  false,  /* isInfallible. False in setters. */
7280
  false,  /* isMovable.  Not relevant for setters. */
7281
  false, /* isEliminatable.  Not relevant for setters. */
7282
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7283
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7284
  false,  /* isTypedMethod.  Only relevant for methods. */
7285
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7286
};
7287
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7288
static_assert(0 < 1, "There is no slot for us");
7289
7290
MOZ_CAN_RUN_SCRIPT static bool
7291
get_onblur(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
7292
0
{
7293
0
  AUTO_PROFILER_LABEL_FAST("get Document.onblur", DOM, cx);
7294
0
7295
0
  RefPtr<EventHandlerNonNull> result(self->GetOnblur());
7296
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7297
0
  if (result) {
7298
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
7299
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
7300
0
      return false;
7301
0
    }
7302
0
    return true;
7303
0
  } else {
7304
0
    args.rval().setNull();
7305
0
    return true;
7306
0
  }
7307
0
}
7308
7309
MOZ_CAN_RUN_SCRIPT static bool
7310
set_onblur(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
7311
0
{
7312
0
  AUTO_PROFILER_LABEL_FAST("set Document.onblur", DOM, cx);
7313
0
7314
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
7315
0
  if (args[0].isObject()) {
7316
0
    { // scope for tempRoot and tempGlobalRoot if needed
7317
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
7318
0
    }
7319
0
  } else {
7320
0
    arg0 = nullptr;
7321
0
  }
7322
0
  self->SetOnblur(Constify(arg0));
7323
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7324
0
7325
0
  return true;
7326
0
}
7327
7328
static const JSJitInfo onblur_getterinfo = {
7329
  { (JSJitGetterOp)get_onblur },
7330
  { prototypes::id::Document },
7331
  { PrototypeTraits<prototypes::id::Document>::Depth },
7332
  JSJitInfo::Getter,
7333
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7334
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
7335
  false,  /* isInfallible. False in setters. */
7336
  false,  /* isMovable.  Not relevant for setters. */
7337
  false, /* isEliminatable.  Not relevant for setters. */
7338
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7339
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7340
  false,  /* isTypedMethod.  Only relevant for methods. */
7341
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7342
};
7343
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7344
static_assert(0 < 1, "There is no slot for us");
7345
static const JSJitInfo onblur_setterinfo = {
7346
  { (JSJitGetterOp)set_onblur },
7347
  { prototypes::id::Document },
7348
  { PrototypeTraits<prototypes::id::Document>::Depth },
7349
  JSJitInfo::Setter,
7350
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7351
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
7352
  false,  /* isInfallible. False in setters. */
7353
  false,  /* isMovable.  Not relevant for setters. */
7354
  false, /* isEliminatable.  Not relevant for setters. */
7355
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7356
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7357
  false,  /* isTypedMethod.  Only relevant for methods. */
7358
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7359
};
7360
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7361
static_assert(0 < 1, "There is no slot for us");
7362
7363
MOZ_CAN_RUN_SCRIPT static bool
7364
get_onfocus(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
7365
0
{
7366
0
  AUTO_PROFILER_LABEL_FAST("get Document.onfocus", DOM, cx);
7367
0
7368
0
  RefPtr<EventHandlerNonNull> result(self->GetOnfocus());
7369
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7370
0
  if (result) {
7371
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
7372
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
7373
0
      return false;
7374
0
    }
7375
0
    return true;
7376
0
  } else {
7377
0
    args.rval().setNull();
7378
0
    return true;
7379
0
  }
7380
0
}
7381
7382
MOZ_CAN_RUN_SCRIPT static bool
7383
set_onfocus(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
7384
0
{
7385
0
  AUTO_PROFILER_LABEL_FAST("set Document.onfocus", DOM, cx);
7386
0
7387
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
7388
0
  if (args[0].isObject()) {
7389
0
    { // scope for tempRoot and tempGlobalRoot if needed
7390
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
7391
0
    }
7392
0
  } else {
7393
0
    arg0 = nullptr;
7394
0
  }
7395
0
  self->SetOnfocus(Constify(arg0));
7396
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7397
0
7398
0
  return true;
7399
0
}
7400
7401
static const JSJitInfo onfocus_getterinfo = {
7402
  { (JSJitGetterOp)get_onfocus },
7403
  { prototypes::id::Document },
7404
  { PrototypeTraits<prototypes::id::Document>::Depth },
7405
  JSJitInfo::Getter,
7406
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7407
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
7408
  false,  /* isInfallible. False in setters. */
7409
  false,  /* isMovable.  Not relevant for setters. */
7410
  false, /* isEliminatable.  Not relevant for setters. */
7411
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7412
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7413
  false,  /* isTypedMethod.  Only relevant for methods. */
7414
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7415
};
7416
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7417
static_assert(0 < 1, "There is no slot for us");
7418
static const JSJitInfo onfocus_setterinfo = {
7419
  { (JSJitGetterOp)set_onfocus },
7420
  { prototypes::id::Document },
7421
  { PrototypeTraits<prototypes::id::Document>::Depth },
7422
  JSJitInfo::Setter,
7423
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7424
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
7425
  false,  /* isInfallible. False in setters. */
7426
  false,  /* isMovable.  Not relevant for setters. */
7427
  false, /* isEliminatable.  Not relevant for setters. */
7428
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7429
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7430
  false,  /* isTypedMethod.  Only relevant for methods. */
7431
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7432
};
7433
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7434
static_assert(0 < 1, "There is no slot for us");
7435
7436
MOZ_CAN_RUN_SCRIPT static bool
7437
get_onauxclick(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
7438
0
{
7439
0
  AUTO_PROFILER_LABEL_FAST("get Document.onauxclick", DOM, cx);
7440
0
7441
0
  RefPtr<EventHandlerNonNull> result(self->GetOnauxclick());
7442
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7443
0
  if (result) {
7444
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
7445
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
7446
0
      return false;
7447
0
    }
7448
0
    return true;
7449
0
  } else {
7450
0
    args.rval().setNull();
7451
0
    return true;
7452
0
  }
7453
0
}
7454
7455
MOZ_CAN_RUN_SCRIPT static bool
7456
set_onauxclick(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
7457
0
{
7458
0
  AUTO_PROFILER_LABEL_FAST("set Document.onauxclick", DOM, cx);
7459
0
7460
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
7461
0
  if (args[0].isObject()) {
7462
0
    { // scope for tempRoot and tempGlobalRoot if needed
7463
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
7464
0
    }
7465
0
  } else {
7466
0
    arg0 = nullptr;
7467
0
  }
7468
0
  self->SetOnauxclick(Constify(arg0));
7469
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7470
0
7471
0
  return true;
7472
0
}
7473
7474
static const JSJitInfo onauxclick_getterinfo = {
7475
  { (JSJitGetterOp)get_onauxclick },
7476
  { prototypes::id::Document },
7477
  { PrototypeTraits<prototypes::id::Document>::Depth },
7478
  JSJitInfo::Getter,
7479
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7480
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
7481
  false,  /* isInfallible. False in setters. */
7482
  false,  /* isMovable.  Not relevant for setters. */
7483
  false, /* isEliminatable.  Not relevant for setters. */
7484
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7485
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7486
  false,  /* isTypedMethod.  Only relevant for methods. */
7487
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7488
};
7489
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7490
static_assert(0 < 1, "There is no slot for us");
7491
static const JSJitInfo onauxclick_setterinfo = {
7492
  { (JSJitGetterOp)set_onauxclick },
7493
  { prototypes::id::Document },
7494
  { PrototypeTraits<prototypes::id::Document>::Depth },
7495
  JSJitInfo::Setter,
7496
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7497
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
7498
  false,  /* isInfallible. False in setters. */
7499
  false,  /* isMovable.  Not relevant for setters. */
7500
  false, /* isEliminatable.  Not relevant for setters. */
7501
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7502
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7503
  false,  /* isTypedMethod.  Only relevant for methods. */
7504
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7505
};
7506
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7507
static_assert(0 < 1, "There is no slot for us");
7508
7509
MOZ_CAN_RUN_SCRIPT static bool
7510
get_oncanplay(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
7511
0
{
7512
0
  AUTO_PROFILER_LABEL_FAST("get Document.oncanplay", DOM, cx);
7513
0
7514
0
  RefPtr<EventHandlerNonNull> result(self->GetOncanplay());
7515
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7516
0
  if (result) {
7517
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
7518
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
7519
0
      return false;
7520
0
    }
7521
0
    return true;
7522
0
  } else {
7523
0
    args.rval().setNull();
7524
0
    return true;
7525
0
  }
7526
0
}
7527
7528
MOZ_CAN_RUN_SCRIPT static bool
7529
set_oncanplay(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
7530
0
{
7531
0
  AUTO_PROFILER_LABEL_FAST("set Document.oncanplay", DOM, cx);
7532
0
7533
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
7534
0
  if (args[0].isObject()) {
7535
0
    { // scope for tempRoot and tempGlobalRoot if needed
7536
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
7537
0
    }
7538
0
  } else {
7539
0
    arg0 = nullptr;
7540
0
  }
7541
0
  self->SetOncanplay(Constify(arg0));
7542
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7543
0
7544
0
  return true;
7545
0
}
7546
7547
static const JSJitInfo oncanplay_getterinfo = {
7548
  { (JSJitGetterOp)get_oncanplay },
7549
  { prototypes::id::Document },
7550
  { PrototypeTraits<prototypes::id::Document>::Depth },
7551
  JSJitInfo::Getter,
7552
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7553
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
7554
  false,  /* isInfallible. False in setters. */
7555
  false,  /* isMovable.  Not relevant for setters. */
7556
  false, /* isEliminatable.  Not relevant for setters. */
7557
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7558
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7559
  false,  /* isTypedMethod.  Only relevant for methods. */
7560
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7561
};
7562
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7563
static_assert(0 < 1, "There is no slot for us");
7564
static const JSJitInfo oncanplay_setterinfo = {
7565
  { (JSJitGetterOp)set_oncanplay },
7566
  { prototypes::id::Document },
7567
  { PrototypeTraits<prototypes::id::Document>::Depth },
7568
  JSJitInfo::Setter,
7569
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7570
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
7571
  false,  /* isInfallible. False in setters. */
7572
  false,  /* isMovable.  Not relevant for setters. */
7573
  false, /* isEliminatable.  Not relevant for setters. */
7574
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7575
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7576
  false,  /* isTypedMethod.  Only relevant for methods. */
7577
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7578
};
7579
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7580
static_assert(0 < 1, "There is no slot for us");
7581
7582
MOZ_CAN_RUN_SCRIPT static bool
7583
get_oncanplaythrough(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
7584
0
{
7585
0
  AUTO_PROFILER_LABEL_FAST("get Document.oncanplaythrough", DOM, cx);
7586
0
7587
0
  RefPtr<EventHandlerNonNull> result(self->GetOncanplaythrough());
7588
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7589
0
  if (result) {
7590
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
7591
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
7592
0
      return false;
7593
0
    }
7594
0
    return true;
7595
0
  } else {
7596
0
    args.rval().setNull();
7597
0
    return true;
7598
0
  }
7599
0
}
7600
7601
MOZ_CAN_RUN_SCRIPT static bool
7602
set_oncanplaythrough(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
7603
0
{
7604
0
  AUTO_PROFILER_LABEL_FAST("set Document.oncanplaythrough", DOM, cx);
7605
0
7606
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
7607
0
  if (args[0].isObject()) {
7608
0
    { // scope for tempRoot and tempGlobalRoot if needed
7609
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
7610
0
    }
7611
0
  } else {
7612
0
    arg0 = nullptr;
7613
0
  }
7614
0
  self->SetOncanplaythrough(Constify(arg0));
7615
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7616
0
7617
0
  return true;
7618
0
}
7619
7620
static const JSJitInfo oncanplaythrough_getterinfo = {
7621
  { (JSJitGetterOp)get_oncanplaythrough },
7622
  { prototypes::id::Document },
7623
  { PrototypeTraits<prototypes::id::Document>::Depth },
7624
  JSJitInfo::Getter,
7625
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7626
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
7627
  false,  /* isInfallible. False in setters. */
7628
  false,  /* isMovable.  Not relevant for setters. */
7629
  false, /* isEliminatable.  Not relevant for setters. */
7630
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7631
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7632
  false,  /* isTypedMethod.  Only relevant for methods. */
7633
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7634
};
7635
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7636
static_assert(0 < 1, "There is no slot for us");
7637
static const JSJitInfo oncanplaythrough_setterinfo = {
7638
  { (JSJitGetterOp)set_oncanplaythrough },
7639
  { prototypes::id::Document },
7640
  { PrototypeTraits<prototypes::id::Document>::Depth },
7641
  JSJitInfo::Setter,
7642
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7643
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
7644
  false,  /* isInfallible. False in setters. */
7645
  false,  /* isMovable.  Not relevant for setters. */
7646
  false, /* isEliminatable.  Not relevant for setters. */
7647
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7648
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7649
  false,  /* isTypedMethod.  Only relevant for methods. */
7650
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7651
};
7652
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7653
static_assert(0 < 1, "There is no slot for us");
7654
7655
MOZ_CAN_RUN_SCRIPT static bool
7656
get_onchange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
7657
0
{
7658
0
  AUTO_PROFILER_LABEL_FAST("get Document.onchange", DOM, cx);
7659
0
7660
0
  RefPtr<EventHandlerNonNull> result(self->GetOnchange());
7661
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7662
0
  if (result) {
7663
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
7664
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
7665
0
      return false;
7666
0
    }
7667
0
    return true;
7668
0
  } else {
7669
0
    args.rval().setNull();
7670
0
    return true;
7671
0
  }
7672
0
}
7673
7674
MOZ_CAN_RUN_SCRIPT static bool
7675
set_onchange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
7676
0
{
7677
0
  AUTO_PROFILER_LABEL_FAST("set Document.onchange", DOM, cx);
7678
0
7679
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
7680
0
  if (args[0].isObject()) {
7681
0
    { // scope for tempRoot and tempGlobalRoot if needed
7682
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
7683
0
    }
7684
0
  } else {
7685
0
    arg0 = nullptr;
7686
0
  }
7687
0
  self->SetOnchange(Constify(arg0));
7688
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7689
0
7690
0
  return true;
7691
0
}
7692
7693
static const JSJitInfo onchange_getterinfo = {
7694
  { (JSJitGetterOp)get_onchange },
7695
  { prototypes::id::Document },
7696
  { PrototypeTraits<prototypes::id::Document>::Depth },
7697
  JSJitInfo::Getter,
7698
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7699
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
7700
  false,  /* isInfallible. False in setters. */
7701
  false,  /* isMovable.  Not relevant for setters. */
7702
  false, /* isEliminatable.  Not relevant for setters. */
7703
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7704
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7705
  false,  /* isTypedMethod.  Only relevant for methods. */
7706
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7707
};
7708
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7709
static_assert(0 < 1, "There is no slot for us");
7710
static const JSJitInfo onchange_setterinfo = {
7711
  { (JSJitGetterOp)set_onchange },
7712
  { prototypes::id::Document },
7713
  { PrototypeTraits<prototypes::id::Document>::Depth },
7714
  JSJitInfo::Setter,
7715
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7716
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
7717
  false,  /* isInfallible. False in setters. */
7718
  false,  /* isMovable.  Not relevant for setters. */
7719
  false, /* isEliminatable.  Not relevant for setters. */
7720
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7721
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7722
  false,  /* isTypedMethod.  Only relevant for methods. */
7723
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7724
};
7725
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7726
static_assert(0 < 1, "There is no slot for us");
7727
7728
MOZ_CAN_RUN_SCRIPT static bool
7729
get_onclick(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
7730
0
{
7731
0
  AUTO_PROFILER_LABEL_FAST("get Document.onclick", DOM, cx);
7732
0
7733
0
  RefPtr<EventHandlerNonNull> result(self->GetOnclick());
7734
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7735
0
  if (result) {
7736
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
7737
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
7738
0
      return false;
7739
0
    }
7740
0
    return true;
7741
0
  } else {
7742
0
    args.rval().setNull();
7743
0
    return true;
7744
0
  }
7745
0
}
7746
7747
MOZ_CAN_RUN_SCRIPT static bool
7748
set_onclick(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
7749
0
{
7750
0
  AUTO_PROFILER_LABEL_FAST("set Document.onclick", DOM, cx);
7751
0
7752
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
7753
0
  if (args[0].isObject()) {
7754
0
    { // scope for tempRoot and tempGlobalRoot if needed
7755
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
7756
0
    }
7757
0
  } else {
7758
0
    arg0 = nullptr;
7759
0
  }
7760
0
  self->SetOnclick(Constify(arg0));
7761
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7762
0
7763
0
  return true;
7764
0
}
7765
7766
static const JSJitInfo onclick_getterinfo = {
7767
  { (JSJitGetterOp)get_onclick },
7768
  { prototypes::id::Document },
7769
  { PrototypeTraits<prototypes::id::Document>::Depth },
7770
  JSJitInfo::Getter,
7771
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7772
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
7773
  false,  /* isInfallible. False in setters. */
7774
  false,  /* isMovable.  Not relevant for setters. */
7775
  false, /* isEliminatable.  Not relevant for setters. */
7776
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7777
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7778
  false,  /* isTypedMethod.  Only relevant for methods. */
7779
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7780
};
7781
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7782
static_assert(0 < 1, "There is no slot for us");
7783
static const JSJitInfo onclick_setterinfo = {
7784
  { (JSJitGetterOp)set_onclick },
7785
  { prototypes::id::Document },
7786
  { PrototypeTraits<prototypes::id::Document>::Depth },
7787
  JSJitInfo::Setter,
7788
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7789
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
7790
  false,  /* isInfallible. False in setters. */
7791
  false,  /* isMovable.  Not relevant for setters. */
7792
  false, /* isEliminatable.  Not relevant for setters. */
7793
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7794
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7795
  false,  /* isTypedMethod.  Only relevant for methods. */
7796
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7797
};
7798
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7799
static_assert(0 < 1, "There is no slot for us");
7800
7801
MOZ_CAN_RUN_SCRIPT static bool
7802
get_onclose(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
7803
0
{
7804
0
  AUTO_PROFILER_LABEL_FAST("get Document.onclose", DOM, cx);
7805
0
7806
0
  RefPtr<EventHandlerNonNull> result(self->GetOnclose());
7807
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7808
0
  if (result) {
7809
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
7810
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
7811
0
      return false;
7812
0
    }
7813
0
    return true;
7814
0
  } else {
7815
0
    args.rval().setNull();
7816
0
    return true;
7817
0
  }
7818
0
}
7819
7820
MOZ_CAN_RUN_SCRIPT static bool
7821
set_onclose(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
7822
0
{
7823
0
  AUTO_PROFILER_LABEL_FAST("set Document.onclose", DOM, cx);
7824
0
7825
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
7826
0
  if (args[0].isObject()) {
7827
0
    { // scope for tempRoot and tempGlobalRoot if needed
7828
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
7829
0
    }
7830
0
  } else {
7831
0
    arg0 = nullptr;
7832
0
  }
7833
0
  self->SetOnclose(Constify(arg0));
7834
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7835
0
7836
0
  return true;
7837
0
}
7838
7839
static const JSJitInfo onclose_getterinfo = {
7840
  { (JSJitGetterOp)get_onclose },
7841
  { prototypes::id::Document },
7842
  { PrototypeTraits<prototypes::id::Document>::Depth },
7843
  JSJitInfo::Getter,
7844
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7845
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
7846
  false,  /* isInfallible. False in setters. */
7847
  false,  /* isMovable.  Not relevant for setters. */
7848
  false, /* isEliminatable.  Not relevant for setters. */
7849
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7850
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7851
  false,  /* isTypedMethod.  Only relevant for methods. */
7852
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7853
};
7854
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7855
static_assert(0 < 1, "There is no slot for us");
7856
static const JSJitInfo onclose_setterinfo = {
7857
  { (JSJitGetterOp)set_onclose },
7858
  { prototypes::id::Document },
7859
  { PrototypeTraits<prototypes::id::Document>::Depth },
7860
  JSJitInfo::Setter,
7861
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7862
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
7863
  false,  /* isInfallible. False in setters. */
7864
  false,  /* isMovable.  Not relevant for setters. */
7865
  false, /* isEliminatable.  Not relevant for setters. */
7866
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7867
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7868
  false,  /* isTypedMethod.  Only relevant for methods. */
7869
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7870
};
7871
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7872
static_assert(0 < 1, "There is no slot for us");
7873
7874
MOZ_CAN_RUN_SCRIPT static bool
7875
get_oncontextmenu(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
7876
0
{
7877
0
  AUTO_PROFILER_LABEL_FAST("get Document.oncontextmenu", DOM, cx);
7878
0
7879
0
  RefPtr<EventHandlerNonNull> result(self->GetOncontextmenu());
7880
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7881
0
  if (result) {
7882
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
7883
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
7884
0
      return false;
7885
0
    }
7886
0
    return true;
7887
0
  } else {
7888
0
    args.rval().setNull();
7889
0
    return true;
7890
0
  }
7891
0
}
7892
7893
MOZ_CAN_RUN_SCRIPT static bool
7894
set_oncontextmenu(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
7895
0
{
7896
0
  AUTO_PROFILER_LABEL_FAST("set Document.oncontextmenu", DOM, cx);
7897
0
7898
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
7899
0
  if (args[0].isObject()) {
7900
0
    { // scope for tempRoot and tempGlobalRoot if needed
7901
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
7902
0
    }
7903
0
  } else {
7904
0
    arg0 = nullptr;
7905
0
  }
7906
0
  self->SetOncontextmenu(Constify(arg0));
7907
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7908
0
7909
0
  return true;
7910
0
}
7911
7912
static const JSJitInfo oncontextmenu_getterinfo = {
7913
  { (JSJitGetterOp)get_oncontextmenu },
7914
  { prototypes::id::Document },
7915
  { PrototypeTraits<prototypes::id::Document>::Depth },
7916
  JSJitInfo::Getter,
7917
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7918
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
7919
  false,  /* isInfallible. False in setters. */
7920
  false,  /* isMovable.  Not relevant for setters. */
7921
  false, /* isEliminatable.  Not relevant for setters. */
7922
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7923
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7924
  false,  /* isTypedMethod.  Only relevant for methods. */
7925
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7926
};
7927
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7928
static_assert(0 < 1, "There is no slot for us");
7929
static const JSJitInfo oncontextmenu_setterinfo = {
7930
  { (JSJitGetterOp)set_oncontextmenu },
7931
  { prototypes::id::Document },
7932
  { PrototypeTraits<prototypes::id::Document>::Depth },
7933
  JSJitInfo::Setter,
7934
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7935
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
7936
  false,  /* isInfallible. False in setters. */
7937
  false,  /* isMovable.  Not relevant for setters. */
7938
  false, /* isEliminatable.  Not relevant for setters. */
7939
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7940
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7941
  false,  /* isTypedMethod.  Only relevant for methods. */
7942
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7943
};
7944
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
7945
static_assert(0 < 1, "There is no slot for us");
7946
7947
MOZ_CAN_RUN_SCRIPT static bool
7948
get_ondblclick(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
7949
0
{
7950
0
  AUTO_PROFILER_LABEL_FAST("get Document.ondblclick", DOM, cx);
7951
0
7952
0
  RefPtr<EventHandlerNonNull> result(self->GetOndblclick());
7953
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7954
0
  if (result) {
7955
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
7956
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
7957
0
      return false;
7958
0
    }
7959
0
    return true;
7960
0
  } else {
7961
0
    args.rval().setNull();
7962
0
    return true;
7963
0
  }
7964
0
}
7965
7966
MOZ_CAN_RUN_SCRIPT static bool
7967
set_ondblclick(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
7968
0
{
7969
0
  AUTO_PROFILER_LABEL_FAST("set Document.ondblclick", DOM, cx);
7970
0
7971
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
7972
0
  if (args[0].isObject()) {
7973
0
    { // scope for tempRoot and tempGlobalRoot if needed
7974
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
7975
0
    }
7976
0
  } else {
7977
0
    arg0 = nullptr;
7978
0
  }
7979
0
  self->SetOndblclick(Constify(arg0));
7980
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
7981
0
7982
0
  return true;
7983
0
}
7984
7985
static const JSJitInfo ondblclick_getterinfo = {
7986
  { (JSJitGetterOp)get_ondblclick },
7987
  { prototypes::id::Document },
7988
  { PrototypeTraits<prototypes::id::Document>::Depth },
7989
  JSJitInfo::Getter,
7990
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
7991
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
7992
  false,  /* isInfallible. False in setters. */
7993
  false,  /* isMovable.  Not relevant for setters. */
7994
  false, /* isEliminatable.  Not relevant for setters. */
7995
  false, /* isAlwaysInSlot.  Only relevant for getters. */
7996
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
7997
  false,  /* isTypedMethod.  Only relevant for methods. */
7998
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
7999
};
8000
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8001
static_assert(0 < 1, "There is no slot for us");
8002
static const JSJitInfo ondblclick_setterinfo = {
8003
  { (JSJitGetterOp)set_ondblclick },
8004
  { prototypes::id::Document },
8005
  { PrototypeTraits<prototypes::id::Document>::Depth },
8006
  JSJitInfo::Setter,
8007
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8008
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
8009
  false,  /* isInfallible. False in setters. */
8010
  false,  /* isMovable.  Not relevant for setters. */
8011
  false, /* isEliminatable.  Not relevant for setters. */
8012
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8013
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8014
  false,  /* isTypedMethod.  Only relevant for methods. */
8015
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8016
};
8017
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8018
static_assert(0 < 1, "There is no slot for us");
8019
8020
MOZ_CAN_RUN_SCRIPT static bool
8021
get_ondrag(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
8022
0
{
8023
0
  AUTO_PROFILER_LABEL_FAST("get Document.ondrag", DOM, cx);
8024
0
8025
0
  RefPtr<EventHandlerNonNull> result(self->GetOndrag());
8026
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8027
0
  if (result) {
8028
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8029
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8030
0
      return false;
8031
0
    }
8032
0
    return true;
8033
0
  } else {
8034
0
    args.rval().setNull();
8035
0
    return true;
8036
0
  }
8037
0
}
8038
8039
MOZ_CAN_RUN_SCRIPT static bool
8040
set_ondrag(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
8041
0
{
8042
0
  AUTO_PROFILER_LABEL_FAST("set Document.ondrag", DOM, cx);
8043
0
8044
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
8045
0
  if (args[0].isObject()) {
8046
0
    { // scope for tempRoot and tempGlobalRoot if needed
8047
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8048
0
    }
8049
0
  } else {
8050
0
    arg0 = nullptr;
8051
0
  }
8052
0
  self->SetOndrag(Constify(arg0));
8053
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8054
0
8055
0
  return true;
8056
0
}
8057
8058
static const JSJitInfo ondrag_getterinfo = {
8059
  { (JSJitGetterOp)get_ondrag },
8060
  { prototypes::id::Document },
8061
  { PrototypeTraits<prototypes::id::Document>::Depth },
8062
  JSJitInfo::Getter,
8063
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8064
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
8065
  false,  /* isInfallible. False in setters. */
8066
  false,  /* isMovable.  Not relevant for setters. */
8067
  false, /* isEliminatable.  Not relevant for setters. */
8068
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8069
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8070
  false,  /* isTypedMethod.  Only relevant for methods. */
8071
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8072
};
8073
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8074
static_assert(0 < 1, "There is no slot for us");
8075
static const JSJitInfo ondrag_setterinfo = {
8076
  { (JSJitGetterOp)set_ondrag },
8077
  { prototypes::id::Document },
8078
  { PrototypeTraits<prototypes::id::Document>::Depth },
8079
  JSJitInfo::Setter,
8080
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8081
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
8082
  false,  /* isInfallible. False in setters. */
8083
  false,  /* isMovable.  Not relevant for setters. */
8084
  false, /* isEliminatable.  Not relevant for setters. */
8085
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8086
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8087
  false,  /* isTypedMethod.  Only relevant for methods. */
8088
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8089
};
8090
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8091
static_assert(0 < 1, "There is no slot for us");
8092
8093
MOZ_CAN_RUN_SCRIPT static bool
8094
get_ondragend(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
8095
0
{
8096
0
  AUTO_PROFILER_LABEL_FAST("get Document.ondragend", DOM, cx);
8097
0
8098
0
  RefPtr<EventHandlerNonNull> result(self->GetOndragend());
8099
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8100
0
  if (result) {
8101
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8102
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8103
0
      return false;
8104
0
    }
8105
0
    return true;
8106
0
  } else {
8107
0
    args.rval().setNull();
8108
0
    return true;
8109
0
  }
8110
0
}
8111
8112
MOZ_CAN_RUN_SCRIPT static bool
8113
set_ondragend(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
8114
0
{
8115
0
  AUTO_PROFILER_LABEL_FAST("set Document.ondragend", DOM, cx);
8116
0
8117
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
8118
0
  if (args[0].isObject()) {
8119
0
    { // scope for tempRoot and tempGlobalRoot if needed
8120
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8121
0
    }
8122
0
  } else {
8123
0
    arg0 = nullptr;
8124
0
  }
8125
0
  self->SetOndragend(Constify(arg0));
8126
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8127
0
8128
0
  return true;
8129
0
}
8130
8131
static const JSJitInfo ondragend_getterinfo = {
8132
  { (JSJitGetterOp)get_ondragend },
8133
  { prototypes::id::Document },
8134
  { PrototypeTraits<prototypes::id::Document>::Depth },
8135
  JSJitInfo::Getter,
8136
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8137
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
8138
  false,  /* isInfallible. False in setters. */
8139
  false,  /* isMovable.  Not relevant for setters. */
8140
  false, /* isEliminatable.  Not relevant for setters. */
8141
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8142
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8143
  false,  /* isTypedMethod.  Only relevant for methods. */
8144
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8145
};
8146
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8147
static_assert(0 < 1, "There is no slot for us");
8148
static const JSJitInfo ondragend_setterinfo = {
8149
  { (JSJitGetterOp)set_ondragend },
8150
  { prototypes::id::Document },
8151
  { PrototypeTraits<prototypes::id::Document>::Depth },
8152
  JSJitInfo::Setter,
8153
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8154
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
8155
  false,  /* isInfallible. False in setters. */
8156
  false,  /* isMovable.  Not relevant for setters. */
8157
  false, /* isEliminatable.  Not relevant for setters. */
8158
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8159
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8160
  false,  /* isTypedMethod.  Only relevant for methods. */
8161
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8162
};
8163
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8164
static_assert(0 < 1, "There is no slot for us");
8165
8166
MOZ_CAN_RUN_SCRIPT static bool
8167
get_ondragenter(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
8168
0
{
8169
0
  AUTO_PROFILER_LABEL_FAST("get Document.ondragenter", DOM, cx);
8170
0
8171
0
  RefPtr<EventHandlerNonNull> result(self->GetOndragenter());
8172
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8173
0
  if (result) {
8174
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8175
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8176
0
      return false;
8177
0
    }
8178
0
    return true;
8179
0
  } else {
8180
0
    args.rval().setNull();
8181
0
    return true;
8182
0
  }
8183
0
}
8184
8185
MOZ_CAN_RUN_SCRIPT static bool
8186
set_ondragenter(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
8187
0
{
8188
0
  AUTO_PROFILER_LABEL_FAST("set Document.ondragenter", DOM, cx);
8189
0
8190
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
8191
0
  if (args[0].isObject()) {
8192
0
    { // scope for tempRoot and tempGlobalRoot if needed
8193
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8194
0
    }
8195
0
  } else {
8196
0
    arg0 = nullptr;
8197
0
  }
8198
0
  self->SetOndragenter(Constify(arg0));
8199
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8200
0
8201
0
  return true;
8202
0
}
8203
8204
static const JSJitInfo ondragenter_getterinfo = {
8205
  { (JSJitGetterOp)get_ondragenter },
8206
  { prototypes::id::Document },
8207
  { PrototypeTraits<prototypes::id::Document>::Depth },
8208
  JSJitInfo::Getter,
8209
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8210
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
8211
  false,  /* isInfallible. False in setters. */
8212
  false,  /* isMovable.  Not relevant for setters. */
8213
  false, /* isEliminatable.  Not relevant for setters. */
8214
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8215
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8216
  false,  /* isTypedMethod.  Only relevant for methods. */
8217
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8218
};
8219
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8220
static_assert(0 < 1, "There is no slot for us");
8221
static const JSJitInfo ondragenter_setterinfo = {
8222
  { (JSJitGetterOp)set_ondragenter },
8223
  { prototypes::id::Document },
8224
  { PrototypeTraits<prototypes::id::Document>::Depth },
8225
  JSJitInfo::Setter,
8226
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8227
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
8228
  false,  /* isInfallible. False in setters. */
8229
  false,  /* isMovable.  Not relevant for setters. */
8230
  false, /* isEliminatable.  Not relevant for setters. */
8231
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8232
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8233
  false,  /* isTypedMethod.  Only relevant for methods. */
8234
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8235
};
8236
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8237
static_assert(0 < 1, "There is no slot for us");
8238
8239
MOZ_CAN_RUN_SCRIPT static bool
8240
get_ondragexit(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
8241
0
{
8242
0
  AUTO_PROFILER_LABEL_FAST("get Document.ondragexit", DOM, cx);
8243
0
8244
0
  RefPtr<EventHandlerNonNull> result(self->GetOndragexit());
8245
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8246
0
  if (result) {
8247
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8248
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8249
0
      return false;
8250
0
    }
8251
0
    return true;
8252
0
  } else {
8253
0
    args.rval().setNull();
8254
0
    return true;
8255
0
  }
8256
0
}
8257
8258
MOZ_CAN_RUN_SCRIPT static bool
8259
set_ondragexit(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
8260
0
{
8261
0
  AUTO_PROFILER_LABEL_FAST("set Document.ondragexit", DOM, cx);
8262
0
8263
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
8264
0
  if (args[0].isObject()) {
8265
0
    { // scope for tempRoot and tempGlobalRoot if needed
8266
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8267
0
    }
8268
0
  } else {
8269
0
    arg0 = nullptr;
8270
0
  }
8271
0
  self->SetOndragexit(Constify(arg0));
8272
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8273
0
8274
0
  return true;
8275
0
}
8276
8277
static const JSJitInfo ondragexit_getterinfo = {
8278
  { (JSJitGetterOp)get_ondragexit },
8279
  { prototypes::id::Document },
8280
  { PrototypeTraits<prototypes::id::Document>::Depth },
8281
  JSJitInfo::Getter,
8282
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8283
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
8284
  false,  /* isInfallible. False in setters. */
8285
  false,  /* isMovable.  Not relevant for setters. */
8286
  false, /* isEliminatable.  Not relevant for setters. */
8287
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8288
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8289
  false,  /* isTypedMethod.  Only relevant for methods. */
8290
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8291
};
8292
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8293
static_assert(0 < 1, "There is no slot for us");
8294
static const JSJitInfo ondragexit_setterinfo = {
8295
  { (JSJitGetterOp)set_ondragexit },
8296
  { prototypes::id::Document },
8297
  { PrototypeTraits<prototypes::id::Document>::Depth },
8298
  JSJitInfo::Setter,
8299
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8300
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
8301
  false,  /* isInfallible. False in setters. */
8302
  false,  /* isMovable.  Not relevant for setters. */
8303
  false, /* isEliminatable.  Not relevant for setters. */
8304
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8305
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8306
  false,  /* isTypedMethod.  Only relevant for methods. */
8307
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8308
};
8309
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8310
static_assert(0 < 1, "There is no slot for us");
8311
8312
MOZ_CAN_RUN_SCRIPT static bool
8313
get_ondragleave(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
8314
0
{
8315
0
  AUTO_PROFILER_LABEL_FAST("get Document.ondragleave", DOM, cx);
8316
0
8317
0
  RefPtr<EventHandlerNonNull> result(self->GetOndragleave());
8318
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8319
0
  if (result) {
8320
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8321
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8322
0
      return false;
8323
0
    }
8324
0
    return true;
8325
0
  } else {
8326
0
    args.rval().setNull();
8327
0
    return true;
8328
0
  }
8329
0
}
8330
8331
MOZ_CAN_RUN_SCRIPT static bool
8332
set_ondragleave(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
8333
0
{
8334
0
  AUTO_PROFILER_LABEL_FAST("set Document.ondragleave", DOM, cx);
8335
0
8336
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
8337
0
  if (args[0].isObject()) {
8338
0
    { // scope for tempRoot and tempGlobalRoot if needed
8339
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8340
0
    }
8341
0
  } else {
8342
0
    arg0 = nullptr;
8343
0
  }
8344
0
  self->SetOndragleave(Constify(arg0));
8345
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8346
0
8347
0
  return true;
8348
0
}
8349
8350
static const JSJitInfo ondragleave_getterinfo = {
8351
  { (JSJitGetterOp)get_ondragleave },
8352
  { prototypes::id::Document },
8353
  { PrototypeTraits<prototypes::id::Document>::Depth },
8354
  JSJitInfo::Getter,
8355
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8356
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
8357
  false,  /* isInfallible. False in setters. */
8358
  false,  /* isMovable.  Not relevant for setters. */
8359
  false, /* isEliminatable.  Not relevant for setters. */
8360
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8361
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8362
  false,  /* isTypedMethod.  Only relevant for methods. */
8363
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8364
};
8365
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8366
static_assert(0 < 1, "There is no slot for us");
8367
static const JSJitInfo ondragleave_setterinfo = {
8368
  { (JSJitGetterOp)set_ondragleave },
8369
  { prototypes::id::Document },
8370
  { PrototypeTraits<prototypes::id::Document>::Depth },
8371
  JSJitInfo::Setter,
8372
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8373
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
8374
  false,  /* isInfallible. False in setters. */
8375
  false,  /* isMovable.  Not relevant for setters. */
8376
  false, /* isEliminatable.  Not relevant for setters. */
8377
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8378
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8379
  false,  /* isTypedMethod.  Only relevant for methods. */
8380
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8381
};
8382
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8383
static_assert(0 < 1, "There is no slot for us");
8384
8385
MOZ_CAN_RUN_SCRIPT static bool
8386
get_ondragover(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
8387
0
{
8388
0
  AUTO_PROFILER_LABEL_FAST("get Document.ondragover", DOM, cx);
8389
0
8390
0
  RefPtr<EventHandlerNonNull> result(self->GetOndragover());
8391
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8392
0
  if (result) {
8393
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8394
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8395
0
      return false;
8396
0
    }
8397
0
    return true;
8398
0
  } else {
8399
0
    args.rval().setNull();
8400
0
    return true;
8401
0
  }
8402
0
}
8403
8404
MOZ_CAN_RUN_SCRIPT static bool
8405
set_ondragover(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
8406
0
{
8407
0
  AUTO_PROFILER_LABEL_FAST("set Document.ondragover", DOM, cx);
8408
0
8409
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
8410
0
  if (args[0].isObject()) {
8411
0
    { // scope for tempRoot and tempGlobalRoot if needed
8412
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8413
0
    }
8414
0
  } else {
8415
0
    arg0 = nullptr;
8416
0
  }
8417
0
  self->SetOndragover(Constify(arg0));
8418
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8419
0
8420
0
  return true;
8421
0
}
8422
8423
static const JSJitInfo ondragover_getterinfo = {
8424
  { (JSJitGetterOp)get_ondragover },
8425
  { prototypes::id::Document },
8426
  { PrototypeTraits<prototypes::id::Document>::Depth },
8427
  JSJitInfo::Getter,
8428
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8429
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
8430
  false,  /* isInfallible. False in setters. */
8431
  false,  /* isMovable.  Not relevant for setters. */
8432
  false, /* isEliminatable.  Not relevant for setters. */
8433
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8434
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8435
  false,  /* isTypedMethod.  Only relevant for methods. */
8436
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8437
};
8438
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8439
static_assert(0 < 1, "There is no slot for us");
8440
static const JSJitInfo ondragover_setterinfo = {
8441
  { (JSJitGetterOp)set_ondragover },
8442
  { prototypes::id::Document },
8443
  { PrototypeTraits<prototypes::id::Document>::Depth },
8444
  JSJitInfo::Setter,
8445
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8446
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
8447
  false,  /* isInfallible. False in setters. */
8448
  false,  /* isMovable.  Not relevant for setters. */
8449
  false, /* isEliminatable.  Not relevant for setters. */
8450
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8451
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8452
  false,  /* isTypedMethod.  Only relevant for methods. */
8453
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8454
};
8455
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8456
static_assert(0 < 1, "There is no slot for us");
8457
8458
MOZ_CAN_RUN_SCRIPT static bool
8459
get_ondragstart(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
8460
0
{
8461
0
  AUTO_PROFILER_LABEL_FAST("get Document.ondragstart", DOM, cx);
8462
0
8463
0
  RefPtr<EventHandlerNonNull> result(self->GetOndragstart());
8464
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8465
0
  if (result) {
8466
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8467
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8468
0
      return false;
8469
0
    }
8470
0
    return true;
8471
0
  } else {
8472
0
    args.rval().setNull();
8473
0
    return true;
8474
0
  }
8475
0
}
8476
8477
MOZ_CAN_RUN_SCRIPT static bool
8478
set_ondragstart(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
8479
0
{
8480
0
  AUTO_PROFILER_LABEL_FAST("set Document.ondragstart", DOM, cx);
8481
0
8482
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
8483
0
  if (args[0].isObject()) {
8484
0
    { // scope for tempRoot and tempGlobalRoot if needed
8485
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8486
0
    }
8487
0
  } else {
8488
0
    arg0 = nullptr;
8489
0
  }
8490
0
  self->SetOndragstart(Constify(arg0));
8491
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8492
0
8493
0
  return true;
8494
0
}
8495
8496
static const JSJitInfo ondragstart_getterinfo = {
8497
  { (JSJitGetterOp)get_ondragstart },
8498
  { prototypes::id::Document },
8499
  { PrototypeTraits<prototypes::id::Document>::Depth },
8500
  JSJitInfo::Getter,
8501
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8502
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
8503
  false,  /* isInfallible. False in setters. */
8504
  false,  /* isMovable.  Not relevant for setters. */
8505
  false, /* isEliminatable.  Not relevant for setters. */
8506
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8507
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8508
  false,  /* isTypedMethod.  Only relevant for methods. */
8509
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8510
};
8511
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8512
static_assert(0 < 1, "There is no slot for us");
8513
static const JSJitInfo ondragstart_setterinfo = {
8514
  { (JSJitGetterOp)set_ondragstart },
8515
  { prototypes::id::Document },
8516
  { PrototypeTraits<prototypes::id::Document>::Depth },
8517
  JSJitInfo::Setter,
8518
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8519
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
8520
  false,  /* isInfallible. False in setters. */
8521
  false,  /* isMovable.  Not relevant for setters. */
8522
  false, /* isEliminatable.  Not relevant for setters. */
8523
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8524
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8525
  false,  /* isTypedMethod.  Only relevant for methods. */
8526
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8527
};
8528
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8529
static_assert(0 < 1, "There is no slot for us");
8530
8531
MOZ_CAN_RUN_SCRIPT static bool
8532
get_ondrop(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
8533
0
{
8534
0
  AUTO_PROFILER_LABEL_FAST("get Document.ondrop", DOM, cx);
8535
0
8536
0
  RefPtr<EventHandlerNonNull> result(self->GetOndrop());
8537
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8538
0
  if (result) {
8539
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8540
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8541
0
      return false;
8542
0
    }
8543
0
    return true;
8544
0
  } else {
8545
0
    args.rval().setNull();
8546
0
    return true;
8547
0
  }
8548
0
}
8549
8550
MOZ_CAN_RUN_SCRIPT static bool
8551
set_ondrop(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
8552
0
{
8553
0
  AUTO_PROFILER_LABEL_FAST("set Document.ondrop", DOM, cx);
8554
0
8555
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
8556
0
  if (args[0].isObject()) {
8557
0
    { // scope for tempRoot and tempGlobalRoot if needed
8558
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8559
0
    }
8560
0
  } else {
8561
0
    arg0 = nullptr;
8562
0
  }
8563
0
  self->SetOndrop(Constify(arg0));
8564
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8565
0
8566
0
  return true;
8567
0
}
8568
8569
static const JSJitInfo ondrop_getterinfo = {
8570
  { (JSJitGetterOp)get_ondrop },
8571
  { prototypes::id::Document },
8572
  { PrototypeTraits<prototypes::id::Document>::Depth },
8573
  JSJitInfo::Getter,
8574
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8575
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
8576
  false,  /* isInfallible. False in setters. */
8577
  false,  /* isMovable.  Not relevant for setters. */
8578
  false, /* isEliminatable.  Not relevant for setters. */
8579
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8580
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8581
  false,  /* isTypedMethod.  Only relevant for methods. */
8582
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8583
};
8584
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8585
static_assert(0 < 1, "There is no slot for us");
8586
static const JSJitInfo ondrop_setterinfo = {
8587
  { (JSJitGetterOp)set_ondrop },
8588
  { prototypes::id::Document },
8589
  { PrototypeTraits<prototypes::id::Document>::Depth },
8590
  JSJitInfo::Setter,
8591
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8592
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
8593
  false,  /* isInfallible. False in setters. */
8594
  false,  /* isMovable.  Not relevant for setters. */
8595
  false, /* isEliminatable.  Not relevant for setters. */
8596
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8597
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8598
  false,  /* isTypedMethod.  Only relevant for methods. */
8599
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8600
};
8601
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8602
static_assert(0 < 1, "There is no slot for us");
8603
8604
MOZ_CAN_RUN_SCRIPT static bool
8605
get_ondurationchange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
8606
0
{
8607
0
  AUTO_PROFILER_LABEL_FAST("get Document.ondurationchange", DOM, cx);
8608
0
8609
0
  RefPtr<EventHandlerNonNull> result(self->GetOndurationchange());
8610
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8611
0
  if (result) {
8612
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8613
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8614
0
      return false;
8615
0
    }
8616
0
    return true;
8617
0
  } else {
8618
0
    args.rval().setNull();
8619
0
    return true;
8620
0
  }
8621
0
}
8622
8623
MOZ_CAN_RUN_SCRIPT static bool
8624
set_ondurationchange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
8625
0
{
8626
0
  AUTO_PROFILER_LABEL_FAST("set Document.ondurationchange", DOM, cx);
8627
0
8628
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
8629
0
  if (args[0].isObject()) {
8630
0
    { // scope for tempRoot and tempGlobalRoot if needed
8631
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8632
0
    }
8633
0
  } else {
8634
0
    arg0 = nullptr;
8635
0
  }
8636
0
  self->SetOndurationchange(Constify(arg0));
8637
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8638
0
8639
0
  return true;
8640
0
}
8641
8642
static const JSJitInfo ondurationchange_getterinfo = {
8643
  { (JSJitGetterOp)get_ondurationchange },
8644
  { prototypes::id::Document },
8645
  { PrototypeTraits<prototypes::id::Document>::Depth },
8646
  JSJitInfo::Getter,
8647
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8648
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
8649
  false,  /* isInfallible. False in setters. */
8650
  false,  /* isMovable.  Not relevant for setters. */
8651
  false, /* isEliminatable.  Not relevant for setters. */
8652
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8653
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8654
  false,  /* isTypedMethod.  Only relevant for methods. */
8655
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8656
};
8657
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8658
static_assert(0 < 1, "There is no slot for us");
8659
static const JSJitInfo ondurationchange_setterinfo = {
8660
  { (JSJitGetterOp)set_ondurationchange },
8661
  { prototypes::id::Document },
8662
  { PrototypeTraits<prototypes::id::Document>::Depth },
8663
  JSJitInfo::Setter,
8664
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8665
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
8666
  false,  /* isInfallible. False in setters. */
8667
  false,  /* isMovable.  Not relevant for setters. */
8668
  false, /* isEliminatable.  Not relevant for setters. */
8669
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8670
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8671
  false,  /* isTypedMethod.  Only relevant for methods. */
8672
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8673
};
8674
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8675
static_assert(0 < 1, "There is no slot for us");
8676
8677
MOZ_CAN_RUN_SCRIPT static bool
8678
get_onemptied(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
8679
0
{
8680
0
  AUTO_PROFILER_LABEL_FAST("get Document.onemptied", DOM, cx);
8681
0
8682
0
  RefPtr<EventHandlerNonNull> result(self->GetOnemptied());
8683
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8684
0
  if (result) {
8685
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8686
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8687
0
      return false;
8688
0
    }
8689
0
    return true;
8690
0
  } else {
8691
0
    args.rval().setNull();
8692
0
    return true;
8693
0
  }
8694
0
}
8695
8696
MOZ_CAN_RUN_SCRIPT static bool
8697
set_onemptied(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
8698
0
{
8699
0
  AUTO_PROFILER_LABEL_FAST("set Document.onemptied", DOM, cx);
8700
0
8701
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
8702
0
  if (args[0].isObject()) {
8703
0
    { // scope for tempRoot and tempGlobalRoot if needed
8704
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8705
0
    }
8706
0
  } else {
8707
0
    arg0 = nullptr;
8708
0
  }
8709
0
  self->SetOnemptied(Constify(arg0));
8710
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8711
0
8712
0
  return true;
8713
0
}
8714
8715
static const JSJitInfo onemptied_getterinfo = {
8716
  { (JSJitGetterOp)get_onemptied },
8717
  { prototypes::id::Document },
8718
  { PrototypeTraits<prototypes::id::Document>::Depth },
8719
  JSJitInfo::Getter,
8720
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8721
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
8722
  false,  /* isInfallible. False in setters. */
8723
  false,  /* isMovable.  Not relevant for setters. */
8724
  false, /* isEliminatable.  Not relevant for setters. */
8725
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8726
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8727
  false,  /* isTypedMethod.  Only relevant for methods. */
8728
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8729
};
8730
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8731
static_assert(0 < 1, "There is no slot for us");
8732
static const JSJitInfo onemptied_setterinfo = {
8733
  { (JSJitGetterOp)set_onemptied },
8734
  { prototypes::id::Document },
8735
  { PrototypeTraits<prototypes::id::Document>::Depth },
8736
  JSJitInfo::Setter,
8737
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8738
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
8739
  false,  /* isInfallible. False in setters. */
8740
  false,  /* isMovable.  Not relevant for setters. */
8741
  false, /* isEliminatable.  Not relevant for setters. */
8742
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8743
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8744
  false,  /* isTypedMethod.  Only relevant for methods. */
8745
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8746
};
8747
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8748
static_assert(0 < 1, "There is no slot for us");
8749
8750
MOZ_CAN_RUN_SCRIPT static bool
8751
get_onended(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
8752
0
{
8753
0
  AUTO_PROFILER_LABEL_FAST("get Document.onended", DOM, cx);
8754
0
8755
0
  RefPtr<EventHandlerNonNull> result(self->GetOnended());
8756
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8757
0
  if (result) {
8758
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8759
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8760
0
      return false;
8761
0
    }
8762
0
    return true;
8763
0
  } else {
8764
0
    args.rval().setNull();
8765
0
    return true;
8766
0
  }
8767
0
}
8768
8769
MOZ_CAN_RUN_SCRIPT static bool
8770
set_onended(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
8771
0
{
8772
0
  AUTO_PROFILER_LABEL_FAST("set Document.onended", DOM, cx);
8773
0
8774
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
8775
0
  if (args[0].isObject()) {
8776
0
    { // scope for tempRoot and tempGlobalRoot if needed
8777
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8778
0
    }
8779
0
  } else {
8780
0
    arg0 = nullptr;
8781
0
  }
8782
0
  self->SetOnended(Constify(arg0));
8783
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8784
0
8785
0
  return true;
8786
0
}
8787
8788
static const JSJitInfo onended_getterinfo = {
8789
  { (JSJitGetterOp)get_onended },
8790
  { prototypes::id::Document },
8791
  { PrototypeTraits<prototypes::id::Document>::Depth },
8792
  JSJitInfo::Getter,
8793
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8794
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
8795
  false,  /* isInfallible. False in setters. */
8796
  false,  /* isMovable.  Not relevant for setters. */
8797
  false, /* isEliminatable.  Not relevant for setters. */
8798
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8799
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8800
  false,  /* isTypedMethod.  Only relevant for methods. */
8801
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8802
};
8803
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8804
static_assert(0 < 1, "There is no slot for us");
8805
static const JSJitInfo onended_setterinfo = {
8806
  { (JSJitGetterOp)set_onended },
8807
  { prototypes::id::Document },
8808
  { PrototypeTraits<prototypes::id::Document>::Depth },
8809
  JSJitInfo::Setter,
8810
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8811
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
8812
  false,  /* isInfallible. False in setters. */
8813
  false,  /* isMovable.  Not relevant for setters. */
8814
  false, /* isEliminatable.  Not relevant for setters. */
8815
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8816
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8817
  false,  /* isTypedMethod.  Only relevant for methods. */
8818
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8819
};
8820
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8821
static_assert(0 < 1, "There is no slot for us");
8822
8823
MOZ_CAN_RUN_SCRIPT static bool
8824
get_oninput(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
8825
0
{
8826
0
  AUTO_PROFILER_LABEL_FAST("get Document.oninput", DOM, cx);
8827
0
8828
0
  RefPtr<EventHandlerNonNull> result(self->GetOninput());
8829
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8830
0
  if (result) {
8831
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8832
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8833
0
      return false;
8834
0
    }
8835
0
    return true;
8836
0
  } else {
8837
0
    args.rval().setNull();
8838
0
    return true;
8839
0
  }
8840
0
}
8841
8842
MOZ_CAN_RUN_SCRIPT static bool
8843
set_oninput(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
8844
0
{
8845
0
  AUTO_PROFILER_LABEL_FAST("set Document.oninput", DOM, cx);
8846
0
8847
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
8848
0
  if (args[0].isObject()) {
8849
0
    { // scope for tempRoot and tempGlobalRoot if needed
8850
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8851
0
    }
8852
0
  } else {
8853
0
    arg0 = nullptr;
8854
0
  }
8855
0
  self->SetOninput(Constify(arg0));
8856
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8857
0
8858
0
  return true;
8859
0
}
8860
8861
static const JSJitInfo oninput_getterinfo = {
8862
  { (JSJitGetterOp)get_oninput },
8863
  { prototypes::id::Document },
8864
  { PrototypeTraits<prototypes::id::Document>::Depth },
8865
  JSJitInfo::Getter,
8866
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8867
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
8868
  false,  /* isInfallible. False in setters. */
8869
  false,  /* isMovable.  Not relevant for setters. */
8870
  false, /* isEliminatable.  Not relevant for setters. */
8871
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8872
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8873
  false,  /* isTypedMethod.  Only relevant for methods. */
8874
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8875
};
8876
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8877
static_assert(0 < 1, "There is no slot for us");
8878
static const JSJitInfo oninput_setterinfo = {
8879
  { (JSJitGetterOp)set_oninput },
8880
  { prototypes::id::Document },
8881
  { PrototypeTraits<prototypes::id::Document>::Depth },
8882
  JSJitInfo::Setter,
8883
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8884
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
8885
  false,  /* isInfallible. False in setters. */
8886
  false,  /* isMovable.  Not relevant for setters. */
8887
  false, /* isEliminatable.  Not relevant for setters. */
8888
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8889
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8890
  false,  /* isTypedMethod.  Only relevant for methods. */
8891
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8892
};
8893
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8894
static_assert(0 < 1, "There is no slot for us");
8895
8896
MOZ_CAN_RUN_SCRIPT static bool
8897
get_oninvalid(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
8898
0
{
8899
0
  AUTO_PROFILER_LABEL_FAST("get Document.oninvalid", DOM, cx);
8900
0
8901
0
  RefPtr<EventHandlerNonNull> result(self->GetOninvalid());
8902
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8903
0
  if (result) {
8904
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8905
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8906
0
      return false;
8907
0
    }
8908
0
    return true;
8909
0
  } else {
8910
0
    args.rval().setNull();
8911
0
    return true;
8912
0
  }
8913
0
}
8914
8915
MOZ_CAN_RUN_SCRIPT static bool
8916
set_oninvalid(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
8917
0
{
8918
0
  AUTO_PROFILER_LABEL_FAST("set Document.oninvalid", DOM, cx);
8919
0
8920
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
8921
0
  if (args[0].isObject()) {
8922
0
    { // scope for tempRoot and tempGlobalRoot if needed
8923
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8924
0
    }
8925
0
  } else {
8926
0
    arg0 = nullptr;
8927
0
  }
8928
0
  self->SetOninvalid(Constify(arg0));
8929
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8930
0
8931
0
  return true;
8932
0
}
8933
8934
static const JSJitInfo oninvalid_getterinfo = {
8935
  { (JSJitGetterOp)get_oninvalid },
8936
  { prototypes::id::Document },
8937
  { PrototypeTraits<prototypes::id::Document>::Depth },
8938
  JSJitInfo::Getter,
8939
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8940
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
8941
  false,  /* isInfallible. False in setters. */
8942
  false,  /* isMovable.  Not relevant for setters. */
8943
  false, /* isEliminatable.  Not relevant for setters. */
8944
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8945
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8946
  false,  /* isTypedMethod.  Only relevant for methods. */
8947
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8948
};
8949
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8950
static_assert(0 < 1, "There is no slot for us");
8951
static const JSJitInfo oninvalid_setterinfo = {
8952
  { (JSJitGetterOp)set_oninvalid },
8953
  { prototypes::id::Document },
8954
  { PrototypeTraits<prototypes::id::Document>::Depth },
8955
  JSJitInfo::Setter,
8956
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
8957
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
8958
  false,  /* isInfallible. False in setters. */
8959
  false,  /* isMovable.  Not relevant for setters. */
8960
  false, /* isEliminatable.  Not relevant for setters. */
8961
  false, /* isAlwaysInSlot.  Only relevant for getters. */
8962
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
8963
  false,  /* isTypedMethod.  Only relevant for methods. */
8964
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
8965
};
8966
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
8967
static_assert(0 < 1, "There is no slot for us");
8968
8969
MOZ_CAN_RUN_SCRIPT static bool
8970
get_onkeydown(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
8971
0
{
8972
0
  AUTO_PROFILER_LABEL_FAST("get Document.onkeydown", DOM, cx);
8973
0
8974
0
  RefPtr<EventHandlerNonNull> result(self->GetOnkeydown());
8975
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
8976
0
  if (result) {
8977
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8978
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8979
0
      return false;
8980
0
    }
8981
0
    return true;
8982
0
  } else {
8983
0
    args.rval().setNull();
8984
0
    return true;
8985
0
  }
8986
0
}
8987
8988
MOZ_CAN_RUN_SCRIPT static bool
8989
set_onkeydown(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
8990
0
{
8991
0
  AUTO_PROFILER_LABEL_FAST("set Document.onkeydown", DOM, cx);
8992
0
8993
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
8994
0
  if (args[0].isObject()) {
8995
0
    { // scope for tempRoot and tempGlobalRoot if needed
8996
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8997
0
    }
8998
0
  } else {
8999
0
    arg0 = nullptr;
9000
0
  }
9001
0
  self->SetOnkeydown(Constify(arg0));
9002
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9003
0
9004
0
  return true;
9005
0
}
9006
9007
static const JSJitInfo onkeydown_getterinfo = {
9008
  { (JSJitGetterOp)get_onkeydown },
9009
  { prototypes::id::Document },
9010
  { PrototypeTraits<prototypes::id::Document>::Depth },
9011
  JSJitInfo::Getter,
9012
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9013
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
9014
  false,  /* isInfallible. False in setters. */
9015
  false,  /* isMovable.  Not relevant for setters. */
9016
  false, /* isEliminatable.  Not relevant for setters. */
9017
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9018
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9019
  false,  /* isTypedMethod.  Only relevant for methods. */
9020
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9021
};
9022
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9023
static_assert(0 < 1, "There is no slot for us");
9024
static const JSJitInfo onkeydown_setterinfo = {
9025
  { (JSJitGetterOp)set_onkeydown },
9026
  { prototypes::id::Document },
9027
  { PrototypeTraits<prototypes::id::Document>::Depth },
9028
  JSJitInfo::Setter,
9029
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9030
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
9031
  false,  /* isInfallible. False in setters. */
9032
  false,  /* isMovable.  Not relevant for setters. */
9033
  false, /* isEliminatable.  Not relevant for setters. */
9034
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9035
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9036
  false,  /* isTypedMethod.  Only relevant for methods. */
9037
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9038
};
9039
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9040
static_assert(0 < 1, "There is no slot for us");
9041
9042
MOZ_CAN_RUN_SCRIPT static bool
9043
get_onkeypress(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
9044
0
{
9045
0
  AUTO_PROFILER_LABEL_FAST("get Document.onkeypress", DOM, cx);
9046
0
9047
0
  RefPtr<EventHandlerNonNull> result(self->GetOnkeypress());
9048
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9049
0
  if (result) {
9050
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
9051
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
9052
0
      return false;
9053
0
    }
9054
0
    return true;
9055
0
  } else {
9056
0
    args.rval().setNull();
9057
0
    return true;
9058
0
  }
9059
0
}
9060
9061
MOZ_CAN_RUN_SCRIPT static bool
9062
set_onkeypress(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
9063
0
{
9064
0
  AUTO_PROFILER_LABEL_FAST("set Document.onkeypress", DOM, cx);
9065
0
9066
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
9067
0
  if (args[0].isObject()) {
9068
0
    { // scope for tempRoot and tempGlobalRoot if needed
9069
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
9070
0
    }
9071
0
  } else {
9072
0
    arg0 = nullptr;
9073
0
  }
9074
0
  self->SetOnkeypress(Constify(arg0));
9075
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9076
0
9077
0
  return true;
9078
0
}
9079
9080
static const JSJitInfo onkeypress_getterinfo = {
9081
  { (JSJitGetterOp)get_onkeypress },
9082
  { prototypes::id::Document },
9083
  { PrototypeTraits<prototypes::id::Document>::Depth },
9084
  JSJitInfo::Getter,
9085
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9086
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
9087
  false,  /* isInfallible. False in setters. */
9088
  false,  /* isMovable.  Not relevant for setters. */
9089
  false, /* isEliminatable.  Not relevant for setters. */
9090
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9091
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9092
  false,  /* isTypedMethod.  Only relevant for methods. */
9093
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9094
};
9095
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9096
static_assert(0 < 1, "There is no slot for us");
9097
static const JSJitInfo onkeypress_setterinfo = {
9098
  { (JSJitGetterOp)set_onkeypress },
9099
  { prototypes::id::Document },
9100
  { PrototypeTraits<prototypes::id::Document>::Depth },
9101
  JSJitInfo::Setter,
9102
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9103
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
9104
  false,  /* isInfallible. False in setters. */
9105
  false,  /* isMovable.  Not relevant for setters. */
9106
  false, /* isEliminatable.  Not relevant for setters. */
9107
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9108
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9109
  false,  /* isTypedMethod.  Only relevant for methods. */
9110
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9111
};
9112
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9113
static_assert(0 < 1, "There is no slot for us");
9114
9115
MOZ_CAN_RUN_SCRIPT static bool
9116
get_onkeyup(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
9117
0
{
9118
0
  AUTO_PROFILER_LABEL_FAST("get Document.onkeyup", DOM, cx);
9119
0
9120
0
  RefPtr<EventHandlerNonNull> result(self->GetOnkeyup());
9121
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9122
0
  if (result) {
9123
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
9124
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
9125
0
      return false;
9126
0
    }
9127
0
    return true;
9128
0
  } else {
9129
0
    args.rval().setNull();
9130
0
    return true;
9131
0
  }
9132
0
}
9133
9134
MOZ_CAN_RUN_SCRIPT static bool
9135
set_onkeyup(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
9136
0
{
9137
0
  AUTO_PROFILER_LABEL_FAST("set Document.onkeyup", DOM, cx);
9138
0
9139
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
9140
0
  if (args[0].isObject()) {
9141
0
    { // scope for tempRoot and tempGlobalRoot if needed
9142
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
9143
0
    }
9144
0
  } else {
9145
0
    arg0 = nullptr;
9146
0
  }
9147
0
  self->SetOnkeyup(Constify(arg0));
9148
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9149
0
9150
0
  return true;
9151
0
}
9152
9153
static const JSJitInfo onkeyup_getterinfo = {
9154
  { (JSJitGetterOp)get_onkeyup },
9155
  { prototypes::id::Document },
9156
  { PrototypeTraits<prototypes::id::Document>::Depth },
9157
  JSJitInfo::Getter,
9158
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9159
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
9160
  false,  /* isInfallible. False in setters. */
9161
  false,  /* isMovable.  Not relevant for setters. */
9162
  false, /* isEliminatable.  Not relevant for setters. */
9163
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9164
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9165
  false,  /* isTypedMethod.  Only relevant for methods. */
9166
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9167
};
9168
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9169
static_assert(0 < 1, "There is no slot for us");
9170
static const JSJitInfo onkeyup_setterinfo = {
9171
  { (JSJitGetterOp)set_onkeyup },
9172
  { prototypes::id::Document },
9173
  { PrototypeTraits<prototypes::id::Document>::Depth },
9174
  JSJitInfo::Setter,
9175
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9176
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
9177
  false,  /* isInfallible. False in setters. */
9178
  false,  /* isMovable.  Not relevant for setters. */
9179
  false, /* isEliminatable.  Not relevant for setters. */
9180
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9181
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9182
  false,  /* isTypedMethod.  Only relevant for methods. */
9183
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9184
};
9185
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9186
static_assert(0 < 1, "There is no slot for us");
9187
9188
MOZ_CAN_RUN_SCRIPT static bool
9189
get_onload(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
9190
0
{
9191
0
  AUTO_PROFILER_LABEL_FAST("get Document.onload", DOM, cx);
9192
0
9193
0
  RefPtr<EventHandlerNonNull> result(self->GetOnload());
9194
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9195
0
  if (result) {
9196
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
9197
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
9198
0
      return false;
9199
0
    }
9200
0
    return true;
9201
0
  } else {
9202
0
    args.rval().setNull();
9203
0
    return true;
9204
0
  }
9205
0
}
9206
9207
MOZ_CAN_RUN_SCRIPT static bool
9208
set_onload(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
9209
0
{
9210
0
  AUTO_PROFILER_LABEL_FAST("set Document.onload", DOM, cx);
9211
0
9212
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
9213
0
  if (args[0].isObject()) {
9214
0
    { // scope for tempRoot and tempGlobalRoot if needed
9215
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
9216
0
    }
9217
0
  } else {
9218
0
    arg0 = nullptr;
9219
0
  }
9220
0
  self->SetOnload(Constify(arg0));
9221
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9222
0
9223
0
  return true;
9224
0
}
9225
9226
static const JSJitInfo onload_getterinfo = {
9227
  { (JSJitGetterOp)get_onload },
9228
  { prototypes::id::Document },
9229
  { PrototypeTraits<prototypes::id::Document>::Depth },
9230
  JSJitInfo::Getter,
9231
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9232
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
9233
  false,  /* isInfallible. False in setters. */
9234
  false,  /* isMovable.  Not relevant for setters. */
9235
  false, /* isEliminatable.  Not relevant for setters. */
9236
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9237
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9238
  false,  /* isTypedMethod.  Only relevant for methods. */
9239
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9240
};
9241
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9242
static_assert(0 < 1, "There is no slot for us");
9243
static const JSJitInfo onload_setterinfo = {
9244
  { (JSJitGetterOp)set_onload },
9245
  { prototypes::id::Document },
9246
  { PrototypeTraits<prototypes::id::Document>::Depth },
9247
  JSJitInfo::Setter,
9248
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9249
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
9250
  false,  /* isInfallible. False in setters. */
9251
  false,  /* isMovable.  Not relevant for setters. */
9252
  false, /* isEliminatable.  Not relevant for setters. */
9253
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9254
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9255
  false,  /* isTypedMethod.  Only relevant for methods. */
9256
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9257
};
9258
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9259
static_assert(0 < 1, "There is no slot for us");
9260
9261
MOZ_CAN_RUN_SCRIPT static bool
9262
get_onloadeddata(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
9263
0
{
9264
0
  AUTO_PROFILER_LABEL_FAST("get Document.onloadeddata", DOM, cx);
9265
0
9266
0
  RefPtr<EventHandlerNonNull> result(self->GetOnloadeddata());
9267
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9268
0
  if (result) {
9269
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
9270
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
9271
0
      return false;
9272
0
    }
9273
0
    return true;
9274
0
  } else {
9275
0
    args.rval().setNull();
9276
0
    return true;
9277
0
  }
9278
0
}
9279
9280
MOZ_CAN_RUN_SCRIPT static bool
9281
set_onloadeddata(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
9282
0
{
9283
0
  AUTO_PROFILER_LABEL_FAST("set Document.onloadeddata", DOM, cx);
9284
0
9285
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
9286
0
  if (args[0].isObject()) {
9287
0
    { // scope for tempRoot and tempGlobalRoot if needed
9288
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
9289
0
    }
9290
0
  } else {
9291
0
    arg0 = nullptr;
9292
0
  }
9293
0
  self->SetOnloadeddata(Constify(arg0));
9294
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9295
0
9296
0
  return true;
9297
0
}
9298
9299
static const JSJitInfo onloadeddata_getterinfo = {
9300
  { (JSJitGetterOp)get_onloadeddata },
9301
  { prototypes::id::Document },
9302
  { PrototypeTraits<prototypes::id::Document>::Depth },
9303
  JSJitInfo::Getter,
9304
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9305
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
9306
  false,  /* isInfallible. False in setters. */
9307
  false,  /* isMovable.  Not relevant for setters. */
9308
  false, /* isEliminatable.  Not relevant for setters. */
9309
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9310
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9311
  false,  /* isTypedMethod.  Only relevant for methods. */
9312
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9313
};
9314
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9315
static_assert(0 < 1, "There is no slot for us");
9316
static const JSJitInfo onloadeddata_setterinfo = {
9317
  { (JSJitGetterOp)set_onloadeddata },
9318
  { prototypes::id::Document },
9319
  { PrototypeTraits<prototypes::id::Document>::Depth },
9320
  JSJitInfo::Setter,
9321
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9322
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
9323
  false,  /* isInfallible. False in setters. */
9324
  false,  /* isMovable.  Not relevant for setters. */
9325
  false, /* isEliminatable.  Not relevant for setters. */
9326
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9327
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9328
  false,  /* isTypedMethod.  Only relevant for methods. */
9329
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9330
};
9331
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9332
static_assert(0 < 1, "There is no slot for us");
9333
9334
MOZ_CAN_RUN_SCRIPT static bool
9335
get_onloadedmetadata(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
9336
0
{
9337
0
  AUTO_PROFILER_LABEL_FAST("get Document.onloadedmetadata", DOM, cx);
9338
0
9339
0
  RefPtr<EventHandlerNonNull> result(self->GetOnloadedmetadata());
9340
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9341
0
  if (result) {
9342
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
9343
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
9344
0
      return false;
9345
0
    }
9346
0
    return true;
9347
0
  } else {
9348
0
    args.rval().setNull();
9349
0
    return true;
9350
0
  }
9351
0
}
9352
9353
MOZ_CAN_RUN_SCRIPT static bool
9354
set_onloadedmetadata(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
9355
0
{
9356
0
  AUTO_PROFILER_LABEL_FAST("set Document.onloadedmetadata", DOM, cx);
9357
0
9358
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
9359
0
  if (args[0].isObject()) {
9360
0
    { // scope for tempRoot and tempGlobalRoot if needed
9361
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
9362
0
    }
9363
0
  } else {
9364
0
    arg0 = nullptr;
9365
0
  }
9366
0
  self->SetOnloadedmetadata(Constify(arg0));
9367
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9368
0
9369
0
  return true;
9370
0
}
9371
9372
static const JSJitInfo onloadedmetadata_getterinfo = {
9373
  { (JSJitGetterOp)get_onloadedmetadata },
9374
  { prototypes::id::Document },
9375
  { PrototypeTraits<prototypes::id::Document>::Depth },
9376
  JSJitInfo::Getter,
9377
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9378
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
9379
  false,  /* isInfallible. False in setters. */
9380
  false,  /* isMovable.  Not relevant for setters. */
9381
  false, /* isEliminatable.  Not relevant for setters. */
9382
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9383
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9384
  false,  /* isTypedMethod.  Only relevant for methods. */
9385
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9386
};
9387
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9388
static_assert(0 < 1, "There is no slot for us");
9389
static const JSJitInfo onloadedmetadata_setterinfo = {
9390
  { (JSJitGetterOp)set_onloadedmetadata },
9391
  { prototypes::id::Document },
9392
  { PrototypeTraits<prototypes::id::Document>::Depth },
9393
  JSJitInfo::Setter,
9394
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9395
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
9396
  false,  /* isInfallible. False in setters. */
9397
  false,  /* isMovable.  Not relevant for setters. */
9398
  false, /* isEliminatable.  Not relevant for setters. */
9399
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9400
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9401
  false,  /* isTypedMethod.  Only relevant for methods. */
9402
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9403
};
9404
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9405
static_assert(0 < 1, "There is no slot for us");
9406
9407
MOZ_CAN_RUN_SCRIPT static bool
9408
get_onloadend(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
9409
0
{
9410
0
  AUTO_PROFILER_LABEL_FAST("get Document.onloadend", DOM, cx);
9411
0
9412
0
  RefPtr<EventHandlerNonNull> result(self->GetOnloadend());
9413
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9414
0
  if (result) {
9415
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
9416
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
9417
0
      return false;
9418
0
    }
9419
0
    return true;
9420
0
  } else {
9421
0
    args.rval().setNull();
9422
0
    return true;
9423
0
  }
9424
0
}
9425
9426
MOZ_CAN_RUN_SCRIPT static bool
9427
set_onloadend(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
9428
0
{
9429
0
  AUTO_PROFILER_LABEL_FAST("set Document.onloadend", DOM, cx);
9430
0
9431
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
9432
0
  if (args[0].isObject()) {
9433
0
    { // scope for tempRoot and tempGlobalRoot if needed
9434
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
9435
0
    }
9436
0
  } else {
9437
0
    arg0 = nullptr;
9438
0
  }
9439
0
  self->SetOnloadend(Constify(arg0));
9440
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9441
0
9442
0
  return true;
9443
0
}
9444
9445
static const JSJitInfo onloadend_getterinfo = {
9446
  { (JSJitGetterOp)get_onloadend },
9447
  { prototypes::id::Document },
9448
  { PrototypeTraits<prototypes::id::Document>::Depth },
9449
  JSJitInfo::Getter,
9450
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9451
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
9452
  false,  /* isInfallible. False in setters. */
9453
  false,  /* isMovable.  Not relevant for setters. */
9454
  false, /* isEliminatable.  Not relevant for setters. */
9455
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9456
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9457
  false,  /* isTypedMethod.  Only relevant for methods. */
9458
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9459
};
9460
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9461
static_assert(0 < 1, "There is no slot for us");
9462
static const JSJitInfo onloadend_setterinfo = {
9463
  { (JSJitGetterOp)set_onloadend },
9464
  { prototypes::id::Document },
9465
  { PrototypeTraits<prototypes::id::Document>::Depth },
9466
  JSJitInfo::Setter,
9467
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9468
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
9469
  false,  /* isInfallible. False in setters. */
9470
  false,  /* isMovable.  Not relevant for setters. */
9471
  false, /* isEliminatable.  Not relevant for setters. */
9472
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9473
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9474
  false,  /* isTypedMethod.  Only relevant for methods. */
9475
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9476
};
9477
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9478
static_assert(0 < 1, "There is no slot for us");
9479
9480
MOZ_CAN_RUN_SCRIPT static bool
9481
get_onloadstart(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
9482
0
{
9483
0
  AUTO_PROFILER_LABEL_FAST("get Document.onloadstart", DOM, cx);
9484
0
9485
0
  RefPtr<EventHandlerNonNull> result(self->GetOnloadstart());
9486
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9487
0
  if (result) {
9488
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
9489
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
9490
0
      return false;
9491
0
    }
9492
0
    return true;
9493
0
  } else {
9494
0
    args.rval().setNull();
9495
0
    return true;
9496
0
  }
9497
0
}
9498
9499
MOZ_CAN_RUN_SCRIPT static bool
9500
set_onloadstart(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
9501
0
{
9502
0
  AUTO_PROFILER_LABEL_FAST("set Document.onloadstart", DOM, cx);
9503
0
9504
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
9505
0
  if (args[0].isObject()) {
9506
0
    { // scope for tempRoot and tempGlobalRoot if needed
9507
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
9508
0
    }
9509
0
  } else {
9510
0
    arg0 = nullptr;
9511
0
  }
9512
0
  self->SetOnloadstart(Constify(arg0));
9513
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9514
0
9515
0
  return true;
9516
0
}
9517
9518
static const JSJitInfo onloadstart_getterinfo = {
9519
  { (JSJitGetterOp)get_onloadstart },
9520
  { prototypes::id::Document },
9521
  { PrototypeTraits<prototypes::id::Document>::Depth },
9522
  JSJitInfo::Getter,
9523
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9524
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
9525
  false,  /* isInfallible. False in setters. */
9526
  false,  /* isMovable.  Not relevant for setters. */
9527
  false, /* isEliminatable.  Not relevant for setters. */
9528
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9529
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9530
  false,  /* isTypedMethod.  Only relevant for methods. */
9531
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9532
};
9533
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9534
static_assert(0 < 1, "There is no slot for us");
9535
static const JSJitInfo onloadstart_setterinfo = {
9536
  { (JSJitGetterOp)set_onloadstart },
9537
  { prototypes::id::Document },
9538
  { PrototypeTraits<prototypes::id::Document>::Depth },
9539
  JSJitInfo::Setter,
9540
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9541
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
9542
  false,  /* isInfallible. False in setters. */
9543
  false,  /* isMovable.  Not relevant for setters. */
9544
  false, /* isEliminatable.  Not relevant for setters. */
9545
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9546
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9547
  false,  /* isTypedMethod.  Only relevant for methods. */
9548
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9549
};
9550
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9551
static_assert(0 < 1, "There is no slot for us");
9552
9553
MOZ_CAN_RUN_SCRIPT static bool
9554
get_onmousedown(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
9555
0
{
9556
0
  AUTO_PROFILER_LABEL_FAST("get Document.onmousedown", DOM, cx);
9557
0
9558
0
  RefPtr<EventHandlerNonNull> result(self->GetOnmousedown());
9559
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9560
0
  if (result) {
9561
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
9562
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
9563
0
      return false;
9564
0
    }
9565
0
    return true;
9566
0
  } else {
9567
0
    args.rval().setNull();
9568
0
    return true;
9569
0
  }
9570
0
}
9571
9572
MOZ_CAN_RUN_SCRIPT static bool
9573
set_onmousedown(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
9574
0
{
9575
0
  AUTO_PROFILER_LABEL_FAST("set Document.onmousedown", DOM, cx);
9576
0
9577
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
9578
0
  if (args[0].isObject()) {
9579
0
    { // scope for tempRoot and tempGlobalRoot if needed
9580
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
9581
0
    }
9582
0
  } else {
9583
0
    arg0 = nullptr;
9584
0
  }
9585
0
  self->SetOnmousedown(Constify(arg0));
9586
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9587
0
9588
0
  return true;
9589
0
}
9590
9591
static const JSJitInfo onmousedown_getterinfo = {
9592
  { (JSJitGetterOp)get_onmousedown },
9593
  { prototypes::id::Document },
9594
  { PrototypeTraits<prototypes::id::Document>::Depth },
9595
  JSJitInfo::Getter,
9596
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9597
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
9598
  false,  /* isInfallible. False in setters. */
9599
  false,  /* isMovable.  Not relevant for setters. */
9600
  false, /* isEliminatable.  Not relevant for setters. */
9601
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9602
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9603
  false,  /* isTypedMethod.  Only relevant for methods. */
9604
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9605
};
9606
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9607
static_assert(0 < 1, "There is no slot for us");
9608
static const JSJitInfo onmousedown_setterinfo = {
9609
  { (JSJitGetterOp)set_onmousedown },
9610
  { prototypes::id::Document },
9611
  { PrototypeTraits<prototypes::id::Document>::Depth },
9612
  JSJitInfo::Setter,
9613
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9614
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
9615
  false,  /* isInfallible. False in setters. */
9616
  false,  /* isMovable.  Not relevant for setters. */
9617
  false, /* isEliminatable.  Not relevant for setters. */
9618
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9619
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9620
  false,  /* isTypedMethod.  Only relevant for methods. */
9621
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9622
};
9623
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9624
static_assert(0 < 1, "There is no slot for us");
9625
9626
MOZ_CAN_RUN_SCRIPT static bool
9627
get_onmouseenter(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
9628
0
{
9629
0
  AUTO_PROFILER_LABEL_FAST("get Document.onmouseenter", DOM, cx);
9630
0
9631
0
  RefPtr<EventHandlerNonNull> result(self->GetOnmouseenter());
9632
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9633
0
  if (result) {
9634
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
9635
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
9636
0
      return false;
9637
0
    }
9638
0
    return true;
9639
0
  } else {
9640
0
    args.rval().setNull();
9641
0
    return true;
9642
0
  }
9643
0
}
9644
9645
MOZ_CAN_RUN_SCRIPT static bool
9646
set_onmouseenter(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
9647
0
{
9648
0
  AUTO_PROFILER_LABEL_FAST("set Document.onmouseenter", DOM, cx);
9649
0
9650
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
9651
0
  if (args[0].isObject()) {
9652
0
    { // scope for tempRoot and tempGlobalRoot if needed
9653
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
9654
0
    }
9655
0
  } else {
9656
0
    arg0 = nullptr;
9657
0
  }
9658
0
  self->SetOnmouseenter(Constify(arg0));
9659
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9660
0
9661
0
  return true;
9662
0
}
9663
9664
static const JSJitInfo onmouseenter_getterinfo = {
9665
  { (JSJitGetterOp)get_onmouseenter },
9666
  { prototypes::id::Document },
9667
  { PrototypeTraits<prototypes::id::Document>::Depth },
9668
  JSJitInfo::Getter,
9669
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9670
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
9671
  false,  /* isInfallible. False in setters. */
9672
  false,  /* isMovable.  Not relevant for setters. */
9673
  false, /* isEliminatable.  Not relevant for setters. */
9674
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9675
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9676
  false,  /* isTypedMethod.  Only relevant for methods. */
9677
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9678
};
9679
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9680
static_assert(0 < 1, "There is no slot for us");
9681
static const JSJitInfo onmouseenter_setterinfo = {
9682
  { (JSJitGetterOp)set_onmouseenter },
9683
  { prototypes::id::Document },
9684
  { PrototypeTraits<prototypes::id::Document>::Depth },
9685
  JSJitInfo::Setter,
9686
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9687
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
9688
  false,  /* isInfallible. False in setters. */
9689
  false,  /* isMovable.  Not relevant for setters. */
9690
  false, /* isEliminatable.  Not relevant for setters. */
9691
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9692
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9693
  false,  /* isTypedMethod.  Only relevant for methods. */
9694
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9695
};
9696
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9697
static_assert(0 < 1, "There is no slot for us");
9698
9699
MOZ_CAN_RUN_SCRIPT static bool
9700
get_onmouseleave(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
9701
0
{
9702
0
  AUTO_PROFILER_LABEL_FAST("get Document.onmouseleave", DOM, cx);
9703
0
9704
0
  RefPtr<EventHandlerNonNull> result(self->GetOnmouseleave());
9705
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9706
0
  if (result) {
9707
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
9708
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
9709
0
      return false;
9710
0
    }
9711
0
    return true;
9712
0
  } else {
9713
0
    args.rval().setNull();
9714
0
    return true;
9715
0
  }
9716
0
}
9717
9718
MOZ_CAN_RUN_SCRIPT static bool
9719
set_onmouseleave(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
9720
0
{
9721
0
  AUTO_PROFILER_LABEL_FAST("set Document.onmouseleave", DOM, cx);
9722
0
9723
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
9724
0
  if (args[0].isObject()) {
9725
0
    { // scope for tempRoot and tempGlobalRoot if needed
9726
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
9727
0
    }
9728
0
  } else {
9729
0
    arg0 = nullptr;
9730
0
  }
9731
0
  self->SetOnmouseleave(Constify(arg0));
9732
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9733
0
9734
0
  return true;
9735
0
}
9736
9737
static const JSJitInfo onmouseleave_getterinfo = {
9738
  { (JSJitGetterOp)get_onmouseleave },
9739
  { prototypes::id::Document },
9740
  { PrototypeTraits<prototypes::id::Document>::Depth },
9741
  JSJitInfo::Getter,
9742
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9743
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
9744
  false,  /* isInfallible. False in setters. */
9745
  false,  /* isMovable.  Not relevant for setters. */
9746
  false, /* isEliminatable.  Not relevant for setters. */
9747
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9748
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9749
  false,  /* isTypedMethod.  Only relevant for methods. */
9750
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9751
};
9752
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9753
static_assert(0 < 1, "There is no slot for us");
9754
static const JSJitInfo onmouseleave_setterinfo = {
9755
  { (JSJitGetterOp)set_onmouseleave },
9756
  { prototypes::id::Document },
9757
  { PrototypeTraits<prototypes::id::Document>::Depth },
9758
  JSJitInfo::Setter,
9759
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9760
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
9761
  false,  /* isInfallible. False in setters. */
9762
  false,  /* isMovable.  Not relevant for setters. */
9763
  false, /* isEliminatable.  Not relevant for setters. */
9764
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9765
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9766
  false,  /* isTypedMethod.  Only relevant for methods. */
9767
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9768
};
9769
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9770
static_assert(0 < 1, "There is no slot for us");
9771
9772
MOZ_CAN_RUN_SCRIPT static bool
9773
get_onmousemove(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
9774
0
{
9775
0
  AUTO_PROFILER_LABEL_FAST("get Document.onmousemove", DOM, cx);
9776
0
9777
0
  RefPtr<EventHandlerNonNull> result(self->GetOnmousemove());
9778
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9779
0
  if (result) {
9780
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
9781
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
9782
0
      return false;
9783
0
    }
9784
0
    return true;
9785
0
  } else {
9786
0
    args.rval().setNull();
9787
0
    return true;
9788
0
  }
9789
0
}
9790
9791
MOZ_CAN_RUN_SCRIPT static bool
9792
set_onmousemove(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
9793
0
{
9794
0
  AUTO_PROFILER_LABEL_FAST("set Document.onmousemove", DOM, cx);
9795
0
9796
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
9797
0
  if (args[0].isObject()) {
9798
0
    { // scope for tempRoot and tempGlobalRoot if needed
9799
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
9800
0
    }
9801
0
  } else {
9802
0
    arg0 = nullptr;
9803
0
  }
9804
0
  self->SetOnmousemove(Constify(arg0));
9805
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9806
0
9807
0
  return true;
9808
0
}
9809
9810
static const JSJitInfo onmousemove_getterinfo = {
9811
  { (JSJitGetterOp)get_onmousemove },
9812
  { prototypes::id::Document },
9813
  { PrototypeTraits<prototypes::id::Document>::Depth },
9814
  JSJitInfo::Getter,
9815
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9816
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
9817
  false,  /* isInfallible. False in setters. */
9818
  false,  /* isMovable.  Not relevant for setters. */
9819
  false, /* isEliminatable.  Not relevant for setters. */
9820
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9821
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9822
  false,  /* isTypedMethod.  Only relevant for methods. */
9823
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9824
};
9825
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9826
static_assert(0 < 1, "There is no slot for us");
9827
static const JSJitInfo onmousemove_setterinfo = {
9828
  { (JSJitGetterOp)set_onmousemove },
9829
  { prototypes::id::Document },
9830
  { PrototypeTraits<prototypes::id::Document>::Depth },
9831
  JSJitInfo::Setter,
9832
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9833
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
9834
  false,  /* isInfallible. False in setters. */
9835
  false,  /* isMovable.  Not relevant for setters. */
9836
  false, /* isEliminatable.  Not relevant for setters. */
9837
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9838
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9839
  false,  /* isTypedMethod.  Only relevant for methods. */
9840
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9841
};
9842
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9843
static_assert(0 < 1, "There is no slot for us");
9844
9845
MOZ_CAN_RUN_SCRIPT static bool
9846
get_onmouseout(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
9847
0
{
9848
0
  AUTO_PROFILER_LABEL_FAST("get Document.onmouseout", DOM, cx);
9849
0
9850
0
  RefPtr<EventHandlerNonNull> result(self->GetOnmouseout());
9851
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9852
0
  if (result) {
9853
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
9854
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
9855
0
      return false;
9856
0
    }
9857
0
    return true;
9858
0
  } else {
9859
0
    args.rval().setNull();
9860
0
    return true;
9861
0
  }
9862
0
}
9863
9864
MOZ_CAN_RUN_SCRIPT static bool
9865
set_onmouseout(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
9866
0
{
9867
0
  AUTO_PROFILER_LABEL_FAST("set Document.onmouseout", DOM, cx);
9868
0
9869
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
9870
0
  if (args[0].isObject()) {
9871
0
    { // scope for tempRoot and tempGlobalRoot if needed
9872
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
9873
0
    }
9874
0
  } else {
9875
0
    arg0 = nullptr;
9876
0
  }
9877
0
  self->SetOnmouseout(Constify(arg0));
9878
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9879
0
9880
0
  return true;
9881
0
}
9882
9883
static const JSJitInfo onmouseout_getterinfo = {
9884
  { (JSJitGetterOp)get_onmouseout },
9885
  { prototypes::id::Document },
9886
  { PrototypeTraits<prototypes::id::Document>::Depth },
9887
  JSJitInfo::Getter,
9888
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9889
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
9890
  false,  /* isInfallible. False in setters. */
9891
  false,  /* isMovable.  Not relevant for setters. */
9892
  false, /* isEliminatable.  Not relevant for setters. */
9893
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9894
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9895
  false,  /* isTypedMethod.  Only relevant for methods. */
9896
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9897
};
9898
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9899
static_assert(0 < 1, "There is no slot for us");
9900
static const JSJitInfo onmouseout_setterinfo = {
9901
  { (JSJitGetterOp)set_onmouseout },
9902
  { prototypes::id::Document },
9903
  { PrototypeTraits<prototypes::id::Document>::Depth },
9904
  JSJitInfo::Setter,
9905
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9906
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
9907
  false,  /* isInfallible. False in setters. */
9908
  false,  /* isMovable.  Not relevant for setters. */
9909
  false, /* isEliminatable.  Not relevant for setters. */
9910
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9911
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9912
  false,  /* isTypedMethod.  Only relevant for methods. */
9913
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9914
};
9915
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9916
static_assert(0 < 1, "There is no slot for us");
9917
9918
MOZ_CAN_RUN_SCRIPT static bool
9919
get_onmouseover(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
9920
0
{
9921
0
  AUTO_PROFILER_LABEL_FAST("get Document.onmouseover", DOM, cx);
9922
0
9923
0
  RefPtr<EventHandlerNonNull> result(self->GetOnmouseover());
9924
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9925
0
  if (result) {
9926
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
9927
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
9928
0
      return false;
9929
0
    }
9930
0
    return true;
9931
0
  } else {
9932
0
    args.rval().setNull();
9933
0
    return true;
9934
0
  }
9935
0
}
9936
9937
MOZ_CAN_RUN_SCRIPT static bool
9938
set_onmouseover(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
9939
0
{
9940
0
  AUTO_PROFILER_LABEL_FAST("set Document.onmouseover", DOM, cx);
9941
0
9942
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
9943
0
  if (args[0].isObject()) {
9944
0
    { // scope for tempRoot and tempGlobalRoot if needed
9945
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
9946
0
    }
9947
0
  } else {
9948
0
    arg0 = nullptr;
9949
0
  }
9950
0
  self->SetOnmouseover(Constify(arg0));
9951
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9952
0
9953
0
  return true;
9954
0
}
9955
9956
static const JSJitInfo onmouseover_getterinfo = {
9957
  { (JSJitGetterOp)get_onmouseover },
9958
  { prototypes::id::Document },
9959
  { PrototypeTraits<prototypes::id::Document>::Depth },
9960
  JSJitInfo::Getter,
9961
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9962
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
9963
  false,  /* isInfallible. False in setters. */
9964
  false,  /* isMovable.  Not relevant for setters. */
9965
  false, /* isEliminatable.  Not relevant for setters. */
9966
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9967
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9968
  false,  /* isTypedMethod.  Only relevant for methods. */
9969
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9970
};
9971
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9972
static_assert(0 < 1, "There is no slot for us");
9973
static const JSJitInfo onmouseover_setterinfo = {
9974
  { (JSJitGetterOp)set_onmouseover },
9975
  { prototypes::id::Document },
9976
  { PrototypeTraits<prototypes::id::Document>::Depth },
9977
  JSJitInfo::Setter,
9978
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
9979
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
9980
  false,  /* isInfallible. False in setters. */
9981
  false,  /* isMovable.  Not relevant for setters. */
9982
  false, /* isEliminatable.  Not relevant for setters. */
9983
  false, /* isAlwaysInSlot.  Only relevant for getters. */
9984
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
9985
  false,  /* isTypedMethod.  Only relevant for methods. */
9986
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
9987
};
9988
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
9989
static_assert(0 < 1, "There is no slot for us");
9990
9991
MOZ_CAN_RUN_SCRIPT static bool
9992
get_onmouseup(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
9993
0
{
9994
0
  AUTO_PROFILER_LABEL_FAST("get Document.onmouseup", DOM, cx);
9995
0
9996
0
  RefPtr<EventHandlerNonNull> result(self->GetOnmouseup());
9997
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
9998
0
  if (result) {
9999
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
10000
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
10001
0
      return false;
10002
0
    }
10003
0
    return true;
10004
0
  } else {
10005
0
    args.rval().setNull();
10006
0
    return true;
10007
0
  }
10008
0
}
10009
10010
MOZ_CAN_RUN_SCRIPT static bool
10011
set_onmouseup(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
10012
0
{
10013
0
  AUTO_PROFILER_LABEL_FAST("set Document.onmouseup", DOM, cx);
10014
0
10015
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
10016
0
  if (args[0].isObject()) {
10017
0
    { // scope for tempRoot and tempGlobalRoot if needed
10018
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
10019
0
    }
10020
0
  } else {
10021
0
    arg0 = nullptr;
10022
0
  }
10023
0
  self->SetOnmouseup(Constify(arg0));
10024
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10025
0
10026
0
  return true;
10027
0
}
10028
10029
static const JSJitInfo onmouseup_getterinfo = {
10030
  { (JSJitGetterOp)get_onmouseup },
10031
  { prototypes::id::Document },
10032
  { PrototypeTraits<prototypes::id::Document>::Depth },
10033
  JSJitInfo::Getter,
10034
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10035
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
10036
  false,  /* isInfallible. False in setters. */
10037
  false,  /* isMovable.  Not relevant for setters. */
10038
  false, /* isEliminatable.  Not relevant for setters. */
10039
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10040
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10041
  false,  /* isTypedMethod.  Only relevant for methods. */
10042
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10043
};
10044
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10045
static_assert(0 < 1, "There is no slot for us");
10046
static const JSJitInfo onmouseup_setterinfo = {
10047
  { (JSJitGetterOp)set_onmouseup },
10048
  { prototypes::id::Document },
10049
  { PrototypeTraits<prototypes::id::Document>::Depth },
10050
  JSJitInfo::Setter,
10051
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10052
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
10053
  false,  /* isInfallible. False in setters. */
10054
  false,  /* isMovable.  Not relevant for setters. */
10055
  false, /* isEliminatable.  Not relevant for setters. */
10056
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10057
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10058
  false,  /* isTypedMethod.  Only relevant for methods. */
10059
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10060
};
10061
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10062
static_assert(0 < 1, "There is no slot for us");
10063
10064
MOZ_CAN_RUN_SCRIPT static bool
10065
get_onwheel(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
10066
0
{
10067
0
  AUTO_PROFILER_LABEL_FAST("get Document.onwheel", DOM, cx);
10068
0
10069
0
  RefPtr<EventHandlerNonNull> result(self->GetOnwheel());
10070
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10071
0
  if (result) {
10072
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
10073
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
10074
0
      return false;
10075
0
    }
10076
0
    return true;
10077
0
  } else {
10078
0
    args.rval().setNull();
10079
0
    return true;
10080
0
  }
10081
0
}
10082
10083
MOZ_CAN_RUN_SCRIPT static bool
10084
set_onwheel(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
10085
0
{
10086
0
  AUTO_PROFILER_LABEL_FAST("set Document.onwheel", DOM, cx);
10087
0
10088
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
10089
0
  if (args[0].isObject()) {
10090
0
    { // scope for tempRoot and tempGlobalRoot if needed
10091
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
10092
0
    }
10093
0
  } else {
10094
0
    arg0 = nullptr;
10095
0
  }
10096
0
  self->SetOnwheel(Constify(arg0));
10097
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10098
0
10099
0
  return true;
10100
0
}
10101
10102
static const JSJitInfo onwheel_getterinfo = {
10103
  { (JSJitGetterOp)get_onwheel },
10104
  { prototypes::id::Document },
10105
  { PrototypeTraits<prototypes::id::Document>::Depth },
10106
  JSJitInfo::Getter,
10107
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10108
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
10109
  false,  /* isInfallible. False in setters. */
10110
  false,  /* isMovable.  Not relevant for setters. */
10111
  false, /* isEliminatable.  Not relevant for setters. */
10112
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10113
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10114
  false,  /* isTypedMethod.  Only relevant for methods. */
10115
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10116
};
10117
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10118
static_assert(0 < 1, "There is no slot for us");
10119
static const JSJitInfo onwheel_setterinfo = {
10120
  { (JSJitGetterOp)set_onwheel },
10121
  { prototypes::id::Document },
10122
  { PrototypeTraits<prototypes::id::Document>::Depth },
10123
  JSJitInfo::Setter,
10124
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10125
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
10126
  false,  /* isInfallible. False in setters. */
10127
  false,  /* isMovable.  Not relevant for setters. */
10128
  false, /* isEliminatable.  Not relevant for setters. */
10129
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10130
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10131
  false,  /* isTypedMethod.  Only relevant for methods. */
10132
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10133
};
10134
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10135
static_assert(0 < 1, "There is no slot for us");
10136
10137
MOZ_CAN_RUN_SCRIPT static bool
10138
get_onpause(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
10139
0
{
10140
0
  AUTO_PROFILER_LABEL_FAST("get Document.onpause", DOM, cx);
10141
0
10142
0
  RefPtr<EventHandlerNonNull> result(self->GetOnpause());
10143
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10144
0
  if (result) {
10145
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
10146
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
10147
0
      return false;
10148
0
    }
10149
0
    return true;
10150
0
  } else {
10151
0
    args.rval().setNull();
10152
0
    return true;
10153
0
  }
10154
0
}
10155
10156
MOZ_CAN_RUN_SCRIPT static bool
10157
set_onpause(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
10158
0
{
10159
0
  AUTO_PROFILER_LABEL_FAST("set Document.onpause", DOM, cx);
10160
0
10161
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
10162
0
  if (args[0].isObject()) {
10163
0
    { // scope for tempRoot and tempGlobalRoot if needed
10164
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
10165
0
    }
10166
0
  } else {
10167
0
    arg0 = nullptr;
10168
0
  }
10169
0
  self->SetOnpause(Constify(arg0));
10170
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10171
0
10172
0
  return true;
10173
0
}
10174
10175
static const JSJitInfo onpause_getterinfo = {
10176
  { (JSJitGetterOp)get_onpause },
10177
  { prototypes::id::Document },
10178
  { PrototypeTraits<prototypes::id::Document>::Depth },
10179
  JSJitInfo::Getter,
10180
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10181
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
10182
  false,  /* isInfallible. False in setters. */
10183
  false,  /* isMovable.  Not relevant for setters. */
10184
  false, /* isEliminatable.  Not relevant for setters. */
10185
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10186
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10187
  false,  /* isTypedMethod.  Only relevant for methods. */
10188
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10189
};
10190
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10191
static_assert(0 < 1, "There is no slot for us");
10192
static const JSJitInfo onpause_setterinfo = {
10193
  { (JSJitGetterOp)set_onpause },
10194
  { prototypes::id::Document },
10195
  { PrototypeTraits<prototypes::id::Document>::Depth },
10196
  JSJitInfo::Setter,
10197
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10198
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
10199
  false,  /* isInfallible. False in setters. */
10200
  false,  /* isMovable.  Not relevant for setters. */
10201
  false, /* isEliminatable.  Not relevant for setters. */
10202
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10203
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10204
  false,  /* isTypedMethod.  Only relevant for methods. */
10205
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10206
};
10207
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10208
static_assert(0 < 1, "There is no slot for us");
10209
10210
MOZ_CAN_RUN_SCRIPT static bool
10211
get_onplay(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
10212
0
{
10213
0
  AUTO_PROFILER_LABEL_FAST("get Document.onplay", DOM, cx);
10214
0
10215
0
  RefPtr<EventHandlerNonNull> result(self->GetOnplay());
10216
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10217
0
  if (result) {
10218
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
10219
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
10220
0
      return false;
10221
0
    }
10222
0
    return true;
10223
0
  } else {
10224
0
    args.rval().setNull();
10225
0
    return true;
10226
0
  }
10227
0
}
10228
10229
MOZ_CAN_RUN_SCRIPT static bool
10230
set_onplay(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
10231
0
{
10232
0
  AUTO_PROFILER_LABEL_FAST("set Document.onplay", DOM, cx);
10233
0
10234
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
10235
0
  if (args[0].isObject()) {
10236
0
    { // scope for tempRoot and tempGlobalRoot if needed
10237
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
10238
0
    }
10239
0
  } else {
10240
0
    arg0 = nullptr;
10241
0
  }
10242
0
  self->SetOnplay(Constify(arg0));
10243
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10244
0
10245
0
  return true;
10246
0
}
10247
10248
static const JSJitInfo onplay_getterinfo = {
10249
  { (JSJitGetterOp)get_onplay },
10250
  { prototypes::id::Document },
10251
  { PrototypeTraits<prototypes::id::Document>::Depth },
10252
  JSJitInfo::Getter,
10253
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10254
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
10255
  false,  /* isInfallible. False in setters. */
10256
  false,  /* isMovable.  Not relevant for setters. */
10257
  false, /* isEliminatable.  Not relevant for setters. */
10258
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10259
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10260
  false,  /* isTypedMethod.  Only relevant for methods. */
10261
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10262
};
10263
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10264
static_assert(0 < 1, "There is no slot for us");
10265
static const JSJitInfo onplay_setterinfo = {
10266
  { (JSJitGetterOp)set_onplay },
10267
  { prototypes::id::Document },
10268
  { PrototypeTraits<prototypes::id::Document>::Depth },
10269
  JSJitInfo::Setter,
10270
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10271
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
10272
  false,  /* isInfallible. False in setters. */
10273
  false,  /* isMovable.  Not relevant for setters. */
10274
  false, /* isEliminatable.  Not relevant for setters. */
10275
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10276
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10277
  false,  /* isTypedMethod.  Only relevant for methods. */
10278
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10279
};
10280
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10281
static_assert(0 < 1, "There is no slot for us");
10282
10283
MOZ_CAN_RUN_SCRIPT static bool
10284
get_onplaying(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
10285
0
{
10286
0
  AUTO_PROFILER_LABEL_FAST("get Document.onplaying", DOM, cx);
10287
0
10288
0
  RefPtr<EventHandlerNonNull> result(self->GetOnplaying());
10289
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10290
0
  if (result) {
10291
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
10292
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
10293
0
      return false;
10294
0
    }
10295
0
    return true;
10296
0
  } else {
10297
0
    args.rval().setNull();
10298
0
    return true;
10299
0
  }
10300
0
}
10301
10302
MOZ_CAN_RUN_SCRIPT static bool
10303
set_onplaying(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
10304
0
{
10305
0
  AUTO_PROFILER_LABEL_FAST("set Document.onplaying", DOM, cx);
10306
0
10307
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
10308
0
  if (args[0].isObject()) {
10309
0
    { // scope for tempRoot and tempGlobalRoot if needed
10310
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
10311
0
    }
10312
0
  } else {
10313
0
    arg0 = nullptr;
10314
0
  }
10315
0
  self->SetOnplaying(Constify(arg0));
10316
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10317
0
10318
0
  return true;
10319
0
}
10320
10321
static const JSJitInfo onplaying_getterinfo = {
10322
  { (JSJitGetterOp)get_onplaying },
10323
  { prototypes::id::Document },
10324
  { PrototypeTraits<prototypes::id::Document>::Depth },
10325
  JSJitInfo::Getter,
10326
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10327
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
10328
  false,  /* isInfallible. False in setters. */
10329
  false,  /* isMovable.  Not relevant for setters. */
10330
  false, /* isEliminatable.  Not relevant for setters. */
10331
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10332
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10333
  false,  /* isTypedMethod.  Only relevant for methods. */
10334
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10335
};
10336
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10337
static_assert(0 < 1, "There is no slot for us");
10338
static const JSJitInfo onplaying_setterinfo = {
10339
  { (JSJitGetterOp)set_onplaying },
10340
  { prototypes::id::Document },
10341
  { PrototypeTraits<prototypes::id::Document>::Depth },
10342
  JSJitInfo::Setter,
10343
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10344
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
10345
  false,  /* isInfallible. False in setters. */
10346
  false,  /* isMovable.  Not relevant for setters. */
10347
  false, /* isEliminatable.  Not relevant for setters. */
10348
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10349
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10350
  false,  /* isTypedMethod.  Only relevant for methods. */
10351
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10352
};
10353
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10354
static_assert(0 < 1, "There is no slot for us");
10355
10356
MOZ_CAN_RUN_SCRIPT static bool
10357
get_onprogress(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
10358
0
{
10359
0
  AUTO_PROFILER_LABEL_FAST("get Document.onprogress", DOM, cx);
10360
0
10361
0
  RefPtr<EventHandlerNonNull> result(self->GetOnprogress());
10362
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10363
0
  if (result) {
10364
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
10365
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
10366
0
      return false;
10367
0
    }
10368
0
    return true;
10369
0
  } else {
10370
0
    args.rval().setNull();
10371
0
    return true;
10372
0
  }
10373
0
}
10374
10375
MOZ_CAN_RUN_SCRIPT static bool
10376
set_onprogress(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
10377
0
{
10378
0
  AUTO_PROFILER_LABEL_FAST("set Document.onprogress", DOM, cx);
10379
0
10380
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
10381
0
  if (args[0].isObject()) {
10382
0
    { // scope for tempRoot and tempGlobalRoot if needed
10383
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
10384
0
    }
10385
0
  } else {
10386
0
    arg0 = nullptr;
10387
0
  }
10388
0
  self->SetOnprogress(Constify(arg0));
10389
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10390
0
10391
0
  return true;
10392
0
}
10393
10394
static const JSJitInfo onprogress_getterinfo = {
10395
  { (JSJitGetterOp)get_onprogress },
10396
  { prototypes::id::Document },
10397
  { PrototypeTraits<prototypes::id::Document>::Depth },
10398
  JSJitInfo::Getter,
10399
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10400
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
10401
  false,  /* isInfallible. False in setters. */
10402
  false,  /* isMovable.  Not relevant for setters. */
10403
  false, /* isEliminatable.  Not relevant for setters. */
10404
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10405
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10406
  false,  /* isTypedMethod.  Only relevant for methods. */
10407
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10408
};
10409
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10410
static_assert(0 < 1, "There is no slot for us");
10411
static const JSJitInfo onprogress_setterinfo = {
10412
  { (JSJitGetterOp)set_onprogress },
10413
  { prototypes::id::Document },
10414
  { PrototypeTraits<prototypes::id::Document>::Depth },
10415
  JSJitInfo::Setter,
10416
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10417
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
10418
  false,  /* isInfallible. False in setters. */
10419
  false,  /* isMovable.  Not relevant for setters. */
10420
  false, /* isEliminatable.  Not relevant for setters. */
10421
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10422
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10423
  false,  /* isTypedMethod.  Only relevant for methods. */
10424
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10425
};
10426
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10427
static_assert(0 < 1, "There is no slot for us");
10428
10429
MOZ_CAN_RUN_SCRIPT static bool
10430
get_onratechange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
10431
0
{
10432
0
  AUTO_PROFILER_LABEL_FAST("get Document.onratechange", DOM, cx);
10433
0
10434
0
  RefPtr<EventHandlerNonNull> result(self->GetOnratechange());
10435
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10436
0
  if (result) {
10437
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
10438
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
10439
0
      return false;
10440
0
    }
10441
0
    return true;
10442
0
  } else {
10443
0
    args.rval().setNull();
10444
0
    return true;
10445
0
  }
10446
0
}
10447
10448
MOZ_CAN_RUN_SCRIPT static bool
10449
set_onratechange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
10450
0
{
10451
0
  AUTO_PROFILER_LABEL_FAST("set Document.onratechange", DOM, cx);
10452
0
10453
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
10454
0
  if (args[0].isObject()) {
10455
0
    { // scope for tempRoot and tempGlobalRoot if needed
10456
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
10457
0
    }
10458
0
  } else {
10459
0
    arg0 = nullptr;
10460
0
  }
10461
0
  self->SetOnratechange(Constify(arg0));
10462
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10463
0
10464
0
  return true;
10465
0
}
10466
10467
static const JSJitInfo onratechange_getterinfo = {
10468
  { (JSJitGetterOp)get_onratechange },
10469
  { prototypes::id::Document },
10470
  { PrototypeTraits<prototypes::id::Document>::Depth },
10471
  JSJitInfo::Getter,
10472
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10473
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
10474
  false,  /* isInfallible. False in setters. */
10475
  false,  /* isMovable.  Not relevant for setters. */
10476
  false, /* isEliminatable.  Not relevant for setters. */
10477
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10478
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10479
  false,  /* isTypedMethod.  Only relevant for methods. */
10480
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10481
};
10482
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10483
static_assert(0 < 1, "There is no slot for us");
10484
static const JSJitInfo onratechange_setterinfo = {
10485
  { (JSJitGetterOp)set_onratechange },
10486
  { prototypes::id::Document },
10487
  { PrototypeTraits<prototypes::id::Document>::Depth },
10488
  JSJitInfo::Setter,
10489
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10490
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
10491
  false,  /* isInfallible. False in setters. */
10492
  false,  /* isMovable.  Not relevant for setters. */
10493
  false, /* isEliminatable.  Not relevant for setters. */
10494
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10495
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10496
  false,  /* isTypedMethod.  Only relevant for methods. */
10497
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10498
};
10499
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10500
static_assert(0 < 1, "There is no slot for us");
10501
10502
MOZ_CAN_RUN_SCRIPT static bool
10503
get_onreset(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
10504
0
{
10505
0
  AUTO_PROFILER_LABEL_FAST("get Document.onreset", DOM, cx);
10506
0
10507
0
  RefPtr<EventHandlerNonNull> result(self->GetOnreset());
10508
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10509
0
  if (result) {
10510
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
10511
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
10512
0
      return false;
10513
0
    }
10514
0
    return true;
10515
0
  } else {
10516
0
    args.rval().setNull();
10517
0
    return true;
10518
0
  }
10519
0
}
10520
10521
MOZ_CAN_RUN_SCRIPT static bool
10522
set_onreset(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
10523
0
{
10524
0
  AUTO_PROFILER_LABEL_FAST("set Document.onreset", DOM, cx);
10525
0
10526
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
10527
0
  if (args[0].isObject()) {
10528
0
    { // scope for tempRoot and tempGlobalRoot if needed
10529
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
10530
0
    }
10531
0
  } else {
10532
0
    arg0 = nullptr;
10533
0
  }
10534
0
  self->SetOnreset(Constify(arg0));
10535
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10536
0
10537
0
  return true;
10538
0
}
10539
10540
static const JSJitInfo onreset_getterinfo = {
10541
  { (JSJitGetterOp)get_onreset },
10542
  { prototypes::id::Document },
10543
  { PrototypeTraits<prototypes::id::Document>::Depth },
10544
  JSJitInfo::Getter,
10545
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10546
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
10547
  false,  /* isInfallible. False in setters. */
10548
  false,  /* isMovable.  Not relevant for setters. */
10549
  false, /* isEliminatable.  Not relevant for setters. */
10550
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10551
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10552
  false,  /* isTypedMethod.  Only relevant for methods. */
10553
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10554
};
10555
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10556
static_assert(0 < 1, "There is no slot for us");
10557
static const JSJitInfo onreset_setterinfo = {
10558
  { (JSJitGetterOp)set_onreset },
10559
  { prototypes::id::Document },
10560
  { PrototypeTraits<prototypes::id::Document>::Depth },
10561
  JSJitInfo::Setter,
10562
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10563
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
10564
  false,  /* isInfallible. False in setters. */
10565
  false,  /* isMovable.  Not relevant for setters. */
10566
  false, /* isEliminatable.  Not relevant for setters. */
10567
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10568
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10569
  false,  /* isTypedMethod.  Only relevant for methods. */
10570
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10571
};
10572
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10573
static_assert(0 < 1, "There is no slot for us");
10574
10575
MOZ_CAN_RUN_SCRIPT static bool
10576
get_onresize(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
10577
0
{
10578
0
  AUTO_PROFILER_LABEL_FAST("get Document.onresize", DOM, cx);
10579
0
10580
0
  RefPtr<EventHandlerNonNull> result(self->GetOnresize());
10581
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10582
0
  if (result) {
10583
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
10584
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
10585
0
      return false;
10586
0
    }
10587
0
    return true;
10588
0
  } else {
10589
0
    args.rval().setNull();
10590
0
    return true;
10591
0
  }
10592
0
}
10593
10594
MOZ_CAN_RUN_SCRIPT static bool
10595
set_onresize(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
10596
0
{
10597
0
  AUTO_PROFILER_LABEL_FAST("set Document.onresize", DOM, cx);
10598
0
10599
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
10600
0
  if (args[0].isObject()) {
10601
0
    { // scope for tempRoot and tempGlobalRoot if needed
10602
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
10603
0
    }
10604
0
  } else {
10605
0
    arg0 = nullptr;
10606
0
  }
10607
0
  self->SetOnresize(Constify(arg0));
10608
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10609
0
10610
0
  return true;
10611
0
}
10612
10613
static const JSJitInfo onresize_getterinfo = {
10614
  { (JSJitGetterOp)get_onresize },
10615
  { prototypes::id::Document },
10616
  { PrototypeTraits<prototypes::id::Document>::Depth },
10617
  JSJitInfo::Getter,
10618
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10619
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
10620
  false,  /* isInfallible. False in setters. */
10621
  false,  /* isMovable.  Not relevant for setters. */
10622
  false, /* isEliminatable.  Not relevant for setters. */
10623
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10624
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10625
  false,  /* isTypedMethod.  Only relevant for methods. */
10626
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10627
};
10628
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10629
static_assert(0 < 1, "There is no slot for us");
10630
static const JSJitInfo onresize_setterinfo = {
10631
  { (JSJitGetterOp)set_onresize },
10632
  { prototypes::id::Document },
10633
  { PrototypeTraits<prototypes::id::Document>::Depth },
10634
  JSJitInfo::Setter,
10635
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10636
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
10637
  false,  /* isInfallible. False in setters. */
10638
  false,  /* isMovable.  Not relevant for setters. */
10639
  false, /* isEliminatable.  Not relevant for setters. */
10640
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10641
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10642
  false,  /* isTypedMethod.  Only relevant for methods. */
10643
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10644
};
10645
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10646
static_assert(0 < 1, "There is no slot for us");
10647
10648
MOZ_CAN_RUN_SCRIPT static bool
10649
get_onscroll(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
10650
0
{
10651
0
  AUTO_PROFILER_LABEL_FAST("get Document.onscroll", DOM, cx);
10652
0
10653
0
  RefPtr<EventHandlerNonNull> result(self->GetOnscroll());
10654
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10655
0
  if (result) {
10656
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
10657
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
10658
0
      return false;
10659
0
    }
10660
0
    return true;
10661
0
  } else {
10662
0
    args.rval().setNull();
10663
0
    return true;
10664
0
  }
10665
0
}
10666
10667
MOZ_CAN_RUN_SCRIPT static bool
10668
set_onscroll(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
10669
0
{
10670
0
  AUTO_PROFILER_LABEL_FAST("set Document.onscroll", DOM, cx);
10671
0
10672
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
10673
0
  if (args[0].isObject()) {
10674
0
    { // scope for tempRoot and tempGlobalRoot if needed
10675
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
10676
0
    }
10677
0
  } else {
10678
0
    arg0 = nullptr;
10679
0
  }
10680
0
  self->SetOnscroll(Constify(arg0));
10681
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10682
0
10683
0
  return true;
10684
0
}
10685
10686
static const JSJitInfo onscroll_getterinfo = {
10687
  { (JSJitGetterOp)get_onscroll },
10688
  { prototypes::id::Document },
10689
  { PrototypeTraits<prototypes::id::Document>::Depth },
10690
  JSJitInfo::Getter,
10691
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10692
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
10693
  false,  /* isInfallible. False in setters. */
10694
  false,  /* isMovable.  Not relevant for setters. */
10695
  false, /* isEliminatable.  Not relevant for setters. */
10696
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10697
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10698
  false,  /* isTypedMethod.  Only relevant for methods. */
10699
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10700
};
10701
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10702
static_assert(0 < 1, "There is no slot for us");
10703
static const JSJitInfo onscroll_setterinfo = {
10704
  { (JSJitGetterOp)set_onscroll },
10705
  { prototypes::id::Document },
10706
  { PrototypeTraits<prototypes::id::Document>::Depth },
10707
  JSJitInfo::Setter,
10708
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10709
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
10710
  false,  /* isInfallible. False in setters. */
10711
  false,  /* isMovable.  Not relevant for setters. */
10712
  false, /* isEliminatable.  Not relevant for setters. */
10713
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10714
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10715
  false,  /* isTypedMethod.  Only relevant for methods. */
10716
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10717
};
10718
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10719
static_assert(0 < 1, "There is no slot for us");
10720
10721
MOZ_CAN_RUN_SCRIPT static bool
10722
get_onseeked(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
10723
0
{
10724
0
  AUTO_PROFILER_LABEL_FAST("get Document.onseeked", DOM, cx);
10725
0
10726
0
  RefPtr<EventHandlerNonNull> result(self->GetOnseeked());
10727
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10728
0
  if (result) {
10729
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
10730
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
10731
0
      return false;
10732
0
    }
10733
0
    return true;
10734
0
  } else {
10735
0
    args.rval().setNull();
10736
0
    return true;
10737
0
  }
10738
0
}
10739
10740
MOZ_CAN_RUN_SCRIPT static bool
10741
set_onseeked(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
10742
0
{
10743
0
  AUTO_PROFILER_LABEL_FAST("set Document.onseeked", DOM, cx);
10744
0
10745
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
10746
0
  if (args[0].isObject()) {
10747
0
    { // scope for tempRoot and tempGlobalRoot if needed
10748
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
10749
0
    }
10750
0
  } else {
10751
0
    arg0 = nullptr;
10752
0
  }
10753
0
  self->SetOnseeked(Constify(arg0));
10754
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10755
0
10756
0
  return true;
10757
0
}
10758
10759
static const JSJitInfo onseeked_getterinfo = {
10760
  { (JSJitGetterOp)get_onseeked },
10761
  { prototypes::id::Document },
10762
  { PrototypeTraits<prototypes::id::Document>::Depth },
10763
  JSJitInfo::Getter,
10764
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10765
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
10766
  false,  /* isInfallible. False in setters. */
10767
  false,  /* isMovable.  Not relevant for setters. */
10768
  false, /* isEliminatable.  Not relevant for setters. */
10769
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10770
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10771
  false,  /* isTypedMethod.  Only relevant for methods. */
10772
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10773
};
10774
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10775
static_assert(0 < 1, "There is no slot for us");
10776
static const JSJitInfo onseeked_setterinfo = {
10777
  { (JSJitGetterOp)set_onseeked },
10778
  { prototypes::id::Document },
10779
  { PrototypeTraits<prototypes::id::Document>::Depth },
10780
  JSJitInfo::Setter,
10781
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10782
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
10783
  false,  /* isInfallible. False in setters. */
10784
  false,  /* isMovable.  Not relevant for setters. */
10785
  false, /* isEliminatable.  Not relevant for setters. */
10786
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10787
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10788
  false,  /* isTypedMethod.  Only relevant for methods. */
10789
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10790
};
10791
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10792
static_assert(0 < 1, "There is no slot for us");
10793
10794
MOZ_CAN_RUN_SCRIPT static bool
10795
get_onseeking(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
10796
0
{
10797
0
  AUTO_PROFILER_LABEL_FAST("get Document.onseeking", DOM, cx);
10798
0
10799
0
  RefPtr<EventHandlerNonNull> result(self->GetOnseeking());
10800
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10801
0
  if (result) {
10802
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
10803
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
10804
0
      return false;
10805
0
    }
10806
0
    return true;
10807
0
  } else {
10808
0
    args.rval().setNull();
10809
0
    return true;
10810
0
  }
10811
0
}
10812
10813
MOZ_CAN_RUN_SCRIPT static bool
10814
set_onseeking(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
10815
0
{
10816
0
  AUTO_PROFILER_LABEL_FAST("set Document.onseeking", DOM, cx);
10817
0
10818
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
10819
0
  if (args[0].isObject()) {
10820
0
    { // scope for tempRoot and tempGlobalRoot if needed
10821
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
10822
0
    }
10823
0
  } else {
10824
0
    arg0 = nullptr;
10825
0
  }
10826
0
  self->SetOnseeking(Constify(arg0));
10827
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10828
0
10829
0
  return true;
10830
0
}
10831
10832
static const JSJitInfo onseeking_getterinfo = {
10833
  { (JSJitGetterOp)get_onseeking },
10834
  { prototypes::id::Document },
10835
  { PrototypeTraits<prototypes::id::Document>::Depth },
10836
  JSJitInfo::Getter,
10837
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10838
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
10839
  false,  /* isInfallible. False in setters. */
10840
  false,  /* isMovable.  Not relevant for setters. */
10841
  false, /* isEliminatable.  Not relevant for setters. */
10842
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10843
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10844
  false,  /* isTypedMethod.  Only relevant for methods. */
10845
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10846
};
10847
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10848
static_assert(0 < 1, "There is no slot for us");
10849
static const JSJitInfo onseeking_setterinfo = {
10850
  { (JSJitGetterOp)set_onseeking },
10851
  { prototypes::id::Document },
10852
  { PrototypeTraits<prototypes::id::Document>::Depth },
10853
  JSJitInfo::Setter,
10854
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10855
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
10856
  false,  /* isInfallible. False in setters. */
10857
  false,  /* isMovable.  Not relevant for setters. */
10858
  false, /* isEliminatable.  Not relevant for setters. */
10859
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10860
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10861
  false,  /* isTypedMethod.  Only relevant for methods. */
10862
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10863
};
10864
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10865
static_assert(0 < 1, "There is no slot for us");
10866
10867
MOZ_CAN_RUN_SCRIPT static bool
10868
get_onselect(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
10869
0
{
10870
0
  AUTO_PROFILER_LABEL_FAST("get Document.onselect", DOM, cx);
10871
0
10872
0
  RefPtr<EventHandlerNonNull> result(self->GetOnselect());
10873
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10874
0
  if (result) {
10875
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
10876
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
10877
0
      return false;
10878
0
    }
10879
0
    return true;
10880
0
  } else {
10881
0
    args.rval().setNull();
10882
0
    return true;
10883
0
  }
10884
0
}
10885
10886
MOZ_CAN_RUN_SCRIPT static bool
10887
set_onselect(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
10888
0
{
10889
0
  AUTO_PROFILER_LABEL_FAST("set Document.onselect", DOM, cx);
10890
0
10891
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
10892
0
  if (args[0].isObject()) {
10893
0
    { // scope for tempRoot and tempGlobalRoot if needed
10894
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
10895
0
    }
10896
0
  } else {
10897
0
    arg0 = nullptr;
10898
0
  }
10899
0
  self->SetOnselect(Constify(arg0));
10900
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10901
0
10902
0
  return true;
10903
0
}
10904
10905
static const JSJitInfo onselect_getterinfo = {
10906
  { (JSJitGetterOp)get_onselect },
10907
  { prototypes::id::Document },
10908
  { PrototypeTraits<prototypes::id::Document>::Depth },
10909
  JSJitInfo::Getter,
10910
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10911
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
10912
  false,  /* isInfallible. False in setters. */
10913
  false,  /* isMovable.  Not relevant for setters. */
10914
  false, /* isEliminatable.  Not relevant for setters. */
10915
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10916
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10917
  false,  /* isTypedMethod.  Only relevant for methods. */
10918
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10919
};
10920
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10921
static_assert(0 < 1, "There is no slot for us");
10922
static const JSJitInfo onselect_setterinfo = {
10923
  { (JSJitGetterOp)set_onselect },
10924
  { prototypes::id::Document },
10925
  { PrototypeTraits<prototypes::id::Document>::Depth },
10926
  JSJitInfo::Setter,
10927
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10928
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
10929
  false,  /* isInfallible. False in setters. */
10930
  false,  /* isMovable.  Not relevant for setters. */
10931
  false, /* isEliminatable.  Not relevant for setters. */
10932
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10933
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10934
  false,  /* isTypedMethod.  Only relevant for methods. */
10935
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10936
};
10937
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10938
static_assert(0 < 1, "There is no slot for us");
10939
10940
MOZ_CAN_RUN_SCRIPT static bool
10941
get_onshow(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
10942
0
{
10943
0
  AUTO_PROFILER_LABEL_FAST("get Document.onshow", DOM, cx);
10944
0
10945
0
  RefPtr<EventHandlerNonNull> result(self->GetOnshow());
10946
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10947
0
  if (result) {
10948
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
10949
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
10950
0
      return false;
10951
0
    }
10952
0
    return true;
10953
0
  } else {
10954
0
    args.rval().setNull();
10955
0
    return true;
10956
0
  }
10957
0
}
10958
10959
MOZ_CAN_RUN_SCRIPT static bool
10960
set_onshow(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
10961
0
{
10962
0
  AUTO_PROFILER_LABEL_FAST("set Document.onshow", DOM, cx);
10963
0
10964
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
10965
0
  if (args[0].isObject()) {
10966
0
    { // scope for tempRoot and tempGlobalRoot if needed
10967
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
10968
0
    }
10969
0
  } else {
10970
0
    arg0 = nullptr;
10971
0
  }
10972
0
  self->SetOnshow(Constify(arg0));
10973
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
10974
0
10975
0
  return true;
10976
0
}
10977
10978
static const JSJitInfo onshow_getterinfo = {
10979
  { (JSJitGetterOp)get_onshow },
10980
  { prototypes::id::Document },
10981
  { PrototypeTraits<prototypes::id::Document>::Depth },
10982
  JSJitInfo::Getter,
10983
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
10984
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
10985
  false,  /* isInfallible. False in setters. */
10986
  false,  /* isMovable.  Not relevant for setters. */
10987
  false, /* isEliminatable.  Not relevant for setters. */
10988
  false, /* isAlwaysInSlot.  Only relevant for getters. */
10989
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
10990
  false,  /* isTypedMethod.  Only relevant for methods. */
10991
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
10992
};
10993
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
10994
static_assert(0 < 1, "There is no slot for us");
10995
static const JSJitInfo onshow_setterinfo = {
10996
  { (JSJitGetterOp)set_onshow },
10997
  { prototypes::id::Document },
10998
  { PrototypeTraits<prototypes::id::Document>::Depth },
10999
  JSJitInfo::Setter,
11000
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11001
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
11002
  false,  /* isInfallible. False in setters. */
11003
  false,  /* isMovable.  Not relevant for setters. */
11004
  false, /* isEliminatable.  Not relevant for setters. */
11005
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11006
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11007
  false,  /* isTypedMethod.  Only relevant for methods. */
11008
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11009
};
11010
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11011
static_assert(0 < 1, "There is no slot for us");
11012
11013
MOZ_CAN_RUN_SCRIPT static bool
11014
get_onstalled(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
11015
0
{
11016
0
  AUTO_PROFILER_LABEL_FAST("get Document.onstalled", DOM, cx);
11017
0
11018
0
  RefPtr<EventHandlerNonNull> result(self->GetOnstalled());
11019
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11020
0
  if (result) {
11021
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
11022
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
11023
0
      return false;
11024
0
    }
11025
0
    return true;
11026
0
  } else {
11027
0
    args.rval().setNull();
11028
0
    return true;
11029
0
  }
11030
0
}
11031
11032
MOZ_CAN_RUN_SCRIPT static bool
11033
set_onstalled(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
11034
0
{
11035
0
  AUTO_PROFILER_LABEL_FAST("set Document.onstalled", DOM, cx);
11036
0
11037
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
11038
0
  if (args[0].isObject()) {
11039
0
    { // scope for tempRoot and tempGlobalRoot if needed
11040
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
11041
0
    }
11042
0
  } else {
11043
0
    arg0 = nullptr;
11044
0
  }
11045
0
  self->SetOnstalled(Constify(arg0));
11046
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11047
0
11048
0
  return true;
11049
0
}
11050
11051
static const JSJitInfo onstalled_getterinfo = {
11052
  { (JSJitGetterOp)get_onstalled },
11053
  { prototypes::id::Document },
11054
  { PrototypeTraits<prototypes::id::Document>::Depth },
11055
  JSJitInfo::Getter,
11056
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11057
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
11058
  false,  /* isInfallible. False in setters. */
11059
  false,  /* isMovable.  Not relevant for setters. */
11060
  false, /* isEliminatable.  Not relevant for setters. */
11061
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11062
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11063
  false,  /* isTypedMethod.  Only relevant for methods. */
11064
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11065
};
11066
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11067
static_assert(0 < 1, "There is no slot for us");
11068
static const JSJitInfo onstalled_setterinfo = {
11069
  { (JSJitGetterOp)set_onstalled },
11070
  { prototypes::id::Document },
11071
  { PrototypeTraits<prototypes::id::Document>::Depth },
11072
  JSJitInfo::Setter,
11073
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11074
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
11075
  false,  /* isInfallible. False in setters. */
11076
  false,  /* isMovable.  Not relevant for setters. */
11077
  false, /* isEliminatable.  Not relevant for setters. */
11078
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11079
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11080
  false,  /* isTypedMethod.  Only relevant for methods. */
11081
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11082
};
11083
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11084
static_assert(0 < 1, "There is no slot for us");
11085
11086
MOZ_CAN_RUN_SCRIPT static bool
11087
get_onsubmit(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
11088
0
{
11089
0
  AUTO_PROFILER_LABEL_FAST("get Document.onsubmit", DOM, cx);
11090
0
11091
0
  RefPtr<EventHandlerNonNull> result(self->GetOnsubmit());
11092
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11093
0
  if (result) {
11094
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
11095
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
11096
0
      return false;
11097
0
    }
11098
0
    return true;
11099
0
  } else {
11100
0
    args.rval().setNull();
11101
0
    return true;
11102
0
  }
11103
0
}
11104
11105
MOZ_CAN_RUN_SCRIPT static bool
11106
set_onsubmit(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
11107
0
{
11108
0
  AUTO_PROFILER_LABEL_FAST("set Document.onsubmit", DOM, cx);
11109
0
11110
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
11111
0
  if (args[0].isObject()) {
11112
0
    { // scope for tempRoot and tempGlobalRoot if needed
11113
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
11114
0
    }
11115
0
  } else {
11116
0
    arg0 = nullptr;
11117
0
  }
11118
0
  self->SetOnsubmit(Constify(arg0));
11119
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11120
0
11121
0
  return true;
11122
0
}
11123
11124
static const JSJitInfo onsubmit_getterinfo = {
11125
  { (JSJitGetterOp)get_onsubmit },
11126
  { prototypes::id::Document },
11127
  { PrototypeTraits<prototypes::id::Document>::Depth },
11128
  JSJitInfo::Getter,
11129
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11130
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
11131
  false,  /* isInfallible. False in setters. */
11132
  false,  /* isMovable.  Not relevant for setters. */
11133
  false, /* isEliminatable.  Not relevant for setters. */
11134
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11135
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11136
  false,  /* isTypedMethod.  Only relevant for methods. */
11137
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11138
};
11139
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11140
static_assert(0 < 1, "There is no slot for us");
11141
static const JSJitInfo onsubmit_setterinfo = {
11142
  { (JSJitGetterOp)set_onsubmit },
11143
  { prototypes::id::Document },
11144
  { PrototypeTraits<prototypes::id::Document>::Depth },
11145
  JSJitInfo::Setter,
11146
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11147
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
11148
  false,  /* isInfallible. False in setters. */
11149
  false,  /* isMovable.  Not relevant for setters. */
11150
  false, /* isEliminatable.  Not relevant for setters. */
11151
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11152
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11153
  false,  /* isTypedMethod.  Only relevant for methods. */
11154
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11155
};
11156
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11157
static_assert(0 < 1, "There is no slot for us");
11158
11159
MOZ_CAN_RUN_SCRIPT static bool
11160
get_onsuspend(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
11161
0
{
11162
0
  AUTO_PROFILER_LABEL_FAST("get Document.onsuspend", DOM, cx);
11163
0
11164
0
  RefPtr<EventHandlerNonNull> result(self->GetOnsuspend());
11165
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11166
0
  if (result) {
11167
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
11168
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
11169
0
      return false;
11170
0
    }
11171
0
    return true;
11172
0
  } else {
11173
0
    args.rval().setNull();
11174
0
    return true;
11175
0
  }
11176
0
}
11177
11178
MOZ_CAN_RUN_SCRIPT static bool
11179
set_onsuspend(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
11180
0
{
11181
0
  AUTO_PROFILER_LABEL_FAST("set Document.onsuspend", DOM, cx);
11182
0
11183
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
11184
0
  if (args[0].isObject()) {
11185
0
    { // scope for tempRoot and tempGlobalRoot if needed
11186
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
11187
0
    }
11188
0
  } else {
11189
0
    arg0 = nullptr;
11190
0
  }
11191
0
  self->SetOnsuspend(Constify(arg0));
11192
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11193
0
11194
0
  return true;
11195
0
}
11196
11197
static const JSJitInfo onsuspend_getterinfo = {
11198
  { (JSJitGetterOp)get_onsuspend },
11199
  { prototypes::id::Document },
11200
  { PrototypeTraits<prototypes::id::Document>::Depth },
11201
  JSJitInfo::Getter,
11202
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11203
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
11204
  false,  /* isInfallible. False in setters. */
11205
  false,  /* isMovable.  Not relevant for setters. */
11206
  false, /* isEliminatable.  Not relevant for setters. */
11207
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11208
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11209
  false,  /* isTypedMethod.  Only relevant for methods. */
11210
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11211
};
11212
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11213
static_assert(0 < 1, "There is no slot for us");
11214
static const JSJitInfo onsuspend_setterinfo = {
11215
  { (JSJitGetterOp)set_onsuspend },
11216
  { prototypes::id::Document },
11217
  { PrototypeTraits<prototypes::id::Document>::Depth },
11218
  JSJitInfo::Setter,
11219
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11220
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
11221
  false,  /* isInfallible. False in setters. */
11222
  false,  /* isMovable.  Not relevant for setters. */
11223
  false, /* isEliminatable.  Not relevant for setters. */
11224
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11225
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11226
  false,  /* isTypedMethod.  Only relevant for methods. */
11227
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11228
};
11229
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11230
static_assert(0 < 1, "There is no slot for us");
11231
11232
MOZ_CAN_RUN_SCRIPT static bool
11233
get_ontimeupdate(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
11234
0
{
11235
0
  AUTO_PROFILER_LABEL_FAST("get Document.ontimeupdate", DOM, cx);
11236
0
11237
0
  RefPtr<EventHandlerNonNull> result(self->GetOntimeupdate());
11238
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11239
0
  if (result) {
11240
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
11241
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
11242
0
      return false;
11243
0
    }
11244
0
    return true;
11245
0
  } else {
11246
0
    args.rval().setNull();
11247
0
    return true;
11248
0
  }
11249
0
}
11250
11251
MOZ_CAN_RUN_SCRIPT static bool
11252
set_ontimeupdate(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
11253
0
{
11254
0
  AUTO_PROFILER_LABEL_FAST("set Document.ontimeupdate", DOM, cx);
11255
0
11256
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
11257
0
  if (args[0].isObject()) {
11258
0
    { // scope for tempRoot and tempGlobalRoot if needed
11259
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
11260
0
    }
11261
0
  } else {
11262
0
    arg0 = nullptr;
11263
0
  }
11264
0
  self->SetOntimeupdate(Constify(arg0));
11265
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11266
0
11267
0
  return true;
11268
0
}
11269
11270
static const JSJitInfo ontimeupdate_getterinfo = {
11271
  { (JSJitGetterOp)get_ontimeupdate },
11272
  { prototypes::id::Document },
11273
  { PrototypeTraits<prototypes::id::Document>::Depth },
11274
  JSJitInfo::Getter,
11275
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11276
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
11277
  false,  /* isInfallible. False in setters. */
11278
  false,  /* isMovable.  Not relevant for setters. */
11279
  false, /* isEliminatable.  Not relevant for setters. */
11280
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11281
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11282
  false,  /* isTypedMethod.  Only relevant for methods. */
11283
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11284
};
11285
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11286
static_assert(0 < 1, "There is no slot for us");
11287
static const JSJitInfo ontimeupdate_setterinfo = {
11288
  { (JSJitGetterOp)set_ontimeupdate },
11289
  { prototypes::id::Document },
11290
  { PrototypeTraits<prototypes::id::Document>::Depth },
11291
  JSJitInfo::Setter,
11292
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11293
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
11294
  false,  /* isInfallible. False in setters. */
11295
  false,  /* isMovable.  Not relevant for setters. */
11296
  false, /* isEliminatable.  Not relevant for setters. */
11297
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11298
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11299
  false,  /* isTypedMethod.  Only relevant for methods. */
11300
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11301
};
11302
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11303
static_assert(0 < 1, "There is no slot for us");
11304
11305
MOZ_CAN_RUN_SCRIPT static bool
11306
get_onvolumechange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
11307
0
{
11308
0
  AUTO_PROFILER_LABEL_FAST("get Document.onvolumechange", DOM, cx);
11309
0
11310
0
  RefPtr<EventHandlerNonNull> result(self->GetOnvolumechange());
11311
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11312
0
  if (result) {
11313
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
11314
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
11315
0
      return false;
11316
0
    }
11317
0
    return true;
11318
0
  } else {
11319
0
    args.rval().setNull();
11320
0
    return true;
11321
0
  }
11322
0
}
11323
11324
MOZ_CAN_RUN_SCRIPT static bool
11325
set_onvolumechange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
11326
0
{
11327
0
  AUTO_PROFILER_LABEL_FAST("set Document.onvolumechange", DOM, cx);
11328
0
11329
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
11330
0
  if (args[0].isObject()) {
11331
0
    { // scope for tempRoot and tempGlobalRoot if needed
11332
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
11333
0
    }
11334
0
  } else {
11335
0
    arg0 = nullptr;
11336
0
  }
11337
0
  self->SetOnvolumechange(Constify(arg0));
11338
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11339
0
11340
0
  return true;
11341
0
}
11342
11343
static const JSJitInfo onvolumechange_getterinfo = {
11344
  { (JSJitGetterOp)get_onvolumechange },
11345
  { prototypes::id::Document },
11346
  { PrototypeTraits<prototypes::id::Document>::Depth },
11347
  JSJitInfo::Getter,
11348
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11349
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
11350
  false,  /* isInfallible. False in setters. */
11351
  false,  /* isMovable.  Not relevant for setters. */
11352
  false, /* isEliminatable.  Not relevant for setters. */
11353
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11354
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11355
  false,  /* isTypedMethod.  Only relevant for methods. */
11356
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11357
};
11358
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11359
static_assert(0 < 1, "There is no slot for us");
11360
static const JSJitInfo onvolumechange_setterinfo = {
11361
  { (JSJitGetterOp)set_onvolumechange },
11362
  { prototypes::id::Document },
11363
  { PrototypeTraits<prototypes::id::Document>::Depth },
11364
  JSJitInfo::Setter,
11365
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11366
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
11367
  false,  /* isInfallible. False in setters. */
11368
  false,  /* isMovable.  Not relevant for setters. */
11369
  false, /* isEliminatable.  Not relevant for setters. */
11370
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11371
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11372
  false,  /* isTypedMethod.  Only relevant for methods. */
11373
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11374
};
11375
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11376
static_assert(0 < 1, "There is no slot for us");
11377
11378
MOZ_CAN_RUN_SCRIPT static bool
11379
get_onwaiting(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
11380
0
{
11381
0
  AUTO_PROFILER_LABEL_FAST("get Document.onwaiting", DOM, cx);
11382
0
11383
0
  RefPtr<EventHandlerNonNull> result(self->GetOnwaiting());
11384
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11385
0
  if (result) {
11386
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
11387
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
11388
0
      return false;
11389
0
    }
11390
0
    return true;
11391
0
  } else {
11392
0
    args.rval().setNull();
11393
0
    return true;
11394
0
  }
11395
0
}
11396
11397
MOZ_CAN_RUN_SCRIPT static bool
11398
set_onwaiting(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
11399
0
{
11400
0
  AUTO_PROFILER_LABEL_FAST("set Document.onwaiting", DOM, cx);
11401
0
11402
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
11403
0
  if (args[0].isObject()) {
11404
0
    { // scope for tempRoot and tempGlobalRoot if needed
11405
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
11406
0
    }
11407
0
  } else {
11408
0
    arg0 = nullptr;
11409
0
  }
11410
0
  self->SetOnwaiting(Constify(arg0));
11411
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11412
0
11413
0
  return true;
11414
0
}
11415
11416
static const JSJitInfo onwaiting_getterinfo = {
11417
  { (JSJitGetterOp)get_onwaiting },
11418
  { prototypes::id::Document },
11419
  { PrototypeTraits<prototypes::id::Document>::Depth },
11420
  JSJitInfo::Getter,
11421
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11422
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
11423
  false,  /* isInfallible. False in setters. */
11424
  false,  /* isMovable.  Not relevant for setters. */
11425
  false, /* isEliminatable.  Not relevant for setters. */
11426
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11427
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11428
  false,  /* isTypedMethod.  Only relevant for methods. */
11429
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11430
};
11431
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11432
static_assert(0 < 1, "There is no slot for us");
11433
static const JSJitInfo onwaiting_setterinfo = {
11434
  { (JSJitGetterOp)set_onwaiting },
11435
  { prototypes::id::Document },
11436
  { PrototypeTraits<prototypes::id::Document>::Depth },
11437
  JSJitInfo::Setter,
11438
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11439
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
11440
  false,  /* isInfallible. False in setters. */
11441
  false,  /* isMovable.  Not relevant for setters. */
11442
  false, /* isEliminatable.  Not relevant for setters. */
11443
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11444
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11445
  false,  /* isTypedMethod.  Only relevant for methods. */
11446
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11447
};
11448
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11449
static_assert(0 < 1, "There is no slot for us");
11450
11451
MOZ_CAN_RUN_SCRIPT static bool
11452
get_onselectstart(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
11453
0
{
11454
0
  AUTO_PROFILER_LABEL_FAST("get Document.onselectstart", DOM, cx);
11455
0
11456
0
  RefPtr<EventHandlerNonNull> result(self->GetOnselectstart());
11457
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11458
0
  if (result) {
11459
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
11460
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
11461
0
      return false;
11462
0
    }
11463
0
    return true;
11464
0
  } else {
11465
0
    args.rval().setNull();
11466
0
    return true;
11467
0
  }
11468
0
}
11469
11470
MOZ_CAN_RUN_SCRIPT static bool
11471
set_onselectstart(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
11472
0
{
11473
0
  AUTO_PROFILER_LABEL_FAST("set Document.onselectstart", DOM, cx);
11474
0
11475
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
11476
0
  if (args[0].isObject()) {
11477
0
    { // scope for tempRoot and tempGlobalRoot if needed
11478
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
11479
0
    }
11480
0
  } else {
11481
0
    arg0 = nullptr;
11482
0
  }
11483
0
  self->SetOnselectstart(Constify(arg0));
11484
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11485
0
11486
0
  return true;
11487
0
}
11488
11489
static const JSJitInfo onselectstart_getterinfo = {
11490
  { (JSJitGetterOp)get_onselectstart },
11491
  { prototypes::id::Document },
11492
  { PrototypeTraits<prototypes::id::Document>::Depth },
11493
  JSJitInfo::Getter,
11494
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11495
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
11496
  false,  /* isInfallible. False in setters. */
11497
  false,  /* isMovable.  Not relevant for setters. */
11498
  false, /* isEliminatable.  Not relevant for setters. */
11499
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11500
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11501
  false,  /* isTypedMethod.  Only relevant for methods. */
11502
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11503
};
11504
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11505
static_assert(0 < 1, "There is no slot for us");
11506
static const JSJitInfo onselectstart_setterinfo = {
11507
  { (JSJitGetterOp)set_onselectstart },
11508
  { prototypes::id::Document },
11509
  { PrototypeTraits<prototypes::id::Document>::Depth },
11510
  JSJitInfo::Setter,
11511
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11512
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
11513
  false,  /* isInfallible. False in setters. */
11514
  false,  /* isMovable.  Not relevant for setters. */
11515
  false, /* isEliminatable.  Not relevant for setters. */
11516
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11517
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11518
  false,  /* isTypedMethod.  Only relevant for methods. */
11519
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11520
};
11521
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11522
static_assert(0 < 1, "There is no slot for us");
11523
11524
MOZ_CAN_RUN_SCRIPT static bool
11525
get_ontoggle(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
11526
0
{
11527
0
  AUTO_PROFILER_LABEL_FAST("get Document.ontoggle", DOM, cx);
11528
0
11529
0
  RefPtr<EventHandlerNonNull> result(self->GetOntoggle());
11530
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11531
0
  if (result) {
11532
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
11533
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
11534
0
      return false;
11535
0
    }
11536
0
    return true;
11537
0
  } else {
11538
0
    args.rval().setNull();
11539
0
    return true;
11540
0
  }
11541
0
}
11542
11543
MOZ_CAN_RUN_SCRIPT static bool
11544
set_ontoggle(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
11545
0
{
11546
0
  AUTO_PROFILER_LABEL_FAST("set Document.ontoggle", DOM, cx);
11547
0
11548
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
11549
0
  if (args[0].isObject()) {
11550
0
    { // scope for tempRoot and tempGlobalRoot if needed
11551
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
11552
0
    }
11553
0
  } else {
11554
0
    arg0 = nullptr;
11555
0
  }
11556
0
  self->SetOntoggle(Constify(arg0));
11557
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11558
0
11559
0
  return true;
11560
0
}
11561
11562
static const JSJitInfo ontoggle_getterinfo = {
11563
  { (JSJitGetterOp)get_ontoggle },
11564
  { prototypes::id::Document },
11565
  { PrototypeTraits<prototypes::id::Document>::Depth },
11566
  JSJitInfo::Getter,
11567
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11568
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
11569
  false,  /* isInfallible. False in setters. */
11570
  false,  /* isMovable.  Not relevant for setters. */
11571
  false, /* isEliminatable.  Not relevant for setters. */
11572
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11573
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11574
  false,  /* isTypedMethod.  Only relevant for methods. */
11575
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11576
};
11577
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11578
static_assert(0 < 1, "There is no slot for us");
11579
static const JSJitInfo ontoggle_setterinfo = {
11580
  { (JSJitGetterOp)set_ontoggle },
11581
  { prototypes::id::Document },
11582
  { PrototypeTraits<prototypes::id::Document>::Depth },
11583
  JSJitInfo::Setter,
11584
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11585
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
11586
  false,  /* isInfallible. False in setters. */
11587
  false,  /* isMovable.  Not relevant for setters. */
11588
  false, /* isEliminatable.  Not relevant for setters. */
11589
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11590
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11591
  false,  /* isTypedMethod.  Only relevant for methods. */
11592
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11593
};
11594
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11595
static_assert(0 < 1, "There is no slot for us");
11596
11597
MOZ_CAN_RUN_SCRIPT static bool
11598
get_onpointercancel(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
11599
0
{
11600
0
  AUTO_PROFILER_LABEL_FAST("get Document.onpointercancel", DOM, cx);
11601
0
11602
0
  RefPtr<EventHandlerNonNull> result(self->GetOnpointercancel());
11603
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11604
0
  if (result) {
11605
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
11606
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
11607
0
      return false;
11608
0
    }
11609
0
    return true;
11610
0
  } else {
11611
0
    args.rval().setNull();
11612
0
    return true;
11613
0
  }
11614
0
}
11615
11616
MOZ_CAN_RUN_SCRIPT static bool
11617
set_onpointercancel(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
11618
0
{
11619
0
  AUTO_PROFILER_LABEL_FAST("set Document.onpointercancel", DOM, cx);
11620
0
11621
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
11622
0
  if (args[0].isObject()) {
11623
0
    { // scope for tempRoot and tempGlobalRoot if needed
11624
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
11625
0
    }
11626
0
  } else {
11627
0
    arg0 = nullptr;
11628
0
  }
11629
0
  self->SetOnpointercancel(Constify(arg0));
11630
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11631
0
11632
0
  return true;
11633
0
}
11634
11635
static const JSJitInfo onpointercancel_getterinfo = {
11636
  { (JSJitGetterOp)get_onpointercancel },
11637
  { prototypes::id::Document },
11638
  { PrototypeTraits<prototypes::id::Document>::Depth },
11639
  JSJitInfo::Getter,
11640
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11641
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
11642
  false,  /* isInfallible. False in setters. */
11643
  false,  /* isMovable.  Not relevant for setters. */
11644
  false, /* isEliminatable.  Not relevant for setters. */
11645
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11646
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11647
  false,  /* isTypedMethod.  Only relevant for methods. */
11648
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11649
};
11650
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11651
static_assert(0 < 1, "There is no slot for us");
11652
static const JSJitInfo onpointercancel_setterinfo = {
11653
  { (JSJitGetterOp)set_onpointercancel },
11654
  { prototypes::id::Document },
11655
  { PrototypeTraits<prototypes::id::Document>::Depth },
11656
  JSJitInfo::Setter,
11657
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11658
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
11659
  false,  /* isInfallible. False in setters. */
11660
  false,  /* isMovable.  Not relevant for setters. */
11661
  false, /* isEliminatable.  Not relevant for setters. */
11662
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11663
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11664
  false,  /* isTypedMethod.  Only relevant for methods. */
11665
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11666
};
11667
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11668
static_assert(0 < 1, "There is no slot for us");
11669
11670
MOZ_CAN_RUN_SCRIPT static bool
11671
get_onpointerdown(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
11672
0
{
11673
0
  AUTO_PROFILER_LABEL_FAST("get Document.onpointerdown", DOM, cx);
11674
0
11675
0
  RefPtr<EventHandlerNonNull> result(self->GetOnpointerdown());
11676
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11677
0
  if (result) {
11678
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
11679
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
11680
0
      return false;
11681
0
    }
11682
0
    return true;
11683
0
  } else {
11684
0
    args.rval().setNull();
11685
0
    return true;
11686
0
  }
11687
0
}
11688
11689
MOZ_CAN_RUN_SCRIPT static bool
11690
set_onpointerdown(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
11691
0
{
11692
0
  AUTO_PROFILER_LABEL_FAST("set Document.onpointerdown", DOM, cx);
11693
0
11694
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
11695
0
  if (args[0].isObject()) {
11696
0
    { // scope for tempRoot and tempGlobalRoot if needed
11697
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
11698
0
    }
11699
0
  } else {
11700
0
    arg0 = nullptr;
11701
0
  }
11702
0
  self->SetOnpointerdown(Constify(arg0));
11703
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11704
0
11705
0
  return true;
11706
0
}
11707
11708
static const JSJitInfo onpointerdown_getterinfo = {
11709
  { (JSJitGetterOp)get_onpointerdown },
11710
  { prototypes::id::Document },
11711
  { PrototypeTraits<prototypes::id::Document>::Depth },
11712
  JSJitInfo::Getter,
11713
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11714
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
11715
  false,  /* isInfallible. False in setters. */
11716
  false,  /* isMovable.  Not relevant for setters. */
11717
  false, /* isEliminatable.  Not relevant for setters. */
11718
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11719
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11720
  false,  /* isTypedMethod.  Only relevant for methods. */
11721
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11722
};
11723
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11724
static_assert(0 < 1, "There is no slot for us");
11725
static const JSJitInfo onpointerdown_setterinfo = {
11726
  { (JSJitGetterOp)set_onpointerdown },
11727
  { prototypes::id::Document },
11728
  { PrototypeTraits<prototypes::id::Document>::Depth },
11729
  JSJitInfo::Setter,
11730
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11731
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
11732
  false,  /* isInfallible. False in setters. */
11733
  false,  /* isMovable.  Not relevant for setters. */
11734
  false, /* isEliminatable.  Not relevant for setters. */
11735
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11736
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11737
  false,  /* isTypedMethod.  Only relevant for methods. */
11738
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11739
};
11740
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11741
static_assert(0 < 1, "There is no slot for us");
11742
11743
MOZ_CAN_RUN_SCRIPT static bool
11744
get_onpointerup(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
11745
0
{
11746
0
  AUTO_PROFILER_LABEL_FAST("get Document.onpointerup", DOM, cx);
11747
0
11748
0
  RefPtr<EventHandlerNonNull> result(self->GetOnpointerup());
11749
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11750
0
  if (result) {
11751
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
11752
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
11753
0
      return false;
11754
0
    }
11755
0
    return true;
11756
0
  } else {
11757
0
    args.rval().setNull();
11758
0
    return true;
11759
0
  }
11760
0
}
11761
11762
MOZ_CAN_RUN_SCRIPT static bool
11763
set_onpointerup(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
11764
0
{
11765
0
  AUTO_PROFILER_LABEL_FAST("set Document.onpointerup", DOM, cx);
11766
0
11767
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
11768
0
  if (args[0].isObject()) {
11769
0
    { // scope for tempRoot and tempGlobalRoot if needed
11770
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
11771
0
    }
11772
0
  } else {
11773
0
    arg0 = nullptr;
11774
0
  }
11775
0
  self->SetOnpointerup(Constify(arg0));
11776
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11777
0
11778
0
  return true;
11779
0
}
11780
11781
static const JSJitInfo onpointerup_getterinfo = {
11782
  { (JSJitGetterOp)get_onpointerup },
11783
  { prototypes::id::Document },
11784
  { PrototypeTraits<prototypes::id::Document>::Depth },
11785
  JSJitInfo::Getter,
11786
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11787
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
11788
  false,  /* isInfallible. False in setters. */
11789
  false,  /* isMovable.  Not relevant for setters. */
11790
  false, /* isEliminatable.  Not relevant for setters. */
11791
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11792
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11793
  false,  /* isTypedMethod.  Only relevant for methods. */
11794
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11795
};
11796
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11797
static_assert(0 < 1, "There is no slot for us");
11798
static const JSJitInfo onpointerup_setterinfo = {
11799
  { (JSJitGetterOp)set_onpointerup },
11800
  { prototypes::id::Document },
11801
  { PrototypeTraits<prototypes::id::Document>::Depth },
11802
  JSJitInfo::Setter,
11803
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11804
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
11805
  false,  /* isInfallible. False in setters. */
11806
  false,  /* isMovable.  Not relevant for setters. */
11807
  false, /* isEliminatable.  Not relevant for setters. */
11808
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11809
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11810
  false,  /* isTypedMethod.  Only relevant for methods. */
11811
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11812
};
11813
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11814
static_assert(0 < 1, "There is no slot for us");
11815
11816
MOZ_CAN_RUN_SCRIPT static bool
11817
get_onpointermove(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
11818
0
{
11819
0
  AUTO_PROFILER_LABEL_FAST("get Document.onpointermove", DOM, cx);
11820
0
11821
0
  RefPtr<EventHandlerNonNull> result(self->GetOnpointermove());
11822
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11823
0
  if (result) {
11824
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
11825
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
11826
0
      return false;
11827
0
    }
11828
0
    return true;
11829
0
  } else {
11830
0
    args.rval().setNull();
11831
0
    return true;
11832
0
  }
11833
0
}
11834
11835
MOZ_CAN_RUN_SCRIPT static bool
11836
set_onpointermove(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
11837
0
{
11838
0
  AUTO_PROFILER_LABEL_FAST("set Document.onpointermove", DOM, cx);
11839
0
11840
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
11841
0
  if (args[0].isObject()) {
11842
0
    { // scope for tempRoot and tempGlobalRoot if needed
11843
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
11844
0
    }
11845
0
  } else {
11846
0
    arg0 = nullptr;
11847
0
  }
11848
0
  self->SetOnpointermove(Constify(arg0));
11849
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11850
0
11851
0
  return true;
11852
0
}
11853
11854
static const JSJitInfo onpointermove_getterinfo = {
11855
  { (JSJitGetterOp)get_onpointermove },
11856
  { prototypes::id::Document },
11857
  { PrototypeTraits<prototypes::id::Document>::Depth },
11858
  JSJitInfo::Getter,
11859
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11860
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
11861
  false,  /* isInfallible. False in setters. */
11862
  false,  /* isMovable.  Not relevant for setters. */
11863
  false, /* isEliminatable.  Not relevant for setters. */
11864
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11865
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11866
  false,  /* isTypedMethod.  Only relevant for methods. */
11867
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11868
};
11869
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11870
static_assert(0 < 1, "There is no slot for us");
11871
static const JSJitInfo onpointermove_setterinfo = {
11872
  { (JSJitGetterOp)set_onpointermove },
11873
  { prototypes::id::Document },
11874
  { PrototypeTraits<prototypes::id::Document>::Depth },
11875
  JSJitInfo::Setter,
11876
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11877
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
11878
  false,  /* isInfallible. False in setters. */
11879
  false,  /* isMovable.  Not relevant for setters. */
11880
  false, /* isEliminatable.  Not relevant for setters. */
11881
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11882
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11883
  false,  /* isTypedMethod.  Only relevant for methods. */
11884
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11885
};
11886
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11887
static_assert(0 < 1, "There is no slot for us");
11888
11889
MOZ_CAN_RUN_SCRIPT static bool
11890
get_onpointerout(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
11891
0
{
11892
0
  AUTO_PROFILER_LABEL_FAST("get Document.onpointerout", DOM, cx);
11893
0
11894
0
  RefPtr<EventHandlerNonNull> result(self->GetOnpointerout());
11895
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11896
0
  if (result) {
11897
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
11898
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
11899
0
      return false;
11900
0
    }
11901
0
    return true;
11902
0
  } else {
11903
0
    args.rval().setNull();
11904
0
    return true;
11905
0
  }
11906
0
}
11907
11908
MOZ_CAN_RUN_SCRIPT static bool
11909
set_onpointerout(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
11910
0
{
11911
0
  AUTO_PROFILER_LABEL_FAST("set Document.onpointerout", DOM, cx);
11912
0
11913
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
11914
0
  if (args[0].isObject()) {
11915
0
    { // scope for tempRoot and tempGlobalRoot if needed
11916
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
11917
0
    }
11918
0
  } else {
11919
0
    arg0 = nullptr;
11920
0
  }
11921
0
  self->SetOnpointerout(Constify(arg0));
11922
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11923
0
11924
0
  return true;
11925
0
}
11926
11927
static const JSJitInfo onpointerout_getterinfo = {
11928
  { (JSJitGetterOp)get_onpointerout },
11929
  { prototypes::id::Document },
11930
  { PrototypeTraits<prototypes::id::Document>::Depth },
11931
  JSJitInfo::Getter,
11932
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11933
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
11934
  false,  /* isInfallible. False in setters. */
11935
  false,  /* isMovable.  Not relevant for setters. */
11936
  false, /* isEliminatable.  Not relevant for setters. */
11937
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11938
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11939
  false,  /* isTypedMethod.  Only relevant for methods. */
11940
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11941
};
11942
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11943
static_assert(0 < 1, "There is no slot for us");
11944
static const JSJitInfo onpointerout_setterinfo = {
11945
  { (JSJitGetterOp)set_onpointerout },
11946
  { prototypes::id::Document },
11947
  { PrototypeTraits<prototypes::id::Document>::Depth },
11948
  JSJitInfo::Setter,
11949
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
11950
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
11951
  false,  /* isInfallible. False in setters. */
11952
  false,  /* isMovable.  Not relevant for setters. */
11953
  false, /* isEliminatable.  Not relevant for setters. */
11954
  false, /* isAlwaysInSlot.  Only relevant for getters. */
11955
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
11956
  false,  /* isTypedMethod.  Only relevant for methods. */
11957
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
11958
};
11959
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
11960
static_assert(0 < 1, "There is no slot for us");
11961
11962
MOZ_CAN_RUN_SCRIPT static bool
11963
get_onpointerover(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
11964
0
{
11965
0
  AUTO_PROFILER_LABEL_FAST("get Document.onpointerover", DOM, cx);
11966
0
11967
0
  RefPtr<EventHandlerNonNull> result(self->GetOnpointerover());
11968
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11969
0
  if (result) {
11970
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
11971
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
11972
0
      return false;
11973
0
    }
11974
0
    return true;
11975
0
  } else {
11976
0
    args.rval().setNull();
11977
0
    return true;
11978
0
  }
11979
0
}
11980
11981
MOZ_CAN_RUN_SCRIPT static bool
11982
set_onpointerover(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
11983
0
{
11984
0
  AUTO_PROFILER_LABEL_FAST("set Document.onpointerover", DOM, cx);
11985
0
11986
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
11987
0
  if (args[0].isObject()) {
11988
0
    { // scope for tempRoot and tempGlobalRoot if needed
11989
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
11990
0
    }
11991
0
  } else {
11992
0
    arg0 = nullptr;
11993
0
  }
11994
0
  self->SetOnpointerover(Constify(arg0));
11995
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
11996
0
11997
0
  return true;
11998
0
}
11999
12000
static const JSJitInfo onpointerover_getterinfo = {
12001
  { (JSJitGetterOp)get_onpointerover },
12002
  { prototypes::id::Document },
12003
  { PrototypeTraits<prototypes::id::Document>::Depth },
12004
  JSJitInfo::Getter,
12005
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12006
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
12007
  false,  /* isInfallible. False in setters. */
12008
  false,  /* isMovable.  Not relevant for setters. */
12009
  false, /* isEliminatable.  Not relevant for setters. */
12010
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12011
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12012
  false,  /* isTypedMethod.  Only relevant for methods. */
12013
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12014
};
12015
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12016
static_assert(0 < 1, "There is no slot for us");
12017
static const JSJitInfo onpointerover_setterinfo = {
12018
  { (JSJitGetterOp)set_onpointerover },
12019
  { prototypes::id::Document },
12020
  { PrototypeTraits<prototypes::id::Document>::Depth },
12021
  JSJitInfo::Setter,
12022
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12023
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
12024
  false,  /* isInfallible. False in setters. */
12025
  false,  /* isMovable.  Not relevant for setters. */
12026
  false, /* isEliminatable.  Not relevant for setters. */
12027
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12028
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12029
  false,  /* isTypedMethod.  Only relevant for methods. */
12030
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12031
};
12032
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12033
static_assert(0 < 1, "There is no slot for us");
12034
12035
MOZ_CAN_RUN_SCRIPT static bool
12036
get_onpointerenter(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
12037
0
{
12038
0
  AUTO_PROFILER_LABEL_FAST("get Document.onpointerenter", DOM, cx);
12039
0
12040
0
  RefPtr<EventHandlerNonNull> result(self->GetOnpointerenter());
12041
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12042
0
  if (result) {
12043
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
12044
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
12045
0
      return false;
12046
0
    }
12047
0
    return true;
12048
0
  } else {
12049
0
    args.rval().setNull();
12050
0
    return true;
12051
0
  }
12052
0
}
12053
12054
MOZ_CAN_RUN_SCRIPT static bool
12055
set_onpointerenter(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
12056
0
{
12057
0
  AUTO_PROFILER_LABEL_FAST("set Document.onpointerenter", DOM, cx);
12058
0
12059
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
12060
0
  if (args[0].isObject()) {
12061
0
    { // scope for tempRoot and tempGlobalRoot if needed
12062
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
12063
0
    }
12064
0
  } else {
12065
0
    arg0 = nullptr;
12066
0
  }
12067
0
  self->SetOnpointerenter(Constify(arg0));
12068
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12069
0
12070
0
  return true;
12071
0
}
12072
12073
static const JSJitInfo onpointerenter_getterinfo = {
12074
  { (JSJitGetterOp)get_onpointerenter },
12075
  { prototypes::id::Document },
12076
  { PrototypeTraits<prototypes::id::Document>::Depth },
12077
  JSJitInfo::Getter,
12078
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12079
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
12080
  false,  /* isInfallible. False in setters. */
12081
  false,  /* isMovable.  Not relevant for setters. */
12082
  false, /* isEliminatable.  Not relevant for setters. */
12083
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12084
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12085
  false,  /* isTypedMethod.  Only relevant for methods. */
12086
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12087
};
12088
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12089
static_assert(0 < 1, "There is no slot for us");
12090
static const JSJitInfo onpointerenter_setterinfo = {
12091
  { (JSJitGetterOp)set_onpointerenter },
12092
  { prototypes::id::Document },
12093
  { PrototypeTraits<prototypes::id::Document>::Depth },
12094
  JSJitInfo::Setter,
12095
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12096
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
12097
  false,  /* isInfallible. False in setters. */
12098
  false,  /* isMovable.  Not relevant for setters. */
12099
  false, /* isEliminatable.  Not relevant for setters. */
12100
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12101
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12102
  false,  /* isTypedMethod.  Only relevant for methods. */
12103
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12104
};
12105
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12106
static_assert(0 < 1, "There is no slot for us");
12107
12108
MOZ_CAN_RUN_SCRIPT static bool
12109
get_onpointerleave(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
12110
0
{
12111
0
  AUTO_PROFILER_LABEL_FAST("get Document.onpointerleave", DOM, cx);
12112
0
12113
0
  RefPtr<EventHandlerNonNull> result(self->GetOnpointerleave());
12114
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12115
0
  if (result) {
12116
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
12117
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
12118
0
      return false;
12119
0
    }
12120
0
    return true;
12121
0
  } else {
12122
0
    args.rval().setNull();
12123
0
    return true;
12124
0
  }
12125
0
}
12126
12127
MOZ_CAN_RUN_SCRIPT static bool
12128
set_onpointerleave(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
12129
0
{
12130
0
  AUTO_PROFILER_LABEL_FAST("set Document.onpointerleave", DOM, cx);
12131
0
12132
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
12133
0
  if (args[0].isObject()) {
12134
0
    { // scope for tempRoot and tempGlobalRoot if needed
12135
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
12136
0
    }
12137
0
  } else {
12138
0
    arg0 = nullptr;
12139
0
  }
12140
0
  self->SetOnpointerleave(Constify(arg0));
12141
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12142
0
12143
0
  return true;
12144
0
}
12145
12146
static const JSJitInfo onpointerleave_getterinfo = {
12147
  { (JSJitGetterOp)get_onpointerleave },
12148
  { prototypes::id::Document },
12149
  { PrototypeTraits<prototypes::id::Document>::Depth },
12150
  JSJitInfo::Getter,
12151
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12152
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
12153
  false,  /* isInfallible. False in setters. */
12154
  false,  /* isMovable.  Not relevant for setters. */
12155
  false, /* isEliminatable.  Not relevant for setters. */
12156
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12157
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12158
  false,  /* isTypedMethod.  Only relevant for methods. */
12159
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12160
};
12161
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12162
static_assert(0 < 1, "There is no slot for us");
12163
static const JSJitInfo onpointerleave_setterinfo = {
12164
  { (JSJitGetterOp)set_onpointerleave },
12165
  { prototypes::id::Document },
12166
  { PrototypeTraits<prototypes::id::Document>::Depth },
12167
  JSJitInfo::Setter,
12168
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12169
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
12170
  false,  /* isInfallible. False in setters. */
12171
  false,  /* isMovable.  Not relevant for setters. */
12172
  false, /* isEliminatable.  Not relevant for setters. */
12173
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12174
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12175
  false,  /* isTypedMethod.  Only relevant for methods. */
12176
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12177
};
12178
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12179
static_assert(0 < 1, "There is no slot for us");
12180
12181
MOZ_CAN_RUN_SCRIPT static bool
12182
get_ongotpointercapture(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
12183
0
{
12184
0
  AUTO_PROFILER_LABEL_FAST("get Document.ongotpointercapture", DOM, cx);
12185
0
12186
0
  RefPtr<EventHandlerNonNull> result(self->GetOngotpointercapture());
12187
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12188
0
  if (result) {
12189
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
12190
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
12191
0
      return false;
12192
0
    }
12193
0
    return true;
12194
0
  } else {
12195
0
    args.rval().setNull();
12196
0
    return true;
12197
0
  }
12198
0
}
12199
12200
MOZ_CAN_RUN_SCRIPT static bool
12201
set_ongotpointercapture(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
12202
0
{
12203
0
  AUTO_PROFILER_LABEL_FAST("set Document.ongotpointercapture", DOM, cx);
12204
0
12205
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
12206
0
  if (args[0].isObject()) {
12207
0
    { // scope for tempRoot and tempGlobalRoot if needed
12208
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
12209
0
    }
12210
0
  } else {
12211
0
    arg0 = nullptr;
12212
0
  }
12213
0
  self->SetOngotpointercapture(Constify(arg0));
12214
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12215
0
12216
0
  return true;
12217
0
}
12218
12219
static const JSJitInfo ongotpointercapture_getterinfo = {
12220
  { (JSJitGetterOp)get_ongotpointercapture },
12221
  { prototypes::id::Document },
12222
  { PrototypeTraits<prototypes::id::Document>::Depth },
12223
  JSJitInfo::Getter,
12224
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12225
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
12226
  false,  /* isInfallible. False in setters. */
12227
  false,  /* isMovable.  Not relevant for setters. */
12228
  false, /* isEliminatable.  Not relevant for setters. */
12229
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12230
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12231
  false,  /* isTypedMethod.  Only relevant for methods. */
12232
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12233
};
12234
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12235
static_assert(0 < 1, "There is no slot for us");
12236
static const JSJitInfo ongotpointercapture_setterinfo = {
12237
  { (JSJitGetterOp)set_ongotpointercapture },
12238
  { prototypes::id::Document },
12239
  { PrototypeTraits<prototypes::id::Document>::Depth },
12240
  JSJitInfo::Setter,
12241
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12242
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
12243
  false,  /* isInfallible. False in setters. */
12244
  false,  /* isMovable.  Not relevant for setters. */
12245
  false, /* isEliminatable.  Not relevant for setters. */
12246
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12247
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12248
  false,  /* isTypedMethod.  Only relevant for methods. */
12249
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12250
};
12251
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12252
static_assert(0 < 1, "There is no slot for us");
12253
12254
MOZ_CAN_RUN_SCRIPT static bool
12255
get_onlostpointercapture(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
12256
0
{
12257
0
  AUTO_PROFILER_LABEL_FAST("get Document.onlostpointercapture", DOM, cx);
12258
0
12259
0
  RefPtr<EventHandlerNonNull> result(self->GetOnlostpointercapture());
12260
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12261
0
  if (result) {
12262
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
12263
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
12264
0
      return false;
12265
0
    }
12266
0
    return true;
12267
0
  } else {
12268
0
    args.rval().setNull();
12269
0
    return true;
12270
0
  }
12271
0
}
12272
12273
MOZ_CAN_RUN_SCRIPT static bool
12274
set_onlostpointercapture(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
12275
0
{
12276
0
  AUTO_PROFILER_LABEL_FAST("set Document.onlostpointercapture", DOM, cx);
12277
0
12278
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
12279
0
  if (args[0].isObject()) {
12280
0
    { // scope for tempRoot and tempGlobalRoot if needed
12281
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
12282
0
    }
12283
0
  } else {
12284
0
    arg0 = nullptr;
12285
0
  }
12286
0
  self->SetOnlostpointercapture(Constify(arg0));
12287
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12288
0
12289
0
  return true;
12290
0
}
12291
12292
static const JSJitInfo onlostpointercapture_getterinfo = {
12293
  { (JSJitGetterOp)get_onlostpointercapture },
12294
  { prototypes::id::Document },
12295
  { PrototypeTraits<prototypes::id::Document>::Depth },
12296
  JSJitInfo::Getter,
12297
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12298
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
12299
  false,  /* isInfallible. False in setters. */
12300
  false,  /* isMovable.  Not relevant for setters. */
12301
  false, /* isEliminatable.  Not relevant for setters. */
12302
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12303
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12304
  false,  /* isTypedMethod.  Only relevant for methods. */
12305
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12306
};
12307
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12308
static_assert(0 < 1, "There is no slot for us");
12309
static const JSJitInfo onlostpointercapture_setterinfo = {
12310
  { (JSJitGetterOp)set_onlostpointercapture },
12311
  { prototypes::id::Document },
12312
  { PrototypeTraits<prototypes::id::Document>::Depth },
12313
  JSJitInfo::Setter,
12314
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12315
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
12316
  false,  /* isInfallible. False in setters. */
12317
  false,  /* isMovable.  Not relevant for setters. */
12318
  false, /* isEliminatable.  Not relevant for setters. */
12319
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12320
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12321
  false,  /* isTypedMethod.  Only relevant for methods. */
12322
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12323
};
12324
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12325
static_assert(0 < 1, "There is no slot for us");
12326
12327
MOZ_CAN_RUN_SCRIPT static bool
12328
get_onmozfullscreenchange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
12329
0
{
12330
0
  AUTO_PROFILER_LABEL_FAST("get Document.onmozfullscreenchange", DOM, cx);
12331
0
12332
0
  RefPtr<EventHandlerNonNull> result(self->GetOnmozfullscreenchange());
12333
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12334
0
  if (result) {
12335
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
12336
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
12337
0
      return false;
12338
0
    }
12339
0
    return true;
12340
0
  } else {
12341
0
    args.rval().setNull();
12342
0
    return true;
12343
0
  }
12344
0
}
12345
12346
MOZ_CAN_RUN_SCRIPT static bool
12347
set_onmozfullscreenchange(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
12348
0
{
12349
0
  AUTO_PROFILER_LABEL_FAST("set Document.onmozfullscreenchange", DOM, cx);
12350
0
12351
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
12352
0
  if (args[0].isObject()) {
12353
0
    { // scope for tempRoot and tempGlobalRoot if needed
12354
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
12355
0
    }
12356
0
  } else {
12357
0
    arg0 = nullptr;
12358
0
  }
12359
0
  self->SetOnmozfullscreenchange(Constify(arg0));
12360
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12361
0
12362
0
  return true;
12363
0
}
12364
12365
static const JSJitInfo onmozfullscreenchange_getterinfo = {
12366
  { (JSJitGetterOp)get_onmozfullscreenchange },
12367
  { prototypes::id::Document },
12368
  { PrototypeTraits<prototypes::id::Document>::Depth },
12369
  JSJitInfo::Getter,
12370
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12371
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
12372
  false,  /* isInfallible. False in setters. */
12373
  false,  /* isMovable.  Not relevant for setters. */
12374
  false, /* isEliminatable.  Not relevant for setters. */
12375
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12376
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12377
  false,  /* isTypedMethod.  Only relevant for methods. */
12378
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12379
};
12380
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12381
static_assert(0 < 1, "There is no slot for us");
12382
static const JSJitInfo onmozfullscreenchange_setterinfo = {
12383
  { (JSJitGetterOp)set_onmozfullscreenchange },
12384
  { prototypes::id::Document },
12385
  { PrototypeTraits<prototypes::id::Document>::Depth },
12386
  JSJitInfo::Setter,
12387
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12388
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
12389
  false,  /* isInfallible. False in setters. */
12390
  false,  /* isMovable.  Not relevant for setters. */
12391
  false, /* isEliminatable.  Not relevant for setters. */
12392
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12393
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12394
  false,  /* isTypedMethod.  Only relevant for methods. */
12395
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12396
};
12397
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12398
static_assert(0 < 1, "There is no slot for us");
12399
12400
MOZ_CAN_RUN_SCRIPT static bool
12401
get_onmozfullscreenerror(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
12402
0
{
12403
0
  AUTO_PROFILER_LABEL_FAST("get Document.onmozfullscreenerror", DOM, cx);
12404
0
12405
0
  RefPtr<EventHandlerNonNull> result(self->GetOnmozfullscreenerror());
12406
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12407
0
  if (result) {
12408
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
12409
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
12410
0
      return false;
12411
0
    }
12412
0
    return true;
12413
0
  } else {
12414
0
    args.rval().setNull();
12415
0
    return true;
12416
0
  }
12417
0
}
12418
12419
MOZ_CAN_RUN_SCRIPT static bool
12420
set_onmozfullscreenerror(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
12421
0
{
12422
0
  AUTO_PROFILER_LABEL_FAST("set Document.onmozfullscreenerror", DOM, cx);
12423
0
12424
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
12425
0
  if (args[0].isObject()) {
12426
0
    { // scope for tempRoot and tempGlobalRoot if needed
12427
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
12428
0
    }
12429
0
  } else {
12430
0
    arg0 = nullptr;
12431
0
  }
12432
0
  self->SetOnmozfullscreenerror(Constify(arg0));
12433
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12434
0
12435
0
  return true;
12436
0
}
12437
12438
static const JSJitInfo onmozfullscreenerror_getterinfo = {
12439
  { (JSJitGetterOp)get_onmozfullscreenerror },
12440
  { prototypes::id::Document },
12441
  { PrototypeTraits<prototypes::id::Document>::Depth },
12442
  JSJitInfo::Getter,
12443
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12444
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
12445
  false,  /* isInfallible. False in setters. */
12446
  false,  /* isMovable.  Not relevant for setters. */
12447
  false, /* isEliminatable.  Not relevant for setters. */
12448
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12449
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12450
  false,  /* isTypedMethod.  Only relevant for methods. */
12451
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12452
};
12453
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12454
static_assert(0 < 1, "There is no slot for us");
12455
static const JSJitInfo onmozfullscreenerror_setterinfo = {
12456
  { (JSJitGetterOp)set_onmozfullscreenerror },
12457
  { prototypes::id::Document },
12458
  { PrototypeTraits<prototypes::id::Document>::Depth },
12459
  JSJitInfo::Setter,
12460
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12461
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
12462
  false,  /* isInfallible. False in setters. */
12463
  false,  /* isMovable.  Not relevant for setters. */
12464
  false, /* isEliminatable.  Not relevant for setters. */
12465
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12466
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12467
  false,  /* isTypedMethod.  Only relevant for methods. */
12468
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12469
};
12470
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12471
static_assert(0 < 1, "There is no slot for us");
12472
12473
MOZ_CAN_RUN_SCRIPT static bool
12474
get_onanimationcancel(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
12475
0
{
12476
0
  AUTO_PROFILER_LABEL_FAST("get Document.onanimationcancel", DOM, cx);
12477
0
12478
0
  RefPtr<EventHandlerNonNull> result(self->GetOnanimationcancel());
12479
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12480
0
  if (result) {
12481
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
12482
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
12483
0
      return false;
12484
0
    }
12485
0
    return true;
12486
0
  } else {
12487
0
    args.rval().setNull();
12488
0
    return true;
12489
0
  }
12490
0
}
12491
12492
MOZ_CAN_RUN_SCRIPT static bool
12493
set_onanimationcancel(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
12494
0
{
12495
0
  AUTO_PROFILER_LABEL_FAST("set Document.onanimationcancel", DOM, cx);
12496
0
12497
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
12498
0
  if (args[0].isObject()) {
12499
0
    { // scope for tempRoot and tempGlobalRoot if needed
12500
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
12501
0
    }
12502
0
  } else {
12503
0
    arg0 = nullptr;
12504
0
  }
12505
0
  self->SetOnanimationcancel(Constify(arg0));
12506
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12507
0
12508
0
  return true;
12509
0
}
12510
12511
static const JSJitInfo onanimationcancel_getterinfo = {
12512
  { (JSJitGetterOp)get_onanimationcancel },
12513
  { prototypes::id::Document },
12514
  { PrototypeTraits<prototypes::id::Document>::Depth },
12515
  JSJitInfo::Getter,
12516
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12517
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
12518
  false,  /* isInfallible. False in setters. */
12519
  false,  /* isMovable.  Not relevant for setters. */
12520
  false, /* isEliminatable.  Not relevant for setters. */
12521
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12522
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12523
  false,  /* isTypedMethod.  Only relevant for methods. */
12524
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12525
};
12526
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12527
static_assert(0 < 1, "There is no slot for us");
12528
static const JSJitInfo onanimationcancel_setterinfo = {
12529
  { (JSJitGetterOp)set_onanimationcancel },
12530
  { prototypes::id::Document },
12531
  { PrototypeTraits<prototypes::id::Document>::Depth },
12532
  JSJitInfo::Setter,
12533
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12534
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
12535
  false,  /* isInfallible. False in setters. */
12536
  false,  /* isMovable.  Not relevant for setters. */
12537
  false, /* isEliminatable.  Not relevant for setters. */
12538
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12539
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12540
  false,  /* isTypedMethod.  Only relevant for methods. */
12541
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12542
};
12543
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12544
static_assert(0 < 1, "There is no slot for us");
12545
12546
MOZ_CAN_RUN_SCRIPT static bool
12547
get_onanimationend(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
12548
0
{
12549
0
  AUTO_PROFILER_LABEL_FAST("get Document.onanimationend", DOM, cx);
12550
0
12551
0
  RefPtr<EventHandlerNonNull> result(self->GetOnanimationend());
12552
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12553
0
  if (result) {
12554
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
12555
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
12556
0
      return false;
12557
0
    }
12558
0
    return true;
12559
0
  } else {
12560
0
    args.rval().setNull();
12561
0
    return true;
12562
0
  }
12563
0
}
12564
12565
MOZ_CAN_RUN_SCRIPT static bool
12566
set_onanimationend(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
12567
0
{
12568
0
  AUTO_PROFILER_LABEL_FAST("set Document.onanimationend", DOM, cx);
12569
0
12570
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
12571
0
  if (args[0].isObject()) {
12572
0
    { // scope for tempRoot and tempGlobalRoot if needed
12573
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
12574
0
    }
12575
0
  } else {
12576
0
    arg0 = nullptr;
12577
0
  }
12578
0
  self->SetOnanimationend(Constify(arg0));
12579
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12580
0
12581
0
  return true;
12582
0
}
12583
12584
static const JSJitInfo onanimationend_getterinfo = {
12585
  { (JSJitGetterOp)get_onanimationend },
12586
  { prototypes::id::Document },
12587
  { PrototypeTraits<prototypes::id::Document>::Depth },
12588
  JSJitInfo::Getter,
12589
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12590
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
12591
  false,  /* isInfallible. False in setters. */
12592
  false,  /* isMovable.  Not relevant for setters. */
12593
  false, /* isEliminatable.  Not relevant for setters. */
12594
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12595
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12596
  false,  /* isTypedMethod.  Only relevant for methods. */
12597
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12598
};
12599
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12600
static_assert(0 < 1, "There is no slot for us");
12601
static const JSJitInfo onanimationend_setterinfo = {
12602
  { (JSJitGetterOp)set_onanimationend },
12603
  { prototypes::id::Document },
12604
  { PrototypeTraits<prototypes::id::Document>::Depth },
12605
  JSJitInfo::Setter,
12606
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12607
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
12608
  false,  /* isInfallible. False in setters. */
12609
  false,  /* isMovable.  Not relevant for setters. */
12610
  false, /* isEliminatable.  Not relevant for setters. */
12611
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12612
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12613
  false,  /* isTypedMethod.  Only relevant for methods. */
12614
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12615
};
12616
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12617
static_assert(0 < 1, "There is no slot for us");
12618
12619
MOZ_CAN_RUN_SCRIPT static bool
12620
get_onanimationiteration(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
12621
0
{
12622
0
  AUTO_PROFILER_LABEL_FAST("get Document.onanimationiteration", DOM, cx);
12623
0
12624
0
  RefPtr<EventHandlerNonNull> result(self->GetOnanimationiteration());
12625
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12626
0
  if (result) {
12627
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
12628
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
12629
0
      return false;
12630
0
    }
12631
0
    return true;
12632
0
  } else {
12633
0
    args.rval().setNull();
12634
0
    return true;
12635
0
  }
12636
0
}
12637
12638
MOZ_CAN_RUN_SCRIPT static bool
12639
set_onanimationiteration(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
12640
0
{
12641
0
  AUTO_PROFILER_LABEL_FAST("set Document.onanimationiteration", DOM, cx);
12642
0
12643
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
12644
0
  if (args[0].isObject()) {
12645
0
    { // scope for tempRoot and tempGlobalRoot if needed
12646
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
12647
0
    }
12648
0
  } else {
12649
0
    arg0 = nullptr;
12650
0
  }
12651
0
  self->SetOnanimationiteration(Constify(arg0));
12652
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12653
0
12654
0
  return true;
12655
0
}
12656
12657
static const JSJitInfo onanimationiteration_getterinfo = {
12658
  { (JSJitGetterOp)get_onanimationiteration },
12659
  { prototypes::id::Document },
12660
  { PrototypeTraits<prototypes::id::Document>::Depth },
12661
  JSJitInfo::Getter,
12662
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12663
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
12664
  false,  /* isInfallible. False in setters. */
12665
  false,  /* isMovable.  Not relevant for setters. */
12666
  false, /* isEliminatable.  Not relevant for setters. */
12667
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12668
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12669
  false,  /* isTypedMethod.  Only relevant for methods. */
12670
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12671
};
12672
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12673
static_assert(0 < 1, "There is no slot for us");
12674
static const JSJitInfo onanimationiteration_setterinfo = {
12675
  { (JSJitGetterOp)set_onanimationiteration },
12676
  { prototypes::id::Document },
12677
  { PrototypeTraits<prototypes::id::Document>::Depth },
12678
  JSJitInfo::Setter,
12679
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12680
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
12681
  false,  /* isInfallible. False in setters. */
12682
  false,  /* isMovable.  Not relevant for setters. */
12683
  false, /* isEliminatable.  Not relevant for setters. */
12684
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12685
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12686
  false,  /* isTypedMethod.  Only relevant for methods. */
12687
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12688
};
12689
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12690
static_assert(0 < 1, "There is no slot for us");
12691
12692
MOZ_CAN_RUN_SCRIPT static bool
12693
get_onanimationstart(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
12694
0
{
12695
0
  AUTO_PROFILER_LABEL_FAST("get Document.onanimationstart", DOM, cx);
12696
0
12697
0
  RefPtr<EventHandlerNonNull> result(self->GetOnanimationstart());
12698
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12699
0
  if (result) {
12700
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
12701
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
12702
0
      return false;
12703
0
    }
12704
0
    return true;
12705
0
  } else {
12706
0
    args.rval().setNull();
12707
0
    return true;
12708
0
  }
12709
0
}
12710
12711
MOZ_CAN_RUN_SCRIPT static bool
12712
set_onanimationstart(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
12713
0
{
12714
0
  AUTO_PROFILER_LABEL_FAST("set Document.onanimationstart", DOM, cx);
12715
0
12716
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
12717
0
  if (args[0].isObject()) {
12718
0
    { // scope for tempRoot and tempGlobalRoot if needed
12719
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
12720
0
    }
12721
0
  } else {
12722
0
    arg0 = nullptr;
12723
0
  }
12724
0
  self->SetOnanimationstart(Constify(arg0));
12725
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12726
0
12727
0
  return true;
12728
0
}
12729
12730
static const JSJitInfo onanimationstart_getterinfo = {
12731
  { (JSJitGetterOp)get_onanimationstart },
12732
  { prototypes::id::Document },
12733
  { PrototypeTraits<prototypes::id::Document>::Depth },
12734
  JSJitInfo::Getter,
12735
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12736
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
12737
  false,  /* isInfallible. False in setters. */
12738
  false,  /* isMovable.  Not relevant for setters. */
12739
  false, /* isEliminatable.  Not relevant for setters. */
12740
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12741
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12742
  false,  /* isTypedMethod.  Only relevant for methods. */
12743
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12744
};
12745
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12746
static_assert(0 < 1, "There is no slot for us");
12747
static const JSJitInfo onanimationstart_setterinfo = {
12748
  { (JSJitGetterOp)set_onanimationstart },
12749
  { prototypes::id::Document },
12750
  { PrototypeTraits<prototypes::id::Document>::Depth },
12751
  JSJitInfo::Setter,
12752
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12753
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
12754
  false,  /* isInfallible. False in setters. */
12755
  false,  /* isMovable.  Not relevant for setters. */
12756
  false, /* isEliminatable.  Not relevant for setters. */
12757
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12758
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12759
  false,  /* isTypedMethod.  Only relevant for methods. */
12760
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12761
};
12762
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12763
static_assert(0 < 1, "There is no slot for us");
12764
12765
MOZ_CAN_RUN_SCRIPT static bool
12766
get_ontransitioncancel(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
12767
0
{
12768
0
  AUTO_PROFILER_LABEL_FAST("get Document.ontransitioncancel", DOM, cx);
12769
0
12770
0
  RefPtr<EventHandlerNonNull> result(self->GetOntransitioncancel());
12771
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12772
0
  if (result) {
12773
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
12774
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
12775
0
      return false;
12776
0
    }
12777
0
    return true;
12778
0
  } else {
12779
0
    args.rval().setNull();
12780
0
    return true;
12781
0
  }
12782
0
}
12783
12784
MOZ_CAN_RUN_SCRIPT static bool
12785
set_ontransitioncancel(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
12786
0
{
12787
0
  AUTO_PROFILER_LABEL_FAST("set Document.ontransitioncancel", DOM, cx);
12788
0
12789
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
12790
0
  if (args[0].isObject()) {
12791
0
    { // scope for tempRoot and tempGlobalRoot if needed
12792
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
12793
0
    }
12794
0
  } else {
12795
0
    arg0 = nullptr;
12796
0
  }
12797
0
  self->SetOntransitioncancel(Constify(arg0));
12798
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12799
0
12800
0
  return true;
12801
0
}
12802
12803
static const JSJitInfo ontransitioncancel_getterinfo = {
12804
  { (JSJitGetterOp)get_ontransitioncancel },
12805
  { prototypes::id::Document },
12806
  { PrototypeTraits<prototypes::id::Document>::Depth },
12807
  JSJitInfo::Getter,
12808
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12809
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
12810
  false,  /* isInfallible. False in setters. */
12811
  false,  /* isMovable.  Not relevant for setters. */
12812
  false, /* isEliminatable.  Not relevant for setters. */
12813
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12814
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12815
  false,  /* isTypedMethod.  Only relevant for methods. */
12816
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12817
};
12818
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12819
static_assert(0 < 1, "There is no slot for us");
12820
static const JSJitInfo ontransitioncancel_setterinfo = {
12821
  { (JSJitGetterOp)set_ontransitioncancel },
12822
  { prototypes::id::Document },
12823
  { PrototypeTraits<prototypes::id::Document>::Depth },
12824
  JSJitInfo::Setter,
12825
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12826
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
12827
  false,  /* isInfallible. False in setters. */
12828
  false,  /* isMovable.  Not relevant for setters. */
12829
  false, /* isEliminatable.  Not relevant for setters. */
12830
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12831
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12832
  false,  /* isTypedMethod.  Only relevant for methods. */
12833
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12834
};
12835
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12836
static_assert(0 < 1, "There is no slot for us");
12837
12838
MOZ_CAN_RUN_SCRIPT static bool
12839
get_ontransitionend(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
12840
0
{
12841
0
  AUTO_PROFILER_LABEL_FAST("get Document.ontransitionend", DOM, cx);
12842
0
12843
0
  RefPtr<EventHandlerNonNull> result(self->GetOntransitionend());
12844
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12845
0
  if (result) {
12846
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
12847
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
12848
0
      return false;
12849
0
    }
12850
0
    return true;
12851
0
  } else {
12852
0
    args.rval().setNull();
12853
0
    return true;
12854
0
  }
12855
0
}
12856
12857
MOZ_CAN_RUN_SCRIPT static bool
12858
set_ontransitionend(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
12859
0
{
12860
0
  AUTO_PROFILER_LABEL_FAST("set Document.ontransitionend", DOM, cx);
12861
0
12862
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
12863
0
  if (args[0].isObject()) {
12864
0
    { // scope for tempRoot and tempGlobalRoot if needed
12865
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
12866
0
    }
12867
0
  } else {
12868
0
    arg0 = nullptr;
12869
0
  }
12870
0
  self->SetOntransitionend(Constify(arg0));
12871
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12872
0
12873
0
  return true;
12874
0
}
12875
12876
static const JSJitInfo ontransitionend_getterinfo = {
12877
  { (JSJitGetterOp)get_ontransitionend },
12878
  { prototypes::id::Document },
12879
  { PrototypeTraits<prototypes::id::Document>::Depth },
12880
  JSJitInfo::Getter,
12881
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12882
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
12883
  false,  /* isInfallible. False in setters. */
12884
  false,  /* isMovable.  Not relevant for setters. */
12885
  false, /* isEliminatable.  Not relevant for setters. */
12886
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12887
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12888
  false,  /* isTypedMethod.  Only relevant for methods. */
12889
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12890
};
12891
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12892
static_assert(0 < 1, "There is no slot for us");
12893
static const JSJitInfo ontransitionend_setterinfo = {
12894
  { (JSJitGetterOp)set_ontransitionend },
12895
  { prototypes::id::Document },
12896
  { PrototypeTraits<prototypes::id::Document>::Depth },
12897
  JSJitInfo::Setter,
12898
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12899
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
12900
  false,  /* isInfallible. False in setters. */
12901
  false,  /* isMovable.  Not relevant for setters. */
12902
  false, /* isEliminatable.  Not relevant for setters. */
12903
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12904
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12905
  false,  /* isTypedMethod.  Only relevant for methods. */
12906
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12907
};
12908
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12909
static_assert(0 < 1, "There is no slot for us");
12910
12911
MOZ_CAN_RUN_SCRIPT static bool
12912
get_ontransitionrun(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
12913
0
{
12914
0
  AUTO_PROFILER_LABEL_FAST("get Document.ontransitionrun", DOM, cx);
12915
0
12916
0
  RefPtr<EventHandlerNonNull> result(self->GetOntransitionrun());
12917
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12918
0
  if (result) {
12919
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
12920
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
12921
0
      return false;
12922
0
    }
12923
0
    return true;
12924
0
  } else {
12925
0
    args.rval().setNull();
12926
0
    return true;
12927
0
  }
12928
0
}
12929
12930
MOZ_CAN_RUN_SCRIPT static bool
12931
set_ontransitionrun(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
12932
0
{
12933
0
  AUTO_PROFILER_LABEL_FAST("set Document.ontransitionrun", DOM, cx);
12934
0
12935
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
12936
0
  if (args[0].isObject()) {
12937
0
    { // scope for tempRoot and tempGlobalRoot if needed
12938
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
12939
0
    }
12940
0
  } else {
12941
0
    arg0 = nullptr;
12942
0
  }
12943
0
  self->SetOntransitionrun(Constify(arg0));
12944
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12945
0
12946
0
  return true;
12947
0
}
12948
12949
static const JSJitInfo ontransitionrun_getterinfo = {
12950
  { (JSJitGetterOp)get_ontransitionrun },
12951
  { prototypes::id::Document },
12952
  { PrototypeTraits<prototypes::id::Document>::Depth },
12953
  JSJitInfo::Getter,
12954
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12955
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
12956
  false,  /* isInfallible. False in setters. */
12957
  false,  /* isMovable.  Not relevant for setters. */
12958
  false, /* isEliminatable.  Not relevant for setters. */
12959
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12960
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12961
  false,  /* isTypedMethod.  Only relevant for methods. */
12962
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12963
};
12964
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12965
static_assert(0 < 1, "There is no slot for us");
12966
static const JSJitInfo ontransitionrun_setterinfo = {
12967
  { (JSJitGetterOp)set_ontransitionrun },
12968
  { prototypes::id::Document },
12969
  { PrototypeTraits<prototypes::id::Document>::Depth },
12970
  JSJitInfo::Setter,
12971
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
12972
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
12973
  false,  /* isInfallible. False in setters. */
12974
  false,  /* isMovable.  Not relevant for setters. */
12975
  false, /* isEliminatable.  Not relevant for setters. */
12976
  false, /* isAlwaysInSlot.  Only relevant for getters. */
12977
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
12978
  false,  /* isTypedMethod.  Only relevant for methods. */
12979
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
12980
};
12981
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
12982
static_assert(0 < 1, "There is no slot for us");
12983
12984
MOZ_CAN_RUN_SCRIPT static bool
12985
get_ontransitionstart(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
12986
0
{
12987
0
  AUTO_PROFILER_LABEL_FAST("get Document.ontransitionstart", DOM, cx);
12988
0
12989
0
  RefPtr<EventHandlerNonNull> result(self->GetOntransitionstart());
12990
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
12991
0
  if (result) {
12992
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
12993
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
12994
0
      return false;
12995
0
    }
12996
0
    return true;
12997
0
  } else {
12998
0
    args.rval().setNull();
12999
0
    return true;
13000
0
  }
13001
0
}
13002
13003
MOZ_CAN_RUN_SCRIPT static bool
13004
set_ontransitionstart(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
13005
0
{
13006
0
  AUTO_PROFILER_LABEL_FAST("set Document.ontransitionstart", DOM, cx);
13007
0
13008
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
13009
0
  if (args[0].isObject()) {
13010
0
    { // scope for tempRoot and tempGlobalRoot if needed
13011
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
13012
0
    }
13013
0
  } else {
13014
0
    arg0 = nullptr;
13015
0
  }
13016
0
  self->SetOntransitionstart(Constify(arg0));
13017
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13018
0
13019
0
  return true;
13020
0
}
13021
13022
static const JSJitInfo ontransitionstart_getterinfo = {
13023
  { (JSJitGetterOp)get_ontransitionstart },
13024
  { prototypes::id::Document },
13025
  { PrototypeTraits<prototypes::id::Document>::Depth },
13026
  JSJitInfo::Getter,
13027
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13028
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
13029
  false,  /* isInfallible. False in setters. */
13030
  false,  /* isMovable.  Not relevant for setters. */
13031
  false, /* isEliminatable.  Not relevant for setters. */
13032
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13033
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13034
  false,  /* isTypedMethod.  Only relevant for methods. */
13035
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13036
};
13037
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13038
static_assert(0 < 1, "There is no slot for us");
13039
static const JSJitInfo ontransitionstart_setterinfo = {
13040
  { (JSJitGetterOp)set_ontransitionstart },
13041
  { prototypes::id::Document },
13042
  { PrototypeTraits<prototypes::id::Document>::Depth },
13043
  JSJitInfo::Setter,
13044
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13045
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
13046
  false,  /* isInfallible. False in setters. */
13047
  false,  /* isMovable.  Not relevant for setters. */
13048
  false, /* isEliminatable.  Not relevant for setters. */
13049
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13050
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13051
  false,  /* isTypedMethod.  Only relevant for methods. */
13052
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13053
};
13054
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13055
static_assert(0 < 1, "There is no slot for us");
13056
13057
MOZ_CAN_RUN_SCRIPT static bool
13058
get_onwebkitanimationend(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
13059
0
{
13060
0
  AUTO_PROFILER_LABEL_FAST("get Document.onwebkitanimationend", DOM, cx);
13061
0
13062
0
  RefPtr<EventHandlerNonNull> result(self->GetOnwebkitanimationend());
13063
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13064
0
  if (result) {
13065
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
13066
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
13067
0
      return false;
13068
0
    }
13069
0
    return true;
13070
0
  } else {
13071
0
    args.rval().setNull();
13072
0
    return true;
13073
0
  }
13074
0
}
13075
13076
MOZ_CAN_RUN_SCRIPT static bool
13077
set_onwebkitanimationend(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
13078
0
{
13079
0
  AUTO_PROFILER_LABEL_FAST("set Document.onwebkitanimationend", DOM, cx);
13080
0
13081
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
13082
0
  if (args[0].isObject()) {
13083
0
    { // scope for tempRoot and tempGlobalRoot if needed
13084
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
13085
0
    }
13086
0
  } else {
13087
0
    arg0 = nullptr;
13088
0
  }
13089
0
  self->SetOnwebkitanimationend(Constify(arg0));
13090
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13091
0
13092
0
  return true;
13093
0
}
13094
13095
static const JSJitInfo onwebkitanimationend_getterinfo = {
13096
  { (JSJitGetterOp)get_onwebkitanimationend },
13097
  { prototypes::id::Document },
13098
  { PrototypeTraits<prototypes::id::Document>::Depth },
13099
  JSJitInfo::Getter,
13100
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13101
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
13102
  false,  /* isInfallible. False in setters. */
13103
  false,  /* isMovable.  Not relevant for setters. */
13104
  false, /* isEliminatable.  Not relevant for setters. */
13105
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13106
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13107
  false,  /* isTypedMethod.  Only relevant for methods. */
13108
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13109
};
13110
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13111
static_assert(0 < 1, "There is no slot for us");
13112
static const JSJitInfo onwebkitanimationend_setterinfo = {
13113
  { (JSJitGetterOp)set_onwebkitanimationend },
13114
  { prototypes::id::Document },
13115
  { PrototypeTraits<prototypes::id::Document>::Depth },
13116
  JSJitInfo::Setter,
13117
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13118
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
13119
  false,  /* isInfallible. False in setters. */
13120
  false,  /* isMovable.  Not relevant for setters. */
13121
  false, /* isEliminatable.  Not relevant for setters. */
13122
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13123
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13124
  false,  /* isTypedMethod.  Only relevant for methods. */
13125
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13126
};
13127
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13128
static_assert(0 < 1, "There is no slot for us");
13129
13130
MOZ_CAN_RUN_SCRIPT static bool
13131
get_onwebkitanimationiteration(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
13132
0
{
13133
0
  AUTO_PROFILER_LABEL_FAST("get Document.onwebkitanimationiteration", DOM, cx);
13134
0
13135
0
  RefPtr<EventHandlerNonNull> result(self->GetOnwebkitanimationiteration());
13136
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13137
0
  if (result) {
13138
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
13139
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
13140
0
      return false;
13141
0
    }
13142
0
    return true;
13143
0
  } else {
13144
0
    args.rval().setNull();
13145
0
    return true;
13146
0
  }
13147
0
}
13148
13149
MOZ_CAN_RUN_SCRIPT static bool
13150
set_onwebkitanimationiteration(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
13151
0
{
13152
0
  AUTO_PROFILER_LABEL_FAST("set Document.onwebkitanimationiteration", DOM, cx);
13153
0
13154
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
13155
0
  if (args[0].isObject()) {
13156
0
    { // scope for tempRoot and tempGlobalRoot if needed
13157
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
13158
0
    }
13159
0
  } else {
13160
0
    arg0 = nullptr;
13161
0
  }
13162
0
  self->SetOnwebkitanimationiteration(Constify(arg0));
13163
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13164
0
13165
0
  return true;
13166
0
}
13167
13168
static const JSJitInfo onwebkitanimationiteration_getterinfo = {
13169
  { (JSJitGetterOp)get_onwebkitanimationiteration },
13170
  { prototypes::id::Document },
13171
  { PrototypeTraits<prototypes::id::Document>::Depth },
13172
  JSJitInfo::Getter,
13173
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13174
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
13175
  false,  /* isInfallible. False in setters. */
13176
  false,  /* isMovable.  Not relevant for setters. */
13177
  false, /* isEliminatable.  Not relevant for setters. */
13178
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13179
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13180
  false,  /* isTypedMethod.  Only relevant for methods. */
13181
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13182
};
13183
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13184
static_assert(0 < 1, "There is no slot for us");
13185
static const JSJitInfo onwebkitanimationiteration_setterinfo = {
13186
  { (JSJitGetterOp)set_onwebkitanimationiteration },
13187
  { prototypes::id::Document },
13188
  { PrototypeTraits<prototypes::id::Document>::Depth },
13189
  JSJitInfo::Setter,
13190
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13191
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
13192
  false,  /* isInfallible. False in setters. */
13193
  false,  /* isMovable.  Not relevant for setters. */
13194
  false, /* isEliminatable.  Not relevant for setters. */
13195
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13196
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13197
  false,  /* isTypedMethod.  Only relevant for methods. */
13198
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13199
};
13200
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13201
static_assert(0 < 1, "There is no slot for us");
13202
13203
MOZ_CAN_RUN_SCRIPT static bool
13204
get_onwebkitanimationstart(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
13205
0
{
13206
0
  AUTO_PROFILER_LABEL_FAST("get Document.onwebkitanimationstart", DOM, cx);
13207
0
13208
0
  RefPtr<EventHandlerNonNull> result(self->GetOnwebkitanimationstart());
13209
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13210
0
  if (result) {
13211
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
13212
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
13213
0
      return false;
13214
0
    }
13215
0
    return true;
13216
0
  } else {
13217
0
    args.rval().setNull();
13218
0
    return true;
13219
0
  }
13220
0
}
13221
13222
MOZ_CAN_RUN_SCRIPT static bool
13223
set_onwebkitanimationstart(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
13224
0
{
13225
0
  AUTO_PROFILER_LABEL_FAST("set Document.onwebkitanimationstart", DOM, cx);
13226
0
13227
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
13228
0
  if (args[0].isObject()) {
13229
0
    { // scope for tempRoot and tempGlobalRoot if needed
13230
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
13231
0
    }
13232
0
  } else {
13233
0
    arg0 = nullptr;
13234
0
  }
13235
0
  self->SetOnwebkitanimationstart(Constify(arg0));
13236
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13237
0
13238
0
  return true;
13239
0
}
13240
13241
static const JSJitInfo onwebkitanimationstart_getterinfo = {
13242
  { (JSJitGetterOp)get_onwebkitanimationstart },
13243
  { prototypes::id::Document },
13244
  { PrototypeTraits<prototypes::id::Document>::Depth },
13245
  JSJitInfo::Getter,
13246
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13247
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
13248
  false,  /* isInfallible. False in setters. */
13249
  false,  /* isMovable.  Not relevant for setters. */
13250
  false, /* isEliminatable.  Not relevant for setters. */
13251
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13252
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13253
  false,  /* isTypedMethod.  Only relevant for methods. */
13254
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13255
};
13256
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13257
static_assert(0 < 1, "There is no slot for us");
13258
static const JSJitInfo onwebkitanimationstart_setterinfo = {
13259
  { (JSJitGetterOp)set_onwebkitanimationstart },
13260
  { prototypes::id::Document },
13261
  { PrototypeTraits<prototypes::id::Document>::Depth },
13262
  JSJitInfo::Setter,
13263
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13264
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
13265
  false,  /* isInfallible. False in setters. */
13266
  false,  /* isMovable.  Not relevant for setters. */
13267
  false, /* isEliminatable.  Not relevant for setters. */
13268
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13269
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13270
  false,  /* isTypedMethod.  Only relevant for methods. */
13271
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13272
};
13273
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13274
static_assert(0 < 1, "There is no slot for us");
13275
13276
MOZ_CAN_RUN_SCRIPT static bool
13277
get_onwebkittransitionend(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
13278
0
{
13279
0
  AUTO_PROFILER_LABEL_FAST("get Document.onwebkittransitionend", DOM, cx);
13280
0
13281
0
  RefPtr<EventHandlerNonNull> result(self->GetOnwebkittransitionend());
13282
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13283
0
  if (result) {
13284
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
13285
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
13286
0
      return false;
13287
0
    }
13288
0
    return true;
13289
0
  } else {
13290
0
    args.rval().setNull();
13291
0
    return true;
13292
0
  }
13293
0
}
13294
13295
MOZ_CAN_RUN_SCRIPT static bool
13296
set_onwebkittransitionend(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
13297
0
{
13298
0
  AUTO_PROFILER_LABEL_FAST("set Document.onwebkittransitionend", DOM, cx);
13299
0
13300
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
13301
0
  if (args[0].isObject()) {
13302
0
    { // scope for tempRoot and tempGlobalRoot if needed
13303
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
13304
0
    }
13305
0
  } else {
13306
0
    arg0 = nullptr;
13307
0
  }
13308
0
  self->SetOnwebkittransitionend(Constify(arg0));
13309
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13310
0
13311
0
  return true;
13312
0
}
13313
13314
static const JSJitInfo onwebkittransitionend_getterinfo = {
13315
  { (JSJitGetterOp)get_onwebkittransitionend },
13316
  { prototypes::id::Document },
13317
  { PrototypeTraits<prototypes::id::Document>::Depth },
13318
  JSJitInfo::Getter,
13319
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13320
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
13321
  false,  /* isInfallible. False in setters. */
13322
  false,  /* isMovable.  Not relevant for setters. */
13323
  false, /* isEliminatable.  Not relevant for setters. */
13324
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13325
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13326
  false,  /* isTypedMethod.  Only relevant for methods. */
13327
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13328
};
13329
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13330
static_assert(0 < 1, "There is no slot for us");
13331
static const JSJitInfo onwebkittransitionend_setterinfo = {
13332
  { (JSJitGetterOp)set_onwebkittransitionend },
13333
  { prototypes::id::Document },
13334
  { PrototypeTraits<prototypes::id::Document>::Depth },
13335
  JSJitInfo::Setter,
13336
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13337
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
13338
  false,  /* isInfallible. False in setters. */
13339
  false,  /* isMovable.  Not relevant for setters. */
13340
  false, /* isEliminatable.  Not relevant for setters. */
13341
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13342
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13343
  false,  /* isTypedMethod.  Only relevant for methods. */
13344
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13345
};
13346
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13347
static_assert(0 < 1, "There is no slot for us");
13348
13349
MOZ_CAN_RUN_SCRIPT static bool
13350
get_onerror(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
13351
0
{
13352
0
  AUTO_PROFILER_LABEL_FAST("get Document.onerror", DOM, cx);
13353
0
13354
0
  RefPtr<EventHandlerNonNull> result(self->GetOnerror());
13355
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13356
0
  if (result) {
13357
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
13358
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
13359
0
      return false;
13360
0
    }
13361
0
    return true;
13362
0
  } else {
13363
0
    args.rval().setNull();
13364
0
    return true;
13365
0
  }
13366
0
}
13367
13368
MOZ_CAN_RUN_SCRIPT static bool
13369
set_onerror(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
13370
0
{
13371
0
  AUTO_PROFILER_LABEL_FAST("set Document.onerror", DOM, cx);
13372
0
13373
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
13374
0
  if (args[0].isObject()) {
13375
0
    { // scope for tempRoot and tempGlobalRoot if needed
13376
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
13377
0
    }
13378
0
  } else {
13379
0
    arg0 = nullptr;
13380
0
  }
13381
0
  self->SetOnerror(Constify(arg0));
13382
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13383
0
13384
0
  return true;
13385
0
}
13386
13387
static const JSJitInfo onerror_getterinfo = {
13388
  { (JSJitGetterOp)get_onerror },
13389
  { prototypes::id::Document },
13390
  { PrototypeTraits<prototypes::id::Document>::Depth },
13391
  JSJitInfo::Getter,
13392
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13393
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
13394
  false,  /* isInfallible. False in setters. */
13395
  false,  /* isMovable.  Not relevant for setters. */
13396
  false, /* isEliminatable.  Not relevant for setters. */
13397
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13398
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13399
  false,  /* isTypedMethod.  Only relevant for methods. */
13400
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13401
};
13402
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13403
static_assert(0 < 1, "There is no slot for us");
13404
static const JSJitInfo onerror_setterinfo = {
13405
  { (JSJitGetterOp)set_onerror },
13406
  { prototypes::id::Document },
13407
  { PrototypeTraits<prototypes::id::Document>::Depth },
13408
  JSJitInfo::Setter,
13409
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13410
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
13411
  false,  /* isInfallible. False in setters. */
13412
  false,  /* isMovable.  Not relevant for setters. */
13413
  false, /* isEliminatable.  Not relevant for setters. */
13414
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13415
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13416
  false,  /* isTypedMethod.  Only relevant for methods. */
13417
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13418
};
13419
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13420
static_assert(0 < 1, "There is no slot for us");
13421
13422
MOZ_CAN_RUN_SCRIPT static bool
13423
get_children(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
13424
0
{
13425
0
  AUTO_PROFILER_LABEL_FAST("get Document.children", DOM, cx);
13426
0
13427
0
  auto result(StrongOrRawPtr<nsIHTMLCollection>(self->Children()));
13428
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13429
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
13430
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
13431
0
    return false;
13432
0
  }
13433
0
  return true;
13434
0
}
13435
13436
static const JSJitInfo children_getterinfo = {
13437
  { (JSJitGetterOp)get_children },
13438
  { prototypes::id::Document },
13439
  { PrototypeTraits<prototypes::id::Document>::Depth },
13440
  JSJitInfo::Getter,
13441
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
13442
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
13443
  false,  /* isInfallible. False in setters. */
13444
  true,  /* isMovable.  Not relevant for setters. */
13445
  true, /* isEliminatable.  Not relevant for setters. */
13446
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13447
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13448
  false,  /* isTypedMethod.  Only relevant for methods. */
13449
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13450
};
13451
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13452
static_assert(0 < 1, "There is no slot for us");
13453
13454
MOZ_CAN_RUN_SCRIPT static bool
13455
get_firstElementChild(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
13456
0
{
13457
0
  AUTO_PROFILER_LABEL_FAST("get Document.firstElementChild", DOM, cx);
13458
0
13459
0
  auto result(StrongOrRawPtr<mozilla::dom::Element>(self->GetFirstElementChild()));
13460
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13461
0
  if (!result) {
13462
0
    args.rval().setNull();
13463
0
    return true;
13464
0
  }
13465
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
13466
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
13467
0
    return false;
13468
0
  }
13469
0
  return true;
13470
0
}
13471
13472
static const JSJitInfo firstElementChild_getterinfo = {
13473
  { (JSJitGetterOp)get_firstElementChild },
13474
  { prototypes::id::Document },
13475
  { PrototypeTraits<prototypes::id::Document>::Depth },
13476
  JSJitInfo::Getter,
13477
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
13478
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
13479
  false,  /* isInfallible. False in setters. */
13480
  true,  /* isMovable.  Not relevant for setters. */
13481
  true, /* isEliminatable.  Not relevant for setters. */
13482
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13483
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13484
  false,  /* isTypedMethod.  Only relevant for methods. */
13485
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13486
};
13487
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13488
static_assert(0 < 1, "There is no slot for us");
13489
13490
MOZ_CAN_RUN_SCRIPT static bool
13491
get_lastElementChild(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
13492
0
{
13493
0
  AUTO_PROFILER_LABEL_FAST("get Document.lastElementChild", DOM, cx);
13494
0
13495
0
  auto result(StrongOrRawPtr<mozilla::dom::Element>(self->GetLastElementChild()));
13496
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13497
0
  if (!result) {
13498
0
    args.rval().setNull();
13499
0
    return true;
13500
0
  }
13501
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
13502
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
13503
0
    return false;
13504
0
  }
13505
0
  return true;
13506
0
}
13507
13508
static const JSJitInfo lastElementChild_getterinfo = {
13509
  { (JSJitGetterOp)get_lastElementChild },
13510
  { prototypes::id::Document },
13511
  { PrototypeTraits<prototypes::id::Document>::Depth },
13512
  JSJitInfo::Getter,
13513
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
13514
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
13515
  false,  /* isInfallible. False in setters. */
13516
  true,  /* isMovable.  Not relevant for setters. */
13517
  true, /* isEliminatable.  Not relevant for setters. */
13518
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13519
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13520
  false,  /* isTypedMethod.  Only relevant for methods. */
13521
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13522
};
13523
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13524
static_assert(0 < 1, "There is no slot for us");
13525
13526
MOZ_CAN_RUN_SCRIPT static bool
13527
get_childElementCount(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
13528
0
{
13529
0
  AUTO_PROFILER_LABEL_FAST("get Document.childElementCount", DOM, cx);
13530
0
13531
0
  uint32_t result(self->ChildElementCount());
13532
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13533
0
  args.rval().setNumber(result);
13534
0
  return true;
13535
0
}
13536
13537
static const JSJitInfo childElementCount_getterinfo = {
13538
  { (JSJitGetterOp)get_childElementCount },
13539
  { prototypes::id::Document },
13540
  { PrototypeTraits<prototypes::id::Document>::Depth },
13541
  JSJitInfo::Getter,
13542
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
13543
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
13544
  true,  /* isInfallible. False in setters. */
13545
  true,  /* isMovable.  Not relevant for setters. */
13546
  true, /* isEliminatable.  Not relevant for setters. */
13547
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13548
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13549
  false,  /* isTypedMethod.  Only relevant for methods. */
13550
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13551
};
13552
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13553
static_assert(0 < 1, "There is no slot for us");
13554
13555
MOZ_CAN_RUN_SCRIPT static bool
13556
getElementsByAttribute(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
13557
0
{
13558
0
  AUTO_PROFILER_LABEL_FAST("Document.getElementsByAttribute", DOM, cx);
13559
0
13560
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
13561
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.getElementsByAttribute");
13562
0
  }
13563
0
  binding_detail::FakeString arg0;
13564
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
13565
0
    return false;
13566
0
  }
13567
0
  binding_detail::FakeString arg1;
13568
0
  if (!ConvertJSValueToString(cx, args[1], eEmpty, eStringify, arg1)) {
13569
0
    return false;
13570
0
  }
13571
0
  auto result(StrongOrRawPtr<nsIHTMLCollection>(self->GetElementsByAttribute(NonNullHelper(Constify(arg0)), NonNullHelper(Constify(arg1)))));
13572
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13573
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
13574
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
13575
0
    return false;
13576
0
  }
13577
0
  return true;
13578
0
}
13579
13580
static const JSJitInfo getElementsByAttribute_methodinfo = {
13581
  { (JSJitGetterOp)getElementsByAttribute },
13582
  { prototypes::id::Document },
13583
  { PrototypeTraits<prototypes::id::Document>::Depth },
13584
  JSJitInfo::Method,
13585
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13586
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
13587
  false,  /* isInfallible. False in setters. */
13588
  false,  /* isMovable.  Not relevant for setters. */
13589
  false, /* isEliminatable.  Not relevant for setters. */
13590
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13591
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13592
  false,  /* isTypedMethod.  Only relevant for methods. */
13593
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13594
};
13595
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13596
static_assert(0 < 1, "There is no slot for us");
13597
13598
MOZ_CAN_RUN_SCRIPT static bool
13599
getElementsByAttributeNS(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
13600
0
{
13601
0
  AUTO_PROFILER_LABEL_FAST("Document.getElementsByAttributeNS", DOM, cx);
13602
0
13603
0
  if (MOZ_UNLIKELY(args.length() < 3)) {
13604
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.getElementsByAttributeNS");
13605
0
  }
13606
0
  binding_detail::FakeString arg0;
13607
0
  if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
13608
0
    return false;
13609
0
  }
13610
0
  binding_detail::FakeString arg1;
13611
0
  if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) {
13612
0
    return false;
13613
0
  }
13614
0
  binding_detail::FakeString arg2;
13615
0
  if (!ConvertJSValueToString(cx, args[2], eEmpty, eStringify, arg2)) {
13616
0
    return false;
13617
0
  }
13618
0
  FastErrorResult rv;
13619
0
  auto result(StrongOrRawPtr<nsIHTMLCollection>(self->GetElementsByAttributeNS(NonNullHelper(Constify(arg0)), NonNullHelper(Constify(arg1)), NonNullHelper(Constify(arg2)), rv)));
13620
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
13621
0
    return false;
13622
0
  }
13623
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13624
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
13625
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
13626
0
    return false;
13627
0
  }
13628
0
  return true;
13629
0
}
13630
13631
static const JSJitInfo getElementsByAttributeNS_methodinfo = {
13632
  { (JSJitGetterOp)getElementsByAttributeNS },
13633
  { prototypes::id::Document },
13634
  { PrototypeTraits<prototypes::id::Document>::Depth },
13635
  JSJitInfo::Method,
13636
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13637
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
13638
  false,  /* isInfallible. False in setters. */
13639
  false,  /* isMovable.  Not relevant for setters. */
13640
  false, /* isEliminatable.  Not relevant for setters. */
13641
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13642
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13643
  false,  /* isTypedMethod.  Only relevant for methods. */
13644
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13645
};
13646
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13647
static_assert(0 < 1, "There is no slot for us");
13648
13649
MOZ_CAN_RUN_SCRIPT static bool
13650
prepend(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
13651
0
{
13652
0
  AUTO_PROFILER_LABEL_FAST("Document.prepend", DOM, cx);
13653
0
13654
0
  AutoSequence<OwningNodeOrString> arg0;
13655
0
  if (args.length() > 0) {
13656
0
    if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
13657
0
      JS_ReportOutOfMemory(cx);
13658
0
      return false;
13659
0
    }
13660
0
    for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
13661
0
      OwningNodeOrString& slot = *arg0.AppendElement(mozilla::fallible);
13662
0
      {
13663
0
        bool done = false, failed = false, tryNext;
13664
0
        if (args[variadicArg].isObject()) {
13665
0
          done = (failed = !slot.TrySetToNode(cx, args[variadicArg], tryNext, false)) || !tryNext;
13666
0
13667
0
        }
13668
0
        if (!done) {
13669
0
          do {
13670
0
            done = (failed = !slot.TrySetToString(cx, args[variadicArg], tryNext)) || !tryNext;
13671
0
            break;
13672
0
          } while (false);
13673
0
        }
13674
0
        if (failed) {
13675
0
          return false;
13676
0
        }
13677
0
        if (!done) {
13678
0
          ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 1 of Document.prepend", "Node");
13679
0
          return false;
13680
0
        }
13681
0
      }
13682
0
    }
13683
0
  }
13684
0
  Maybe<AutoCEReaction> ceReaction;
13685
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
13686
0
    DocGroup* docGroup = self->GetDocGroup();
13687
0
    if (docGroup) {
13688
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
13689
0
    }
13690
0
  }
13691
0
  FastErrorResult rv;
13692
0
  self->Prepend(Constify(arg0), rv);
13693
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
13694
0
    return false;
13695
0
  }
13696
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13697
0
  args.rval().setUndefined();
13698
0
  return true;
13699
0
}
13700
13701
static const JSJitInfo prepend_methodinfo = {
13702
  { (JSJitGetterOp)prepend },
13703
  { prototypes::id::Document },
13704
  { PrototypeTraits<prototypes::id::Document>::Depth },
13705
  JSJitInfo::Method,
13706
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13707
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
13708
  false,  /* isInfallible. False in setters. */
13709
  false,  /* isMovable.  Not relevant for setters. */
13710
  false, /* isEliminatable.  Not relevant for setters. */
13711
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13712
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13713
  false,  /* isTypedMethod.  Only relevant for methods. */
13714
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13715
};
13716
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13717
static_assert(0 < 1, "There is no slot for us");
13718
13719
MOZ_CAN_RUN_SCRIPT static bool
13720
append(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
13721
0
{
13722
0
  AUTO_PROFILER_LABEL_FAST("Document.append", DOM, cx);
13723
0
13724
0
  AutoSequence<OwningNodeOrString> arg0;
13725
0
  if (args.length() > 0) {
13726
0
    if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
13727
0
      JS_ReportOutOfMemory(cx);
13728
0
      return false;
13729
0
    }
13730
0
    for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
13731
0
      OwningNodeOrString& slot = *arg0.AppendElement(mozilla::fallible);
13732
0
      {
13733
0
        bool done = false, failed = false, tryNext;
13734
0
        if (args[variadicArg].isObject()) {
13735
0
          done = (failed = !slot.TrySetToNode(cx, args[variadicArg], tryNext, false)) || !tryNext;
13736
0
13737
0
        }
13738
0
        if (!done) {
13739
0
          do {
13740
0
            done = (failed = !slot.TrySetToString(cx, args[variadicArg], tryNext)) || !tryNext;
13741
0
            break;
13742
0
          } while (false);
13743
0
        }
13744
0
        if (failed) {
13745
0
          return false;
13746
0
        }
13747
0
        if (!done) {
13748
0
          ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 1 of Document.append", "Node");
13749
0
          return false;
13750
0
        }
13751
0
      }
13752
0
    }
13753
0
  }
13754
0
  Maybe<AutoCEReaction> ceReaction;
13755
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
13756
0
    DocGroup* docGroup = self->GetDocGroup();
13757
0
    if (docGroup) {
13758
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
13759
0
    }
13760
0
  }
13761
0
  FastErrorResult rv;
13762
0
  self->Append(Constify(arg0), rv);
13763
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
13764
0
    return false;
13765
0
  }
13766
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13767
0
  args.rval().setUndefined();
13768
0
  return true;
13769
0
}
13770
13771
static const JSJitInfo append_methodinfo = {
13772
  { (JSJitGetterOp)append },
13773
  { prototypes::id::Document },
13774
  { PrototypeTraits<prototypes::id::Document>::Depth },
13775
  JSJitInfo::Method,
13776
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13777
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
13778
  false,  /* isInfallible. False in setters. */
13779
  false,  /* isMovable.  Not relevant for setters. */
13780
  false, /* isEliminatable.  Not relevant for setters. */
13781
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13782
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13783
  false,  /* isTypedMethod.  Only relevant for methods. */
13784
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13785
};
13786
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13787
static_assert(0 < 1, "There is no slot for us");
13788
13789
MOZ_CAN_RUN_SCRIPT static bool
13790
get_ontouchstart(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
13791
0
{
13792
0
  AUTO_PROFILER_LABEL_FAST("get Document.ontouchstart", DOM, cx);
13793
0
13794
0
  RefPtr<EventHandlerNonNull> result(self->GetOntouchstart());
13795
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13796
0
  if (result) {
13797
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
13798
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
13799
0
      return false;
13800
0
    }
13801
0
    return true;
13802
0
  } else {
13803
0
    args.rval().setNull();
13804
0
    return true;
13805
0
  }
13806
0
}
13807
13808
MOZ_CAN_RUN_SCRIPT static bool
13809
set_ontouchstart(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
13810
0
{
13811
0
  AUTO_PROFILER_LABEL_FAST("set Document.ontouchstart", DOM, cx);
13812
0
13813
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
13814
0
  if (args[0].isObject()) {
13815
0
    { // scope for tempRoot and tempGlobalRoot if needed
13816
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
13817
0
    }
13818
0
  } else {
13819
0
    arg0 = nullptr;
13820
0
  }
13821
0
  self->SetOntouchstart(Constify(arg0));
13822
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13823
0
13824
0
  return true;
13825
0
}
13826
13827
static const JSJitInfo ontouchstart_getterinfo = {
13828
  { (JSJitGetterOp)get_ontouchstart },
13829
  { prototypes::id::Document },
13830
  { PrototypeTraits<prototypes::id::Document>::Depth },
13831
  JSJitInfo::Getter,
13832
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13833
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
13834
  false,  /* isInfallible. False in setters. */
13835
  false,  /* isMovable.  Not relevant for setters. */
13836
  false, /* isEliminatable.  Not relevant for setters. */
13837
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13838
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13839
  false,  /* isTypedMethod.  Only relevant for methods. */
13840
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13841
};
13842
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13843
static_assert(0 < 1, "There is no slot for us");
13844
static const JSJitInfo ontouchstart_setterinfo = {
13845
  { (JSJitGetterOp)set_ontouchstart },
13846
  { prototypes::id::Document },
13847
  { PrototypeTraits<prototypes::id::Document>::Depth },
13848
  JSJitInfo::Setter,
13849
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13850
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
13851
  false,  /* isInfallible. False in setters. */
13852
  false,  /* isMovable.  Not relevant for setters. */
13853
  false, /* isEliminatable.  Not relevant for setters. */
13854
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13855
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13856
  false,  /* isTypedMethod.  Only relevant for methods. */
13857
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13858
};
13859
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13860
static_assert(0 < 1, "There is no slot for us");
13861
13862
MOZ_CAN_RUN_SCRIPT static bool
13863
get_ontouchend(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
13864
0
{
13865
0
  AUTO_PROFILER_LABEL_FAST("get Document.ontouchend", DOM, cx);
13866
0
13867
0
  RefPtr<EventHandlerNonNull> result(self->GetOntouchend());
13868
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13869
0
  if (result) {
13870
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
13871
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
13872
0
      return false;
13873
0
    }
13874
0
    return true;
13875
0
  } else {
13876
0
    args.rval().setNull();
13877
0
    return true;
13878
0
  }
13879
0
}
13880
13881
MOZ_CAN_RUN_SCRIPT static bool
13882
set_ontouchend(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
13883
0
{
13884
0
  AUTO_PROFILER_LABEL_FAST("set Document.ontouchend", DOM, cx);
13885
0
13886
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
13887
0
  if (args[0].isObject()) {
13888
0
    { // scope for tempRoot and tempGlobalRoot if needed
13889
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
13890
0
    }
13891
0
  } else {
13892
0
    arg0 = nullptr;
13893
0
  }
13894
0
  self->SetOntouchend(Constify(arg0));
13895
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13896
0
13897
0
  return true;
13898
0
}
13899
13900
static const JSJitInfo ontouchend_getterinfo = {
13901
  { (JSJitGetterOp)get_ontouchend },
13902
  { prototypes::id::Document },
13903
  { PrototypeTraits<prototypes::id::Document>::Depth },
13904
  JSJitInfo::Getter,
13905
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13906
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
13907
  false,  /* isInfallible. False in setters. */
13908
  false,  /* isMovable.  Not relevant for setters. */
13909
  false, /* isEliminatable.  Not relevant for setters. */
13910
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13911
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13912
  false,  /* isTypedMethod.  Only relevant for methods. */
13913
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13914
};
13915
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13916
static_assert(0 < 1, "There is no slot for us");
13917
static const JSJitInfo ontouchend_setterinfo = {
13918
  { (JSJitGetterOp)set_ontouchend },
13919
  { prototypes::id::Document },
13920
  { PrototypeTraits<prototypes::id::Document>::Depth },
13921
  JSJitInfo::Setter,
13922
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13923
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
13924
  false,  /* isInfallible. False in setters. */
13925
  false,  /* isMovable.  Not relevant for setters. */
13926
  false, /* isEliminatable.  Not relevant for setters. */
13927
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13928
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13929
  false,  /* isTypedMethod.  Only relevant for methods. */
13930
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13931
};
13932
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13933
static_assert(0 < 1, "There is no slot for us");
13934
13935
MOZ_CAN_RUN_SCRIPT static bool
13936
get_ontouchmove(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
13937
0
{
13938
0
  AUTO_PROFILER_LABEL_FAST("get Document.ontouchmove", DOM, cx);
13939
0
13940
0
  RefPtr<EventHandlerNonNull> result(self->GetOntouchmove());
13941
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13942
0
  if (result) {
13943
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
13944
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
13945
0
      return false;
13946
0
    }
13947
0
    return true;
13948
0
  } else {
13949
0
    args.rval().setNull();
13950
0
    return true;
13951
0
  }
13952
0
}
13953
13954
MOZ_CAN_RUN_SCRIPT static bool
13955
set_ontouchmove(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
13956
0
{
13957
0
  AUTO_PROFILER_LABEL_FAST("set Document.ontouchmove", DOM, cx);
13958
0
13959
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
13960
0
  if (args[0].isObject()) {
13961
0
    { // scope for tempRoot and tempGlobalRoot if needed
13962
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
13963
0
    }
13964
0
  } else {
13965
0
    arg0 = nullptr;
13966
0
  }
13967
0
  self->SetOntouchmove(Constify(arg0));
13968
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
13969
0
13970
0
  return true;
13971
0
}
13972
13973
static const JSJitInfo ontouchmove_getterinfo = {
13974
  { (JSJitGetterOp)get_ontouchmove },
13975
  { prototypes::id::Document },
13976
  { PrototypeTraits<prototypes::id::Document>::Depth },
13977
  JSJitInfo::Getter,
13978
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13979
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
13980
  false,  /* isInfallible. False in setters. */
13981
  false,  /* isMovable.  Not relevant for setters. */
13982
  false, /* isEliminatable.  Not relevant for setters. */
13983
  false, /* isAlwaysInSlot.  Only relevant for getters. */
13984
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
13985
  false,  /* isTypedMethod.  Only relevant for methods. */
13986
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
13987
};
13988
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
13989
static_assert(0 < 1, "There is no slot for us");
13990
static const JSJitInfo ontouchmove_setterinfo = {
13991
  { (JSJitGetterOp)set_ontouchmove },
13992
  { prototypes::id::Document },
13993
  { PrototypeTraits<prototypes::id::Document>::Depth },
13994
  JSJitInfo::Setter,
13995
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
13996
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
13997
  false,  /* isInfallible. False in setters. */
13998
  false,  /* isMovable.  Not relevant for setters. */
13999
  false, /* isEliminatable.  Not relevant for setters. */
14000
  false, /* isAlwaysInSlot.  Only relevant for getters. */
14001
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
14002
  false,  /* isTypedMethod.  Only relevant for methods. */
14003
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
14004
};
14005
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
14006
static_assert(0 < 1, "There is no slot for us");
14007
14008
MOZ_CAN_RUN_SCRIPT static bool
14009
get_ontouchcancel(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitGetterCallArgs args)
14010
0
{
14011
0
  AUTO_PROFILER_LABEL_FAST("get Document.ontouchcancel", DOM, cx);
14012
0
14013
0
  RefPtr<EventHandlerNonNull> result(self->GetOntouchcancel());
14014
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
14015
0
  if (result) {
14016
0
    args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
14017
0
    if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
14018
0
      return false;
14019
0
    }
14020
0
    return true;
14021
0
  } else {
14022
0
    args.rval().setNull();
14023
0
    return true;
14024
0
  }
14025
0
}
14026
14027
MOZ_CAN_RUN_SCRIPT static bool
14028
set_ontouchcancel(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, JSJitSetterCallArgs args)
14029
0
{
14030
0
  AUTO_PROFILER_LABEL_FAST("set Document.ontouchcancel", DOM, cx);
14031
0
14032
0
  RootedCallback<RefPtr<binding_detail::FastEventHandlerNonNull>> arg0(cx);
14033
0
  if (args[0].isObject()) {
14034
0
    { // scope for tempRoot and tempGlobalRoot if needed
14035
0
      arg0 = new binding_detail::FastEventHandlerNonNull(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
14036
0
    }
14037
0
  } else {
14038
0
    arg0 = nullptr;
14039
0
  }
14040
0
  self->SetOntouchcancel(Constify(arg0));
14041
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
14042
0
14043
0
  return true;
14044
0
}
14045
14046
static const JSJitInfo ontouchcancel_getterinfo = {
14047
  { (JSJitGetterOp)get_ontouchcancel },
14048
  { prototypes::id::Document },
14049
  { PrototypeTraits<prototypes::id::Document>::Depth },
14050
  JSJitInfo::Getter,
14051
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
14052
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
14053
  false,  /* isInfallible. False in setters. */
14054
  false,  /* isMovable.  Not relevant for setters. */
14055
  false, /* isEliminatable.  Not relevant for setters. */
14056
  false, /* isAlwaysInSlot.  Only relevant for getters. */
14057
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
14058
  false,  /* isTypedMethod.  Only relevant for methods. */
14059
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
14060
};
14061
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
14062
static_assert(0 < 1, "There is no slot for us");
14063
static const JSJitInfo ontouchcancel_setterinfo = {
14064
  { (JSJitGetterOp)set_ontouchcancel },
14065
  { prototypes::id::Document },
14066
  { PrototypeTraits<prototypes::id::Document>::Depth },
14067
  JSJitInfo::Setter,
14068
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
14069
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
14070
  false,  /* isInfallible. False in setters. */
14071
  false,  /* isMovable.  Not relevant for setters. */
14072
  false, /* isEliminatable.  Not relevant for setters. */
14073
  false, /* isAlwaysInSlot.  Only relevant for getters. */
14074
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
14075
  false,  /* isTypedMethod.  Only relevant for methods. */
14076
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
14077
};
14078
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
14079
static_assert(0 < 1, "There is no slot for us");
14080
14081
MOZ_CAN_RUN_SCRIPT static bool
14082
createExpression(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
14083
0
{
14084
0
  AUTO_PROFILER_LABEL_FAST("Document.createExpression", DOM, cx);
14085
0
14086
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
14087
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.createExpression");
14088
0
  }
14089
0
  binding_detail::FakeString arg0;
14090
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
14091
0
    return false;
14092
0
  }
14093
0
  RootedCallback<RefPtr<binding_detail::FastXPathNSResolver>> arg1(cx);
14094
0
  if (args.hasDefined(1)) {
14095
0
    if (args[1].isObject()) {
14096
0
      { // scope for tempRoot and tempGlobalRoot if needed
14097
0
        arg1 = new binding_detail::FastXPathNSResolver(&args[1].toObject(), JS::CurrentGlobalOrNull(cx));
14098
0
      }
14099
0
    } else if (args[1].isNullOrUndefined()) {
14100
0
      arg1 = nullptr;
14101
0
    } else {
14102
0
      ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of Document.createExpression");
14103
0
      return false;
14104
0
    }
14105
0
  } else {
14106
0
    arg1 = nullptr;
14107
0
  }
14108
0
  FastErrorResult rv;
14109
0
  auto result(StrongOrRawPtr<mozilla::dom::XPathExpression>(self->CreateExpression(NonNullHelper(Constify(arg0)), MOZ_KnownLive(Constify(arg1)), rv)));
14110
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
14111
0
    return false;
14112
0
  }
14113
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
14114
0
  static_assert(!IsPointer<decltype(result)>::value,
14115
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
14116
0
  if (!WrapNewBindingNonWrapperCachedObject(cx, obj, result, args.rval())) {
14117
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
14118
0
    return false;
14119
0
  }
14120
0
  return true;
14121
0
}
14122
14123
static const JSJitInfo createExpression_methodinfo = {
14124
  { (JSJitGetterOp)createExpression },
14125
  { prototypes::id::Document },
14126
  { PrototypeTraits<prototypes::id::Document>::Depth },
14127
  JSJitInfo::Method,
14128
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
14129
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
14130
  false,  /* isInfallible. False in setters. */
14131
  false,  /* isMovable.  Not relevant for setters. */
14132
  false, /* isEliminatable.  Not relevant for setters. */
14133
  false, /* isAlwaysInSlot.  Only relevant for getters. */
14134
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
14135
  false,  /* isTypedMethod.  Only relevant for methods. */
14136
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
14137
};
14138
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
14139
static_assert(0 < 1, "There is no slot for us");
14140
14141
MOZ_CAN_RUN_SCRIPT static bool
14142
createNSResolver(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
14143
0
{
14144
0
  AUTO_PROFILER_LABEL_FAST("Document.createNSResolver", DOM, cx);
14145
0
14146
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
14147
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.createNSResolver");
14148
0
  }
14149
0
  NonNull<nsINode> arg0;
14150
0
  if (args[0].isObject()) {
14151
0
    {
14152
0
      nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(args[0], arg0);
14153
0
      if (NS_FAILED(rv)) {
14154
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of Document.createNSResolver", "Node");
14155
0
        return false;
14156
0
      }
14157
0
    }
14158
0
  } else {
14159
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of Document.createNSResolver");
14160
0
    return false;
14161
0
  }
14162
0
  auto result(StrongOrRawPtr<nsINode>(self->CreateNSResolver(MOZ_KnownLive(NonNullHelper(arg0)))));
14163
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
14164
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
14165
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
14166
0
    return false;
14167
0
  }
14168
0
  return true;
14169
0
}
14170
14171
static const JSJitInfo::ArgType createNSResolver_methodinfo_argTypes[] = { JSJitInfo::Object, JSJitInfo::ArgTypeListEnd };
14172
static const JSTypedMethodJitInfo createNSResolver_methodinfo = {
14173
  {
14174
    { (JSJitGetterOp)createNSResolver },
14175
    { prototypes::id::Document },
14176
    { PrototypeTraits<prototypes::id::Document>::Depth },
14177
    JSJitInfo::Method,
14178
    JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
14179
    JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
14180
    false,  /* isInfallible. False in setters. */
14181
    true,  /* isMovable.  Not relevant for setters. */
14182
    true, /* isEliminatable.  Not relevant for setters. */
14183
    false, /* isAlwaysInSlot.  Only relevant for getters. */
14184
    false, /* isLazilyCachedInSlot.  Only relevant for getters. */
14185
    true,  /* isTypedMethod.  Only relevant for methods. */
14186
    0   /* Reserved slot index, if we're stored in a slot, else 0. */
14187
  },
14188
  createNSResolver_methodinfo_argTypes
14189
};
14190
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
14191
static_assert(0 < 1, "There is no slot for us");
14192
14193
MOZ_CAN_RUN_SCRIPT static bool
14194
evaluate(JSContext* cx, JS::Handle<JSObject*> obj, nsIDocument* self, const JSJitMethodCallArgs& args)
14195
0
{
14196
0
  AUTO_PROFILER_LABEL_FAST("Document.evaluate", DOM, cx);
14197
0
14198
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
14199
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "Document.evaluate");
14200
0
  }
14201
0
  binding_detail::FakeString arg0;
14202
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
14203
0
    return false;
14204
0
  }
14205
0
  NonNull<nsINode> arg1;
14206
0
  if (args[1].isObject()) {
14207
0
    {
14208
0
      nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(args[1], arg1);
14209
0
      if (NS_FAILED(rv)) {
14210
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of Document.evaluate", "Node");
14211
0
        return false;
14212
0
      }
14213
0
    }
14214
0
  } else {
14215
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of Document.evaluate");
14216
0
    return false;
14217
0
  }
14218
0
  RootedCallback<RefPtr<binding_detail::FastXPathNSResolver>> arg2(cx);
14219
0
  if (args.hasDefined(2)) {
14220
0
    if (args[2].isObject()) {
14221
0
      { // scope for tempRoot and tempGlobalRoot if needed
14222
0
        arg2 = new binding_detail::FastXPathNSResolver(&args[2].toObject(), JS::CurrentGlobalOrNull(cx));
14223
0
      }
14224
0
    } else if (args[2].isNullOrUndefined()) {
14225
0
      arg2 = nullptr;
14226
0
    } else {
14227
0
      ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 3 of Document.evaluate");
14228
0
      return false;
14229
0
    }
14230
0
  } else {
14231
0
    arg2 = nullptr;
14232
0
  }
14233
0
  uint16_t arg3;
14234
0
  if (args.hasDefined(3)) {
14235
0
    if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[3], &arg3)) {
14236
0
      return false;
14237
0
    }
14238
0
  } else {
14239
0
    arg3 = 0;
14240
0
  }
14241
0
  JS::Rooted<JSObject*> arg4(cx);
14242
0
  if (args.hasDefined(4)) {
14243
0
    if (args[4].isObject()) {
14244
0
      arg4 = &args[4].toObject();
14245
0
    } else if (args[4].isNullOrUndefined()) {
14246
0
      arg4 = nullptr;
14247
0
    } else {
14248
0
      ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 5 of Document.evaluate");
14249
0
      return false;
14250
0
    }
14251
0
  } else {
14252
0
    arg4 = nullptr;
14253
0
  }
14254
0
  FastErrorResult rv;
14255
0
  auto result(StrongOrRawPtr<mozilla::dom::XPathResult>(self->Evaluate(cx, NonNullHelper(Constify(arg0)), MOZ_KnownLive(NonNullHelper(arg1)), MOZ_KnownLive(Constify(arg2)), arg3, arg4, rv)));
14256
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
14257
0
    return false;
14258
0
  }
14259
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
14260
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
14261
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
14262
0
    return false;
14263
0
  }
14264
0
  return true;
14265
0
}
14266
14267
static const JSJitInfo evaluate_methodinfo = {
14268
  { (JSJitGetterOp)evaluate },
14269
  { prototypes::id::Document },
14270
  { PrototypeTraits<prototypes::id::Document>::Depth },
14271
  JSJitInfo::Method,
14272
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
14273
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
14274
  false,  /* isInfallible. False in setters. */
14275
  false,  /* isMovable.  Not relevant for setters. */
14276
  false, /* isEliminatable.  Not relevant for setters. */
14277
  false, /* isAlwaysInSlot.  Only relevant for getters. */
14278
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
14279
  false,  /* isTypedMethod.  Only relevant for methods. */
14280
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
14281
};
14282
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
14283
static_assert(0 < 1, "There is no slot for us");
14284
14285
static bool
14286
_addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
14287
0
{
14288
0
  nsIDocument* self = UnwrapPossiblyNotInitializedDOMObject<nsIDocument>(obj);
14289
0
  // We don't want to preserve if we don't have a wrapper, and we
14290
0
  // obviously can't preserve if we're not initialized.
14291
0
  if (self && self->GetWrapperPreserveColor()) {
14292
0
    PreserveWrapper(self);
14293
0
  }
14294
0
  return true;
14295
0
}
14296
14297
static void
14298
_finalize(js::FreeOp* fop, JSObject* obj)
14299
0
{
14300
0
  nsIDocument* self = UnwrapPossiblyNotInitializedDOMObject<nsIDocument>(obj);
14301
0
  if (self) {
14302
0
    ClearWrapper(self, self, obj);
14303
0
    AddForDeferredFinalization<nsIDocument>(self);
14304
0
  }
14305
0
}
14306
14307
static size_t
14308
_objectMoved(JSObject* obj, JSObject* old)
14309
0
{
14310
0
  nsIDocument* self = UnwrapPossiblyNotInitializedDOMObject<nsIDocument>(obj);
14311
0
  if (self) {
14312
0
    UpdateWrapper(self, self, obj, old);
14313
0
  }
14314
0
14315
0
  return 0;
14316
0
}
14317
14318
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
14319
#if defined(__clang__)
14320
#pragma clang diagnostic push
14321
#pragma clang diagnostic ignored "-Wmissing-braces"
14322
#endif
14323
static const JSFunctionSpec sMethods_specs[] = {
14324
  JS_FNSPEC("getElementsByTagName", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getElementsByTagName_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14325
  JS_FNSPEC("getElementsByTagNameNS", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getElementsByTagNameNS_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
14326
  JS_FNSPEC("getElementsByClassName", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getElementsByClassName_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14327
  JS_FNSPEC("getElementById", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getElementById_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14328
  JS_FS_END,
14329
  JS_FNSPEC("createElement", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createElement_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14330
  JS_FNSPEC("createElementNS", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createElementNS_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
14331
  JS_FS_END,
14332
  JS_FNSPEC("createDocumentFragment", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createDocumentFragment_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
14333
  JS_FS_END,
14334
  JS_FNSPEC("createTextNode", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createTextNode_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14335
  JS_FNSPEC("createComment", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createComment_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14336
  JS_FS_END,
14337
  JS_FNSPEC("createProcessingInstruction", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createProcessingInstruction_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
14338
  JS_FS_END,
14339
  JS_FNSPEC("importNode", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&importNode_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14340
  JS_FNSPEC("adoptNode", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&adoptNode_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14341
  JS_FS_END,
14342
  JS_FNSPEC("createEvent", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createEvent_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14343
  JS_FNSPEC("createRange", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createRange_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
14344
  JS_FNSPEC("createNodeIterator", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createNodeIterator_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14345
  JS_FNSPEC("createTreeWalker", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createTreeWalker_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14346
  JS_FNSPEC("createCDATASection", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createCDATASection_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14347
  JS_FNSPEC("createAttribute", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createAttribute_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14348
  JS_FNSPEC("createAttributeNS", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createAttributeNS_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
14349
  JS_FNSPEC("getElementsByName", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getElementsByName_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14350
  JS_FNSPEC("hasFocus", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&hasFocus_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
14351
  JS_FS_END,
14352
  JS_FNSPEC("getBoxObjectFor", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getBoxObjectFor_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14353
  JS_FS_END,
14354
  JS_FNSPEC("releaseCapture", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&releaseCapture_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
14355
  JS_FNSPEC("mozSetImageElement", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&mozSetImageElement_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
14356
  JS_FS_END,
14357
  JS_FNSPEC("exitFullscreen", (GenericMethod<NormalThisPolicy, ConvertExceptionsToPromises>), reinterpret_cast<const JSJitInfo*>(&exitFullscreen_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
14358
  JS_FS_END,
14359
  JS_FNSPEC("mozCancelFullScreen", (GenericMethod<NormalThisPolicy, ConvertExceptionsToPromises>), reinterpret_cast<const JSJitInfo*>(&mozCancelFullScreen_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
14360
  JS_FNSPEC("exitPointerLock", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&exitPointerLock_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
14361
  JS_FNSPEC("enableStyleSheetsForSet", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&enableStyleSheetsForSet_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14362
  JS_FNSPEC("caretPositionFromPoint", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&caretPositionFromPoint_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
14363
  JS_FNSPEC("querySelector", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&querySelector_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14364
  JS_FNSPEC("querySelectorAll", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&querySelectorAll_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14365
  JS_FS_END,
14366
  JS_FNSPEC("getAnimations", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getAnimations_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
14367
  JS_FS_END,
14368
  JS_FNSPEC("getAnonymousNodes", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getAnonymousNodes_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14369
  JS_FNSPEC("getAnonymousElementByAttribute", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getAnonymousElementByAttribute_methodinfo), 3, JSPROP_ENUMERATE, nullptr),
14370
  JS_FNSPEC("getBindingParent", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getBindingParent_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14371
  JS_FNSPEC("loadBindingDocument", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&loadBindingDocument_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14372
  JS_FNSPEC("createXULElement", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createXULElement_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14373
  JS_FS_END,
14374
  JS_FNSPEC("createTouch", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createTouch_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
14375
  JS_FNSPEC("createTouchList", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createTouchList_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
14376
  JS_FS_END,
14377
  JS_FNSPEC("getSelection", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getSelection_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
14378
  JS_FS_END,
14379
  JS_FNSPEC("hasStorageAccess", (GenericMethod<NormalThisPolicy, ConvertExceptionsToPromises>), reinterpret_cast<const JSJitInfo*>(&hasStorageAccess_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
14380
  JS_FNSPEC("requestStorageAccess", (GenericMethod<NormalThisPolicy, ConvertExceptionsToPromises>), reinterpret_cast<const JSJitInfo*>(&requestStorageAccess_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
14381
  JS_FS_END,
14382
  JS_FNSPEC("elementFromPoint", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&elementFromPoint_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
14383
  JS_FNSPEC("elementsFromPoint", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&elementsFromPoint_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
14384
  JS_FS_END,
14385
  JS_FNSPEC("getBoxQuads", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getBoxQuads_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
14386
  JS_FS_END,
14387
  JS_FNSPEC("convertQuadFromNode", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&convertQuadFromNode_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
14388
  JS_FNSPEC("convertRectFromNode", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&convertRectFromNode_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
14389
  JS_FNSPEC("convertPointFromNode", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&convertPointFromNode_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
14390
  JS_FS_END,
14391
  JS_FNSPEC("getElementsByAttribute", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getElementsByAttribute_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
14392
  JS_FNSPEC("getElementsByAttributeNS", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getElementsByAttributeNS_methodinfo), 3, JSPROP_ENUMERATE, nullptr),
14393
  JS_FS_END,
14394
  JS_FNSPEC("prepend", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&prepend_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
14395
  JS_FNSPEC("append", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&append_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
14396
  JS_FNSPEC("createExpression", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createExpression_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14397
  JS_FNSPEC("createNSResolver", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createNSResolver_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14398
  JS_FNSPEC("evaluate", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&evaluate_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
14399
  JS_FS_END
14400
};
14401
#if defined(__clang__)
14402
#pragma clang diagnostic pop
14403
#endif
14404
14405
// Can't be const because the pref-enabled boolean needs to be writable
14406
static PrefableDisablers sMethods_disablers5 = {
14407
  true, false, 0, &IsNotUAWidget
14408
};
14409
14410
// Can't be const because the pref-enabled boolean needs to be writable
14411
static PrefableDisablers sMethods_disablers10 = {
14412
  true, false, 0, &IsNotUAWidget
14413
};
14414
14415
// Can't be const because the pref-enabled boolean needs to be writable
14416
static PrefableDisablers sMethods_disablers15 = {
14417
  true, false, 0, &IsNotUAWidget
14418
};
14419
14420
// Can't be const because the pref-enabled boolean needs to be writable
14421
static PrefableDisablers sMethods_disablers28 = {
14422
  true, false, 0, &IsChromeOrXBL
14423
};
14424
14425
// Can't be const because the pref-enabled boolean needs to be writable
14426
static PrefableDisablers sMethods_disablers33 = {
14427
  true, false, 0, &nsDocument::IsUnprefixedFullscreenEnabled
14428
};
14429
14430
// Can't be const because the pref-enabled boolean needs to be writable
14431
static PrefableDisablers sMethods_disablers42 = {
14432
  true, false, 0, &nsDocument::IsWebAnimationsGetAnimationsEnabled
14433
};
14434
14435
// Can't be const because the pref-enabled boolean needs to be writable
14436
static PrefableDisablers sMethods_disablers44 = {
14437
  true, false, 0, &IsChromeOrXBL
14438
};
14439
14440
// Can't be const because the pref-enabled boolean needs to be writable
14441
static PrefableDisablers sMethods_disablers50 = {
14442
  true, false, 0, &nsGenericHTMLElement::TouchEventsEnabled
14443
};
14444
14445
// Can't be const because the pref-enabled boolean needs to be writable
14446
static PrefableDisablers sMethods_disablers55 = {
14447
  true, false, 0, nullptr
14448
};
14449
14450
// Can't be const because the pref-enabled boolean needs to be writable
14451
static PrefableDisablers sMethods_disablers61 = {
14452
  true, false, 0, &nsINode::HasBoxQuadsSupport
14453
};
14454
14455
// Can't be const because the pref-enabled boolean needs to be writable
14456
static PrefableDisablers sMethods_disablers63 = {
14457
  true, false, 0, nullptr
14458
};
14459
14460
// Can't be const because the pref-enabled boolean needs to be writable
14461
static PrefableDisablers sMethods_disablers67 = {
14462
  true, false, 0, &IsChromeOrXBL
14463
};
14464
14465
static const Prefable<const JSFunctionSpec> sMethods[] = {
14466
  { nullptr, &sMethods_specs[0] },
14467
  { &sMethods_disablers5, &sMethods_specs[5] },
14468
  { nullptr, &sMethods_specs[8] },
14469
  { &sMethods_disablers10, &sMethods_specs[10] },
14470
  { nullptr, &sMethods_specs[13] },
14471
  { &sMethods_disablers15, &sMethods_specs[15] },
14472
  { nullptr, &sMethods_specs[18] },
14473
  { &sMethods_disablers28, &sMethods_specs[28] },
14474
  { nullptr, &sMethods_specs[30] },
14475
  { &sMethods_disablers33, &sMethods_specs[33] },
14476
  { nullptr, &sMethods_specs[35] },
14477
  { &sMethods_disablers42, &sMethods_specs[42] },
14478
  { &sMethods_disablers44, &sMethods_specs[44] },
14479
  { &sMethods_disablers50, &sMethods_specs[50] },
14480
  { nullptr, &sMethods_specs[53] },
14481
  { &sMethods_disablers55, &sMethods_specs[55] },
14482
  { nullptr, &sMethods_specs[58] },
14483
  { &sMethods_disablers61, &sMethods_specs[61] },
14484
  { &sMethods_disablers63, &sMethods_specs[63] },
14485
  { &sMethods_disablers67, &sMethods_specs[67] },
14486
  { nullptr, &sMethods_specs[70] },
14487
  { nullptr, nullptr }
14488
};
14489
14490
static_assert(21 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
14491
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
14492
static_assert(9 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
14493
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
14494
14495
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
14496
#if defined(__clang__)
14497
#pragma clang diagnostic push
14498
#pragma clang diagnostic ignored "-Wmissing-braces"
14499
#endif
14500
static const JSFunctionSpec sChromeMethods_specs[] = {
14501
  JS_FNSPEC("blockParsing", (GenericMethod<NormalThisPolicy, ConvertExceptionsToPromises>), reinterpret_cast<const JSJitInfo*>(&blockParsing_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14502
  JS_FNSPEC("insertAnonymousContent", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&insertAnonymousContent_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14503
  JS_FNSPEC("removeAnonymousContent", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&removeAnonymousContent_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
14504
  JS_FNSPEC("notifyUserGestureActivation", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&notifyUserGestureActivation_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
14505
  JS_FNSPEC("QueryInterface", QueryInterface, nullptr, 1, 0, nullptr),
14506
  JS_FS_END
14507
};
14508
#if defined(__clang__)
14509
#pragma clang diagnostic pop
14510
#endif
14511
14512
14513
static const Prefable<const JSFunctionSpec> sChromeMethods[] = {
14514
  { nullptr, &sChromeMethods_specs[0] },
14515
  { nullptr, nullptr }
14516
};
14517
14518
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
14519
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
14520
static_assert(5 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
14521
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
14522
14523
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
14524
#if defined(__clang__)
14525
#pragma clang diagnostic push
14526
#pragma clang diagnostic ignored "-Wmissing-braces"
14527
#endif
14528
static const JSPropertySpec sAttributes_specs[] = {
14529
  { "implementation", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &implementation_getterinfo, nullptr, nullptr },
14530
  { "URL", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &URL_getterinfo, nullptr, nullptr },
14531
  { "documentURI", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &documentURI_getterinfo, nullptr, nullptr },
14532
  { "compatMode", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &compatMode_getterinfo, nullptr, nullptr },
14533
  { "characterSet", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &characterSet_getterinfo, nullptr, nullptr },
14534
  { "charset", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &charset_getterinfo, nullptr, nullptr },
14535
  { "inputEncoding", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &inputEncoding_getterinfo, nullptr, nullptr },
14536
  { "contentType", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &contentType_getterinfo, nullptr, nullptr },
14537
  { "doctype", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &doctype_getterinfo, nullptr, nullptr },
14538
  { "documentElement", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &documentElement_getterinfo, nullptr, nullptr },
14539
  { "referrer", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &referrer_getterinfo, nullptr, nullptr },
14540
  { "lastModified", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &lastModified_getterinfo, nullptr, nullptr },
14541
  { "readyState", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readyState_getterinfo, nullptr, nullptr },
14542
  { "title", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &title_getterinfo, GenericSetter<NormalThisPolicy>, &title_setterinfo },
14543
  { "dir", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &dir_getterinfo, GenericSetter<NormalThisPolicy>, &dir_setterinfo },
14544
  { "body", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &body_getterinfo, GenericSetter<NormalThisPolicy>, &body_setterinfo },
14545
  { "head", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &head_getterinfo, nullptr, nullptr },
14546
  { "images", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &images_getterinfo, nullptr, nullptr },
14547
  { "embeds", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &embeds_getterinfo, nullptr, nullptr },
14548
  { "plugins", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &plugins_getterinfo, nullptr, nullptr },
14549
  { "links", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &links_getterinfo, nullptr, nullptr },
14550
  { "forms", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &forms_getterinfo, nullptr, nullptr },
14551
  { "scripts", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &scripts_getterinfo, nullptr, nullptr },
14552
  { "defaultView", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &defaultView_getterinfo, nullptr, nullptr },
14553
  { "onreadystatechange", JSPROP_ENUMERATE, GenericGetter<LenientThisPolicy, ThrowExceptions>, &onreadystatechange_getterinfo, GenericSetter<LenientThisPolicy>, &onreadystatechange_setterinfo },
14554
  { "onbeforescriptexecute", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onbeforescriptexecute_getterinfo, GenericSetter<NormalThisPolicy>, &onbeforescriptexecute_setterinfo },
14555
  { "onafterscriptexecute", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onafterscriptexecute_getterinfo, GenericSetter<NormalThisPolicy>, &onafterscriptexecute_setterinfo },
14556
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14557
  { "onselectionchange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onselectionchange_getterinfo, GenericSetter<NormalThisPolicy>, &onselectionchange_setterinfo },
14558
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14559
  { "mozSyntheticDocument", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &mozSyntheticDocument_getterinfo, nullptr, nullptr },
14560
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14561
  { "currentScript", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &currentScript_getterinfo, nullptr, nullptr },
14562
  { "anchors", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &anchors_getterinfo, nullptr, nullptr },
14563
  { "applets", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &applets_getterinfo, nullptr, nullptr },
14564
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14565
  { "fullscreen", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &fullscreen_getterinfo, GenericSetter<NormalThisPolicy>, &fullscreen_setterinfo },
14566
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14567
  { "mozFullScreen", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &mozFullScreen_getterinfo, nullptr, nullptr },
14568
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14569
  { "fullscreenEnabled", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &fullscreenEnabled_getterinfo, GenericSetter<NormalThisPolicy>, &fullscreenEnabled_setterinfo },
14570
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14571
  { "mozFullScreenEnabled", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &mozFullScreenEnabled_getterinfo, nullptr, nullptr },
14572
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14573
  { "onfullscreenchange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onfullscreenchange_getterinfo, GenericSetter<NormalThisPolicy>, &onfullscreenchange_setterinfo },
14574
  { "onfullscreenerror", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onfullscreenerror_getterinfo, GenericSetter<NormalThisPolicy>, &onfullscreenerror_setterinfo },
14575
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14576
  { "onpointerlockchange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointerlockchange_getterinfo, GenericSetter<NormalThisPolicy>, &onpointerlockchange_setterinfo },
14577
  { "onpointerlockerror", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointerlockerror_getterinfo, GenericSetter<NormalThisPolicy>, &onpointerlockerror_setterinfo },
14578
  { "hidden", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &hidden_getterinfo, nullptr, nullptr },
14579
  { "visibilityState", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &visibilityState_getterinfo, nullptr, nullptr },
14580
  { "onvisibilitychange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onvisibilitychange_getterinfo, GenericSetter<NormalThisPolicy>, &onvisibilitychange_setterinfo },
14581
  { "selectedStyleSheetSet", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &selectedStyleSheetSet_getterinfo, GenericSetter<NormalThisPolicy>, &selectedStyleSheetSet_setterinfo },
14582
  { "lastStyleSheetSet", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &lastStyleSheetSet_getterinfo, nullptr, nullptr },
14583
  { "preferredStyleSheetSet", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &preferredStyleSheetSet_getterinfo, nullptr, nullptr },
14584
  { "styleSheetSets", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &styleSheetSets_getterinfo, nullptr, nullptr },
14585
  { "scrollingElement", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &scrollingElement_getterinfo, nullptr, nullptr },
14586
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14587
  { "timeline", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &timeline_getterinfo, nullptr, nullptr },
14588
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14589
  { "rootElement", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &rootElement_getterinfo, nullptr, nullptr },
14590
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14591
  { "hasScriptsBlockedBySandbox", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &hasScriptsBlockedBySandbox_getterinfo, nullptr, nullptr },
14592
  { "inlineScriptAllowedByCSP", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &inlineScriptAllowedByCSP_getterinfo, nullptr, nullptr },
14593
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14594
  { "l10n", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &l10n_getterinfo, nullptr, nullptr },
14595
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14596
  { "oncopy", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &oncopy_getterinfo, GenericSetter<NormalThisPolicy>, &oncopy_setterinfo },
14597
  { "oncut", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &oncut_getterinfo, GenericSetter<NormalThisPolicy>, &oncut_setterinfo },
14598
  { "onpaste", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpaste_getterinfo, GenericSetter<NormalThisPolicy>, &onpaste_setterinfo },
14599
  { "activeElement", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &activeElement_getterinfo, nullptr, nullptr },
14600
  { "styleSheets", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &styleSheets_getterinfo, nullptr, nullptr },
14601
  { "pointerLockElement", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &pointerLockElement_getterinfo, nullptr, nullptr },
14602
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14603
  { "fullscreenElement", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &fullscreenElement_getterinfo, GenericSetter<NormalThisPolicy>, &fullscreenElement_setterinfo },
14604
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14605
  { "mozFullScreenElement", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &mozFullScreenElement_getterinfo, nullptr, nullptr },
14606
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14607
  { "fonts", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &fonts_getterinfo, nullptr, nullptr },
14608
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14609
  { "onabort", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onabort_getterinfo, GenericSetter<NormalThisPolicy>, &onabort_setterinfo },
14610
  { "onblur", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onblur_getterinfo, GenericSetter<NormalThisPolicy>, &onblur_setterinfo },
14611
  { "onfocus", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onfocus_getterinfo, GenericSetter<NormalThisPolicy>, &onfocus_setterinfo },
14612
  { "onauxclick", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onauxclick_getterinfo, GenericSetter<NormalThisPolicy>, &onauxclick_setterinfo },
14613
  { "oncanplay", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &oncanplay_getterinfo, GenericSetter<NormalThisPolicy>, &oncanplay_setterinfo },
14614
  { "oncanplaythrough", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &oncanplaythrough_getterinfo, GenericSetter<NormalThisPolicy>, &oncanplaythrough_setterinfo },
14615
  { "onchange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onchange_getterinfo, GenericSetter<NormalThisPolicy>, &onchange_setterinfo },
14616
  { "onclick", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onclick_getterinfo, GenericSetter<NormalThisPolicy>, &onclick_setterinfo },
14617
  { "onclose", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onclose_getterinfo, GenericSetter<NormalThisPolicy>, &onclose_setterinfo },
14618
  { "oncontextmenu", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &oncontextmenu_getterinfo, GenericSetter<NormalThisPolicy>, &oncontextmenu_setterinfo },
14619
  { "ondblclick", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondblclick_getterinfo, GenericSetter<NormalThisPolicy>, &ondblclick_setterinfo },
14620
  { "ondrag", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondrag_getterinfo, GenericSetter<NormalThisPolicy>, &ondrag_setterinfo },
14621
  { "ondragend", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondragend_getterinfo, GenericSetter<NormalThisPolicy>, &ondragend_setterinfo },
14622
  { "ondragenter", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondragenter_getterinfo, GenericSetter<NormalThisPolicy>, &ondragenter_setterinfo },
14623
  { "ondragexit", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondragexit_getterinfo, GenericSetter<NormalThisPolicy>, &ondragexit_setterinfo },
14624
  { "ondragleave", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondragleave_getterinfo, GenericSetter<NormalThisPolicy>, &ondragleave_setterinfo },
14625
  { "ondragover", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondragover_getterinfo, GenericSetter<NormalThisPolicy>, &ondragover_setterinfo },
14626
  { "ondragstart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondragstart_getterinfo, GenericSetter<NormalThisPolicy>, &ondragstart_setterinfo },
14627
  { "ondrop", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondrop_getterinfo, GenericSetter<NormalThisPolicy>, &ondrop_setterinfo },
14628
  { "ondurationchange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ondurationchange_getterinfo, GenericSetter<NormalThisPolicy>, &ondurationchange_setterinfo },
14629
  { "onemptied", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onemptied_getterinfo, GenericSetter<NormalThisPolicy>, &onemptied_setterinfo },
14630
  { "onended", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onended_getterinfo, GenericSetter<NormalThisPolicy>, &onended_setterinfo },
14631
  { "oninput", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &oninput_getterinfo, GenericSetter<NormalThisPolicy>, &oninput_setterinfo },
14632
  { "oninvalid", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &oninvalid_getterinfo, GenericSetter<NormalThisPolicy>, &oninvalid_setterinfo },
14633
  { "onkeydown", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onkeydown_getterinfo, GenericSetter<NormalThisPolicy>, &onkeydown_setterinfo },
14634
  { "onkeypress", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onkeypress_getterinfo, GenericSetter<NormalThisPolicy>, &onkeypress_setterinfo },
14635
  { "onkeyup", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onkeyup_getterinfo, GenericSetter<NormalThisPolicy>, &onkeyup_setterinfo },
14636
  { "onload", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onload_getterinfo, GenericSetter<NormalThisPolicy>, &onload_setterinfo },
14637
  { "onloadeddata", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onloadeddata_getterinfo, GenericSetter<NormalThisPolicy>, &onloadeddata_setterinfo },
14638
  { "onloadedmetadata", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onloadedmetadata_getterinfo, GenericSetter<NormalThisPolicy>, &onloadedmetadata_setterinfo },
14639
  { "onloadend", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onloadend_getterinfo, GenericSetter<NormalThisPolicy>, &onloadend_setterinfo },
14640
  { "onloadstart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onloadstart_getterinfo, GenericSetter<NormalThisPolicy>, &onloadstart_setterinfo },
14641
  { "onmousedown", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onmousedown_getterinfo, GenericSetter<NormalThisPolicy>, &onmousedown_setterinfo },
14642
  { "onmouseenter", JSPROP_ENUMERATE, GenericGetter<LenientThisPolicy, ThrowExceptions>, &onmouseenter_getterinfo, GenericSetter<LenientThisPolicy>, &onmouseenter_setterinfo },
14643
  { "onmouseleave", JSPROP_ENUMERATE, GenericGetter<LenientThisPolicy, ThrowExceptions>, &onmouseleave_getterinfo, GenericSetter<LenientThisPolicy>, &onmouseleave_setterinfo },
14644
  { "onmousemove", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onmousemove_getterinfo, GenericSetter<NormalThisPolicy>, &onmousemove_setterinfo },
14645
  { "onmouseout", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onmouseout_getterinfo, GenericSetter<NormalThisPolicy>, &onmouseout_setterinfo },
14646
  { "onmouseover", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onmouseover_getterinfo, GenericSetter<NormalThisPolicy>, &onmouseover_setterinfo },
14647
  { "onmouseup", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onmouseup_getterinfo, GenericSetter<NormalThisPolicy>, &onmouseup_setterinfo },
14648
  { "onwheel", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onwheel_getterinfo, GenericSetter<NormalThisPolicy>, &onwheel_setterinfo },
14649
  { "onpause", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpause_getterinfo, GenericSetter<NormalThisPolicy>, &onpause_setterinfo },
14650
  { "onplay", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onplay_getterinfo, GenericSetter<NormalThisPolicy>, &onplay_setterinfo },
14651
  { "onplaying", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onplaying_getterinfo, GenericSetter<NormalThisPolicy>, &onplaying_setterinfo },
14652
  { "onprogress", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onprogress_getterinfo, GenericSetter<NormalThisPolicy>, &onprogress_setterinfo },
14653
  { "onratechange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onratechange_getterinfo, GenericSetter<NormalThisPolicy>, &onratechange_setterinfo },
14654
  { "onreset", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onreset_getterinfo, GenericSetter<NormalThisPolicy>, &onreset_setterinfo },
14655
  { "onresize", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onresize_getterinfo, GenericSetter<NormalThisPolicy>, &onresize_setterinfo },
14656
  { "onscroll", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onscroll_getterinfo, GenericSetter<NormalThisPolicy>, &onscroll_setterinfo },
14657
  { "onseeked", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onseeked_getterinfo, GenericSetter<NormalThisPolicy>, &onseeked_setterinfo },
14658
  { "onseeking", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onseeking_getterinfo, GenericSetter<NormalThisPolicy>, &onseeking_setterinfo },
14659
  { "onselect", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onselect_getterinfo, GenericSetter<NormalThisPolicy>, &onselect_setterinfo },
14660
  { "onshow", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onshow_getterinfo, GenericSetter<NormalThisPolicy>, &onshow_setterinfo },
14661
  { "onstalled", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onstalled_getterinfo, GenericSetter<NormalThisPolicy>, &onstalled_setterinfo },
14662
  { "onsubmit", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onsubmit_getterinfo, GenericSetter<NormalThisPolicy>, &onsubmit_setterinfo },
14663
  { "onsuspend", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onsuspend_getterinfo, GenericSetter<NormalThisPolicy>, &onsuspend_setterinfo },
14664
  { "ontimeupdate", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontimeupdate_getterinfo, GenericSetter<NormalThisPolicy>, &ontimeupdate_setterinfo },
14665
  { "onvolumechange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onvolumechange_getterinfo, GenericSetter<NormalThisPolicy>, &onvolumechange_setterinfo },
14666
  { "onwaiting", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onwaiting_getterinfo, GenericSetter<NormalThisPolicy>, &onwaiting_setterinfo },
14667
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14668
  { "onselectstart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onselectstart_getterinfo, GenericSetter<NormalThisPolicy>, &onselectstart_setterinfo },
14669
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14670
  { "ontoggle", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontoggle_getterinfo, GenericSetter<NormalThisPolicy>, &ontoggle_setterinfo },
14671
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14672
  { "onpointercancel", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointercancel_getterinfo, GenericSetter<NormalThisPolicy>, &onpointercancel_setterinfo },
14673
  { "onpointerdown", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointerdown_getterinfo, GenericSetter<NormalThisPolicy>, &onpointerdown_setterinfo },
14674
  { "onpointerup", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointerup_getterinfo, GenericSetter<NormalThisPolicy>, &onpointerup_setterinfo },
14675
  { "onpointermove", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointermove_getterinfo, GenericSetter<NormalThisPolicy>, &onpointermove_setterinfo },
14676
  { "onpointerout", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointerout_getterinfo, GenericSetter<NormalThisPolicy>, &onpointerout_setterinfo },
14677
  { "onpointerover", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointerover_getterinfo, GenericSetter<NormalThisPolicy>, &onpointerover_setterinfo },
14678
  { "onpointerenter", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointerenter_getterinfo, GenericSetter<NormalThisPolicy>, &onpointerenter_setterinfo },
14679
  { "onpointerleave", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onpointerleave_getterinfo, GenericSetter<NormalThisPolicy>, &onpointerleave_setterinfo },
14680
  { "ongotpointercapture", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ongotpointercapture_getterinfo, GenericSetter<NormalThisPolicy>, &ongotpointercapture_setterinfo },
14681
  { "onlostpointercapture", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onlostpointercapture_getterinfo, GenericSetter<NormalThisPolicy>, &onlostpointercapture_setterinfo },
14682
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14683
  { "onmozfullscreenchange", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onmozfullscreenchange_getterinfo, GenericSetter<NormalThisPolicy>, &onmozfullscreenchange_setterinfo },
14684
  { "onmozfullscreenerror", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onmozfullscreenerror_getterinfo, GenericSetter<NormalThisPolicy>, &onmozfullscreenerror_setterinfo },
14685
  { "onanimationcancel", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onanimationcancel_getterinfo, GenericSetter<NormalThisPolicy>, &onanimationcancel_setterinfo },
14686
  { "onanimationend", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onanimationend_getterinfo, GenericSetter<NormalThisPolicy>, &onanimationend_setterinfo },
14687
  { "onanimationiteration", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onanimationiteration_getterinfo, GenericSetter<NormalThisPolicy>, &onanimationiteration_setterinfo },
14688
  { "onanimationstart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onanimationstart_getterinfo, GenericSetter<NormalThisPolicy>, &onanimationstart_setterinfo },
14689
  { "ontransitioncancel", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontransitioncancel_getterinfo, GenericSetter<NormalThisPolicy>, &ontransitioncancel_setterinfo },
14690
  { "ontransitionend", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontransitionend_getterinfo, GenericSetter<NormalThisPolicy>, &ontransitionend_setterinfo },
14691
  { "ontransitionrun", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontransitionrun_getterinfo, GenericSetter<NormalThisPolicy>, &ontransitionrun_setterinfo },
14692
  { "ontransitionstart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontransitionstart_getterinfo, GenericSetter<NormalThisPolicy>, &ontransitionstart_setterinfo },
14693
  { "onwebkitanimationend", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onwebkitanimationend_getterinfo, GenericSetter<NormalThisPolicy>, &onwebkitanimationend_setterinfo },
14694
  { "onwebkitanimationiteration", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onwebkitanimationiteration_getterinfo, GenericSetter<NormalThisPolicy>, &onwebkitanimationiteration_setterinfo },
14695
  { "onwebkitanimationstart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onwebkitanimationstart_getterinfo, GenericSetter<NormalThisPolicy>, &onwebkitanimationstart_setterinfo },
14696
  { "onwebkittransitionend", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onwebkittransitionend_getterinfo, GenericSetter<NormalThisPolicy>, &onwebkittransitionend_setterinfo },
14697
  { "onerror", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &onerror_getterinfo, GenericSetter<NormalThisPolicy>, &onerror_setterinfo },
14698
  { "children", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &children_getterinfo, nullptr, nullptr },
14699
  { "firstElementChild", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &firstElementChild_getterinfo, nullptr, nullptr },
14700
  { "lastElementChild", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &lastElementChild_getterinfo, nullptr, nullptr },
14701
  { "childElementCount", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &childElementCount_getterinfo, nullptr, nullptr },
14702
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
14703
  { "ontouchstart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontouchstart_getterinfo, GenericSetter<NormalThisPolicy>, &ontouchstart_setterinfo },
14704
  { "ontouchend", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontouchend_getterinfo, GenericSetter<NormalThisPolicy>, &ontouchend_setterinfo },
14705
  { "ontouchmove", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontouchmove_getterinfo, GenericSetter<NormalThisPolicy>, &ontouchmove_setterinfo },
14706
  { "ontouchcancel", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ontouchcancel_getterinfo, GenericSetter<NormalThisPolicy>, &ontouchcancel_setterinfo },
14707
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
14708
};
14709
#if defined(__clang__)
14710
#pragma clang diagnostic pop
14711
#endif
14712
14713
// Can't be const because the pref-enabled boolean needs to be writable
14714
static PrefableDisablers sAttributes_disablers28 = {
14715
  true, false, 0, nullptr
14716
};
14717
14718
// Can't be const because the pref-enabled boolean needs to be writable
14719
static PrefableDisablers sAttributes_disablers30 = {
14720
  true, false, 0, &IsChromeOrXBLOrUAWidget
14721
};
14722
14723
// Can't be const because the pref-enabled boolean needs to be writable
14724
static PrefableDisablers sAttributes_disablers36 = {
14725
  true, false, 0, &nsDocument::IsUnprefixedFullscreenEnabled
14726
};
14727
14728
// Can't be const because the pref-enabled boolean needs to be writable
14729
static PrefableDisablers sAttributes_disablers40 = {
14730
  true, false, 0, &nsDocument::IsUnprefixedFullscreenEnabled
14731
};
14732
14733
// Can't be const because the pref-enabled boolean needs to be writable
14734
static PrefableDisablers sAttributes_disablers44 = {
14735
  true, false, 0, &nsDocument::IsUnprefixedFullscreenEnabled
14736
};
14737
14738
// Can't be const because the pref-enabled boolean needs to be writable
14739
static PrefableDisablers sAttributes_disablers58 = {
14740
  true, false, 0, &nsDocument::AreWebAnimationsTimelinesEnabled
14741
};
14742
14743
// Can't be const because the pref-enabled boolean needs to be writable
14744
static PrefableDisablers sAttributes_disablers62 = {
14745
  true, false, 0, &IsChromeOrXBL
14746
};
14747
14748
// Can't be const because the pref-enabled boolean needs to be writable
14749
static PrefableDisablers sAttributes_disablers65 = {
14750
  true, false, 0, &nsDocument::DocumentSupportsL10n
14751
};
14752
14753
// Can't be const because the pref-enabled boolean needs to be writable
14754
static PrefableDisablers sAttributes_disablers74 = {
14755
  true, false, 0, &nsIDocument::IsUnprefixedFullscreenEnabled
14756
};
14757
14758
// Can't be const because the pref-enabled boolean needs to be writable
14759
static PrefableDisablers sAttributes_disablers78 = {
14760
  true, false, 0, nullptr
14761
};
14762
14763
// Can't be const because the pref-enabled boolean needs to be writable
14764
static PrefableDisablers sAttributes_disablers139 = {
14765
  true, false, 0, nullptr
14766
};
14767
14768
// Can't be const because the pref-enabled boolean needs to be writable
14769
static PrefableDisablers sAttributes_disablers143 = {
14770
  true, false, 0, nullptr
14771
};
14772
14773
// Can't be const because the pref-enabled boolean needs to be writable
14774
static PrefableDisablers sAttributes_disablers174 = {
14775
  true, false, 0, &nsGenericHTMLElement::TouchEventsEnabled
14776
};
14777
14778
static const Prefable<const JSPropertySpec> sAttributes[] = {
14779
  { nullptr, &sAttributes_specs[0] },
14780
  { &sAttributes_disablers28, &sAttributes_specs[28] },
14781
  { &sAttributes_disablers30, &sAttributes_specs[30] },
14782
  { nullptr, &sAttributes_specs[32] },
14783
  { &sAttributes_disablers36, &sAttributes_specs[36] },
14784
  { nullptr, &sAttributes_specs[38] },
14785
  { &sAttributes_disablers40, &sAttributes_specs[40] },
14786
  { nullptr, &sAttributes_specs[42] },
14787
  { &sAttributes_disablers44, &sAttributes_specs[44] },
14788
  { nullptr, &sAttributes_specs[47] },
14789
  { &sAttributes_disablers58, &sAttributes_specs[58] },
14790
  { nullptr, &sAttributes_specs[60] },
14791
  { &sAttributes_disablers62, &sAttributes_specs[62] },
14792
  { &sAttributes_disablers65, &sAttributes_specs[65] },
14793
  { nullptr, &sAttributes_specs[67] },
14794
  { &sAttributes_disablers74, &sAttributes_specs[74] },
14795
  { nullptr, &sAttributes_specs[76] },
14796
  { &sAttributes_disablers78, &sAttributes_specs[78] },
14797
  { nullptr, &sAttributes_specs[80] },
14798
  { &sAttributes_disablers139, &sAttributes_specs[139] },
14799
  { nullptr, &sAttributes_specs[141] },
14800
  { &sAttributes_disablers143, &sAttributes_specs[143] },
14801
  { nullptr, &sAttributes_specs[154] },
14802
  { &sAttributes_disablers174, &sAttributes_specs[174] },
14803
  { nullptr, nullptr }
14804
};
14805
14806
static_assert(24 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
14807
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
14808
static_assert(58 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
14809
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
14810
14811
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
14812
#if defined(__clang__)
14813
#pragma clang diagnostic push
14814
#pragma clang diagnostic ignored "-Wmissing-braces"
14815
#endif
14816
static const JSPropertySpec sChromeAttributes_specs[] = {
14817
  { "documentURIObject", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &documentURIObject_getterinfo, nullptr, nullptr },
14818
  { "referrerPolicy", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &referrerPolicy_getterinfo, nullptr, nullptr },
14819
  { "styleSheetChangeEventsEnabled", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &styleSheetChangeEventsEnabled_getterinfo, GenericSetter<NormalThisPolicy>, &styleSheetChangeEventsEnabled_setterinfo },
14820
  { "contentLanguage", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &contentLanguage_getterinfo, nullptr, nullptr },
14821
  { "documentLoadGroup", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &documentLoadGroup_getterinfo, nullptr, nullptr },
14822
  { "mozDocumentURIIfNotForErrorPages", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &mozDocumentURIIfNotForErrorPages_getterinfo, nullptr, nullptr },
14823
  { "documentReadyForIdle", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ConvertExceptionsToPromises>, &documentReadyForIdle_getterinfo, nullptr, nullptr },
14824
  { "commandDispatcher", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &commandDispatcher_getterinfo, nullptr, nullptr },
14825
  { "popupNode", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &popupNode_getterinfo, GenericSetter<NormalThisPolicy>, &popupNode_setterinfo },
14826
  { "popupRangeParent", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &popupRangeParent_getterinfo, nullptr, nullptr },
14827
  { "popupRangeOffset", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &popupRangeOffset_getterinfo, nullptr, nullptr },
14828
  { "tooltipNode", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &tooltipNode_getterinfo, GenericSetter<NormalThisPolicy>, &tooltipNode_setterinfo },
14829
  { "isSrcdocDocument", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &isSrcdocDocument_getterinfo, nullptr, nullptr },
14830
  { "sandboxFlagsAsString", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &sandboxFlagsAsString_getterinfo, nullptr, nullptr },
14831
  { "userHasInteracted", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &userHasInteracted_getterinfo, nullptr, nullptr },
14832
  { "documentFlashClassification", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &documentFlashClassification_getterinfo, nullptr, nullptr },
14833
  { "numTrackersFound", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &numTrackersFound_getterinfo, nullptr, nullptr },
14834
  { "numTrackersBlocked", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &numTrackersBlocked_getterinfo, nullptr, nullptr },
14835
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
14836
};
14837
#if defined(__clang__)
14838
#pragma clang diagnostic pop
14839
#endif
14840
14841
14842
static const Prefable<const JSPropertySpec> sChromeAttributes[] = {
14843
  { nullptr, &sChromeAttributes_specs[0] },
14844
  { nullptr, nullptr }
14845
};
14846
14847
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
14848
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
14849
static_assert(18 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
14850
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
14851
14852
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
14853
#if defined(__clang__)
14854
#pragma clang diagnostic push
14855
#pragma clang diagnostic ignored "-Wmissing-braces"
14856
#endif
14857
static const JSPropertySpec sUnforgeableAttributes_specs[] = {
14858
  { "location", JSPROP_ENUMERATE | JSPROP_PERMANENT, GenericGetter<NormalThisPolicy, ThrowExceptions>, &location_getterinfo, GenericSetter<NormalThisPolicy>, &location_setterinfo },
14859
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
14860
};
14861
#if defined(__clang__)
14862
#pragma clang diagnostic pop
14863
#endif
14864
14865
14866
static const Prefable<const JSPropertySpec> sUnforgeableAttributes[] = {
14867
  { nullptr, &sUnforgeableAttributes_specs[0] },
14868
  { nullptr, nullptr }
14869
};
14870
14871
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
14872
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
14873
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
14874
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
14875
14876
14877
static uint16_t sNativeProperties_sortedPropertyIndices[211];
14878
static PropertyInfo sNativeProperties_propertyInfos[211];
14879
14880
static const NativePropertiesN<3> sNativeProperties = {
14881
  false, 0,
14882
  false, 0,
14883
  true,  0 /* sMethods */,
14884
  true,  1 /* sAttributes */,
14885
  false, 0,
14886
  true,  2 /* sUnforgeableAttributes */,
14887
  false, 0,
14888
  -1,
14889
  211,
14890
  sNativeProperties_sortedPropertyIndices,
14891
  {
14892
    { sMethods, &sNativeProperties_propertyInfos[0] },
14893
    { sAttributes, &sNativeProperties_propertyInfos[55] },
14894
    { sUnforgeableAttributes, &sNativeProperties_propertyInfos[210] }
14895
  }
14896
};
14897
static_assert(211 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
14898
    "We have a property info count that is oversized");
14899
14900
static uint16_t sChromeOnlyNativeProperties_sortedPropertyIndices[23];
14901
static PropertyInfo sChromeOnlyNativeProperties_propertyInfos[23];
14902
14903
static const NativePropertiesN<2> sChromeOnlyNativeProperties = {
14904
  false, 0,
14905
  false, 0,
14906
  true,  0 /* sChromeMethods */,
14907
  true,  1 /* sChromeAttributes */,
14908
  false, 0,
14909
  false, 0,
14910
  false, 0,
14911
  -1,
14912
  23,
14913
  sChromeOnlyNativeProperties_sortedPropertyIndices,
14914
  {
14915
    { sChromeMethods, &sChromeOnlyNativeProperties_propertyInfos[0] },
14916
    { sChromeAttributes, &sChromeOnlyNativeProperties_propertyInfos[5] }
14917
  }
14918
};
14919
static_assert(23 < 1ull << CHAR_BIT * sizeof(sChromeOnlyNativeProperties.propertyInfoCount),
14920
    "We have a property info count that is oversized");
14921
14922
static bool
14923
_constructor(JSContext* cx, unsigned argc, JS::Value* vp)
14924
0
{
14925
0
  AUTO_PROFILER_LABEL_FAST("Document constructor", DOM, cx);
14926
0
14927
0
  JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
14928
0
  JS::Rooted<JSObject*> obj(cx, &args.callee());
14929
0
  if (!args.isConstructing()) {
14930
0
    // XXXbz wish I could get the name from the callee instead of
14931
0
    // Adding more relocations
14932
0
    return ThrowConstructorWithoutNew(cx, "Document");
14933
0
  }
14934
0
14935
0
  JS::Rooted<JSObject*> desiredProto(cx);
14936
0
  if (!GetDesiredProto(cx, args, &desiredProto)) {
14937
0
    return false;
14938
0
  }
14939
0
14940
0
  GlobalObject global(cx, obj);
14941
0
  if (global.Failed()) {
14942
0
    return false;
14943
0
  }
14944
0
14945
0
  bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
14946
0
  Maybe<JSAutoRealm> ar;
14947
0
  if (objIsXray) {
14948
0
    obj = js::CheckedUnwrap(obj);
14949
0
    if (!obj) {
14950
0
      return false;
14951
0
    }
14952
0
    ar.emplace(cx, obj);
14953
0
    if (!JS_WrapObject(cx, &desiredProto)) {
14954
0
      return false;
14955
0
    }
14956
0
  }
14957
0
  FastErrorResult rv;
14958
0
  auto result(StrongOrRawPtr<nsIDocument>(nsIDocument::Constructor(global, rv)));
14959
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
14960
0
    return false;
14961
0
  }
14962
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
14963
0
  static_assert(!IsPointer<decltype(result)>::value,
14964
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
14965
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) {
14966
0
    MOZ_CRASH("Looks like bug 1488480/1405521, with getting the reflector failing");
14967
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
14968
0
    return false;
14969
0
  }
14970
0
  return true;
14971
0
}
14972
14973
static const js::ClassOps sInterfaceObjectClassOps = {
14974
    nullptr,               /* addProperty */
14975
    nullptr,               /* delProperty */
14976
    nullptr,               /* enumerate */
14977
    nullptr,               /* newEnumerate */
14978
    nullptr,               /* resolve */
14979
    nullptr,               /* mayResolve */
14980
    nullptr,               /* finalize */
14981
    _constructor, /* call */
14982
    nullptr,               /* hasInstance */
14983
    _constructor, /* construct */
14984
    nullptr,               /* trace */
14985
};
14986
14987
static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
14988
  {
14989
    "Function",
14990
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE),
14991
    &sInterfaceObjectClassOps,
14992
    JS_NULL_CLASS_SPEC,
14993
    JS_NULL_CLASS_EXT,
14994
    &sInterfaceObjectClassObjectOps
14995
  },
14996
  eInterface,
14997
  true,
14998
  prototypes::id::Document,
14999
  PrototypeTraits<prototypes::id::Document>::Depth,
15000
  sNativePropertyHooks,
15001
  "function Document() {\n    [native code]\n}",
15002
  Node_Binding::GetConstructorObject
15003
};
15004
15005
static const DOMIfaceAndProtoJSClass sPrototypeClass = {
15006
  {
15007
    "DocumentPrototype",
15008
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE + 1 /* slot for the JSObject holding the unforgeable properties */),
15009
    JS_NULL_CLASS_OPS,
15010
    JS_NULL_CLASS_SPEC,
15011
    JS_NULL_CLASS_EXT,
15012
    JS_NULL_OBJECT_OPS
15013
  },
15014
  eInterfacePrototype,
15015
  false,
15016
  prototypes::id::Document,
15017
  PrototypeTraits<prototypes::id::Document>::Depth,
15018
  sNativePropertyHooks,
15019
  "[object DocumentPrototype]",
15020
  Node_Binding::GetProtoObject
15021
};
15022
15023
static const js::ClassOps sClassOps = {
15024
  _addProperty, /* addProperty */
15025
  nullptr,               /* delProperty */
15026
  nullptr,               /* enumerate */
15027
  nullptr, /* newEnumerate */
15028
  nullptr, /* resolve */
15029
  nullptr, /* mayResolve */
15030
  _finalize, /* finalize */
15031
  nullptr, /* call */
15032
  nullptr,               /* hasInstance */
15033
  nullptr,               /* construct */
15034
  nullptr, /* trace */
15035
};
15036
15037
static const js::ClassExtension sClassExtension = {
15038
  nullptr, /* weakmapKeyDelegateOp */
15039
  _objectMoved /* objectMovedOp */
15040
};
15041
15042
static const DOMJSClass sClass = {
15043
  { "Document",
15044
    JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
15045
    &sClassOps,
15046
    JS_NULL_CLASS_SPEC,
15047
    &sClassExtension,
15048
    JS_NULL_OBJECT_OPS
15049
  },
15050
  { prototypes::id::EventTarget, prototypes::id::Node, prototypes::id::Document, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
15051
  IsBaseOf<nsISupports, nsIDocument >::value,
15052
  sNativePropertyHooks,
15053
  FindAssociatedGlobalForNative<nsIDocument>::Get,
15054
  GetProtoObjectHandle,
15055
  GetCCParticipant<nsIDocument>::Get()
15056
};
15057
static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
15058
              "Must have the right minimal number of reserved slots.");
15059
static_assert(1 >= 1,
15060
              "Must have enough reserved slots.");
15061
15062
const JSClass*
15063
GetJSClass()
15064
0
{
15065
0
  return sClass.ToJSClass();
15066
0
}
15067
15068
bool
15069
Wrap(JSContext* aCx, nsIDocument* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
15070
0
{
15071
0
  static_assert(!IsBaseOf<NonRefcountedDOMObject, nsIDocument>::value,
15072
0
                "Shouldn't have wrappercached things that are not refcounted.");
15073
0
  MOZ_ASSERT(static_cast<nsIDocument*>(aObject) ==
15074
0
             reinterpret_cast<nsIDocument*>(aObject),
15075
0
             "Multiple inheritance for nsIDocument is broken.");
15076
0
  MOZ_ASSERT(static_cast<nsINode*>(aObject) ==
15077
0
             reinterpret_cast<nsINode*>(aObject),
15078
0
             "Multiple inheritance for nsINode is broken.");
15079
0
  MOZ_ASSERT(static_cast<mozilla::dom::EventTarget*>(aObject) ==
15080
0
             reinterpret_cast<mozilla::dom::EventTarget*>(aObject),
15081
0
             "Multiple inheritance for mozilla::dom::EventTarget is broken.");
15082
0
  MOZ_ASSERT(ToSupportsIsCorrect(aObject));
15083
0
  MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
15084
0
  MOZ_ASSERT(!aCache->GetWrapper(),
15085
0
             "You should probably not be using Wrap() directly; use "
15086
0
             "GetOrCreateDOMReflector instead");
15087
0
15088
0
  MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
15089
0
             "nsISupports must be on our primary inheritance chain");
15090
0
15091
0
  JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
15092
0
  if (!global) {
15093
0
    return false;
15094
0
  }
15095
0
  MOZ_ASSERT(JS_IsGlobalObject(global));
15096
0
  MOZ_ASSERT(JS::ObjectIsNotGray(global));
15097
0
15098
0
  // That might have ended up wrapping us already, due to the wonders
15099
0
  // of XBL.  Check for that, and bail out as needed.
15100
0
  aReflector.set(aCache->GetWrapper());
15101
0
  if (aReflector) {
15102
#ifdef DEBUG
15103
    AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
15104
#endif // DEBUG
15105
    return true;
15106
0
  }
15107
0
15108
0
  JSAutoRealm ar(aCx, global);
15109
0
  JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
15110
0
  if (!canonicalProto) {
15111
0
    return false;
15112
0
  }
15113
0
  JS::Rooted<JSObject*> proto(aCx);
15114
0
  if (aGivenProto) {
15115
0
    proto = aGivenProto;
15116
0
    // Unfortunately, while aGivenProto was in the compartment of aCx
15117
0
    // coming in, we changed compartments to that of "parent" so may need
15118
0
    // to wrap the proto here.
15119
0
    if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) {
15120
0
      if (!JS_WrapObject(aCx, &proto)) {
15121
0
        return false;
15122
0
      }
15123
0
    }
15124
0
  } else {
15125
0
    proto = canonicalProto;
15126
0
  }
15127
0
15128
0
  BindingJSObjectCreator<nsIDocument> creator(aCx);
15129
0
  creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
15130
0
  if (!aReflector) {
15131
0
    return false;
15132
0
  }
15133
0
15134
0
  aCache->SetWrapper(aReflector);
15135
0
15136
0
  // Important: do unforgeable property setup after we have handed
15137
0
  // over ownership of the C++ object to obj as needed, so that if
15138
0
  // we fail and it ends up GCed it won't have problems in the
15139
0
  // finalizer trying to drop its ownership of the C++ object.
15140
0
  JS::Rooted<JSObject*> unforgeableHolder(aCx,
15141
0
    &js::GetReservedSlot(canonicalProto, DOM_INTERFACE_PROTO_SLOTS_BASE).toObject());
15142
0
  if (!JS_InitializePropertiesFromCompatibleNativeObject(aCx, aReflector, unforgeableHolder)) {
15143
0
    aCache->ReleaseWrapper(aObject);
15144
0
    aCache->ClearWrapper();
15145
0
    return false;
15146
0
  }
15147
0
  creator.InitializationSucceeded();
15148
0
15149
0
  MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&
15150
0
             aCache->GetWrapperPreserveColor() == aReflector);
15151
0
  // If proto != canonicalProto, we have to preserve our wrapper;
15152
0
  // otherwise we won't be able to properly recreate it later, since
15153
0
  // we won't know what proto to use.  Note that we don't check
15154
0
  // aGivenProto here, since it's entirely possible (and even
15155
0
  // somewhat common) to have a non-null aGivenProto which is the
15156
0
  // same as canonicalProto.
15157
0
  if (proto != canonicalProto) {
15158
0
    PreserveWrapper(aObject);
15159
0
  }
15160
0
15161
0
  return true;
15162
0
}
15163
15164
const NativePropertyHooks sNativePropertyHooks[] = { {
15165
  nullptr,
15166
  nullptr,
15167
  nullptr,
15168
  { sNativeProperties.Upcast(), sChromeOnlyNativeProperties.Upcast() },
15169
  prototypes::id::Document,
15170
  constructors::id::Document,
15171
  Node_Binding::sNativePropertyHooks,
15172
  &DefaultXrayExpandoObjectClass
15173
} };
15174
15175
static const char* const unscopableNames[] = {
15176
  "fullscreen",
15177
  "prepend",
15178
  "append",
15179
  nullptr
15180
};
15181
15182
void
15183
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
15184
0
{
15185
0
  JS::Handle<JSObject*> parentProto(Node_Binding::GetProtoObjectHandle(aCx));
15186
0
  if (!parentProto) {
15187
0
    return;
15188
0
  }
15189
0
15190
0
  JS::Handle<JSObject*> constructorProto(Node_Binding::GetConstructorObjectHandle(aCx));
15191
0
  if (!constructorProto) {
15192
0
    return;
15193
0
  }
15194
0
15195
0
  static bool sIdsInited = false;
15196
0
  if (!sIdsInited && NS_IsMainThread()) {
15197
0
    if (!InitIds(aCx, sNativeProperties.Upcast())) {
15198
0
      return;
15199
0
    }
15200
0
    if (!InitIds(aCx, sChromeOnlyNativeProperties.Upcast())) {
15201
0
      return;
15202
0
    }
15203
0
    sIdsInited = true;
15204
0
  }
15205
0
15206
0
  static bool sPrefCachesInited = false;
15207
0
  if (!sPrefCachesInited && NS_IsMainThread()) {
15208
0
    sPrefCachesInited = true;
15209
0
    Preferences::AddBoolVarCache(&sMethods[15].disablers->enabled, "dom.storage_access.enabled");
15210
0
    Preferences::AddBoolVarCache(&sMethods[18].disablers->enabled, "layout.css.convertFromNode.enabled");
15211
0
    Preferences::AddBoolVarCache(&sAttributes[1].disablers->enabled, "dom.select_events.enabled");
15212
0
    Preferences::AddBoolVarCache(&sAttributes[17].disablers->enabled, "layout.css.font-loading-api.enabled");
15213
0
    Preferences::AddBoolVarCache(&sAttributes[19].disablers->enabled, "dom.select_events.enabled");
15214
0
    Preferences::AddBoolVarCache(&sAttributes[21].disablers->enabled, "dom.w3c_pointer_events.enabled");
15215
0
  }
15216
0
15217
0
  JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::Document);
15218
0
  JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::Document);
15219
0
  dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
15220
0
                              &sPrototypeClass.mBase, protoCache,
15221
0
                              nullptr,
15222
0
                              constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr,
15223
0
                              interfaceCache,
15224
0
                              sNativeProperties.Upcast(),
15225
0
                              sChromeOnlyNativeProperties.Upcast(),
15226
0
                              "Document", aDefineOnGlobal,
15227
0
                              unscopableNames,
15228
0
                              false);
15229
0
15230
0
  JS::Rooted<JSObject*> unforgeableHolder(aCx);
15231
0
  {
15232
0
    JS::Rooted<JSObject*> holderProto(aCx, *protoCache);
15233
0
    unforgeableHolder = JS_NewObjectWithoutMetadata(aCx, sClass.ToJSClass(), holderProto);
15234
0
    if (!unforgeableHolder) {
15235
0
      *protoCache = nullptr;
15236
0
      if (interfaceCache) {
15237
0
        *interfaceCache = nullptr;
15238
0
      }
15239
0
      return;
15240
0
    }
15241
0
  }
15242
0
15243
0
  if (!DefineUnforgeableAttributes(aCx, unforgeableHolder, sUnforgeableAttributes)) {
15244
0
    *protoCache = nullptr;
15245
0
    if (interfaceCache) {
15246
0
      *interfaceCache = nullptr;
15247
0
    }
15248
0
    return;
15249
0
  }
15250
0
15251
0
  if (*protoCache) {
15252
0
    js::SetReservedSlot(*protoCache, DOM_INTERFACE_PROTO_SLOTS_BASE,
15253
0
                        JS::ObjectValue(*unforgeableHolder));
15254
0
  }
15255
0
}
15256
15257
JSObject*
15258
GetProtoObject(JSContext* aCx)
15259
0
{
15260
0
  return GetProtoObjectHandle(aCx);
15261
0
}
15262
15263
JSObject*
15264
GetConstructorObject(JSContext* aCx)
15265
0
{
15266
0
  return GetConstructorObjectHandle(aCx);
15267
0
}
15268
15269
} // namespace Document_Binding
15270
15271
15272
15273
} // namespace dom
15274
} // namespace mozilla