Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dom/bindings/HTMLIFrameElementBinding.cpp
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM HTMLIFrameElement.webidl BY Codegen.py - DO NOT EDIT */
2
3
#include "BrowserElementBinding.h"
4
#include "HTMLElementBinding.h"
5
#include "HTMLIFrameElementBinding.h"
6
#include "TouchEvent.h"
7
#include "WrapperFactory.h"
8
#include "mozilla/FloatingPoint.h"
9
#include "mozilla/OwningNonNull.h"
10
#include "mozilla/Preferences.h"
11
#include "mozilla/dom/BindingUtils.h"
12
#include "mozilla/dom/CustomElementRegistry.h"
13
#include "mozilla/dom/DOMJSClass.h"
14
#include "mozilla/dom/DOMRequest.h"
15
#include "mozilla/dom/DocGroup.h"
16
#include "mozilla/dom/HTMLIFrameElement.h"
17
#include "mozilla/dom/NonRefcountedDOMObject.h"
18
#include "mozilla/dom/Nullable.h"
19
#include "mozilla/dom/PrimitiveConversions.h"
20
#include "mozilla/dom/XULFrameElement.h"
21
#include "mozilla/dom/XrayExpandoClass.h"
22
#include "nsContentUtils.h"
23
#include "nsDOMTokenList.h"
24
#include "nsFrameLoader.h"
25
#include "nsIDocument.h"
26
#include "nsPIDOMWindow.h"
27
28
namespace mozilla {
29
namespace dom {
30
31
namespace binding_detail {}; // Just to make sure it's known as a namespace
32
using namespace mozilla::dom::binding_detail;
33
34
35
namespace HTMLIFrameElement_Binding {
36
37
static_assert(IsRefcounted<NativeType>::value == IsRefcounted<HTMLElement_Binding::NativeType>::value,
38
              "Can't inherit from an interface with a different ownership model.");
39
40
MOZ_CAN_RUN_SCRIPT static bool
41
get_src(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
42
0
{
43
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.src", DOM, cx);
44
0
45
0
  DOMString result;
46
0
  self->GetSrc(result);
47
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
48
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
49
0
    return false;
50
0
  }
51
0
  return true;
52
0
}
53
54
MOZ_CAN_RUN_SCRIPT static bool
55
set_src(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitSetterCallArgs args)
56
0
{
57
0
  AUTO_PROFILER_LABEL_FAST("set HTMLIFrameElement.src", DOM, cx);
58
0
59
0
  binding_detail::FakeString arg0;
60
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
61
0
    return false;
62
0
  }
63
0
  Maybe<AutoCEReaction> ceReaction;
64
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
65
0
    DocGroup* docGroup = self->GetDocGroup();
66
0
    if (docGroup) {
67
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
68
0
    }
69
0
  }
70
0
  FastErrorResult rv;
71
0
  nsIPrincipal* subjectPrincipal;
72
0
  {
73
0
    JS::Realm* realm = js::GetContextRealm(cx);
74
0
    MOZ_ASSERT(realm);
75
0
    JSPrincipals* principals = JS::GetRealmPrincipals(realm);
76
0
    nsIPrincipal* principal = nsJSPrincipals::get(principals);
77
0
    if (nsContentUtils::IsSystemPrincipal(principal)) {
78
0
      principal = nullptr;
79
0
    }
80
0
81
0
    subjectPrincipal = principal;
82
0
  }
83
0
  self->SetSrc(NonNullHelper(Constify(arg0)), subjectPrincipal, rv);
84
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
85
0
    return false;
86
0
  }
87
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
88
0
89
0
  return true;
90
0
}
91
92
static const JSJitInfo src_getterinfo = {
93
  { (JSJitGetterOp)get_src },
94
  { prototypes::id::HTMLIFrameElement },
95
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
96
  JSJitInfo::Getter,
97
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
98
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
99
  false,  /* isInfallible. False in setters. */
100
  true,  /* isMovable.  Not relevant for setters. */
101
  true, /* isEliminatable.  Not relevant for setters. */
102
  false, /* isAlwaysInSlot.  Only relevant for getters. */
103
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
104
  false,  /* isTypedMethod.  Only relevant for methods. */
105
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
106
};
107
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
108
static_assert(0 < 1, "There is no slot for us");
109
static const JSJitInfo src_setterinfo = {
110
  { (JSJitGetterOp)set_src },
111
  { prototypes::id::HTMLIFrameElement },
112
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
113
  JSJitInfo::Setter,
114
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
115
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
116
  false,  /* isInfallible. False in setters. */
117
  false,  /* isMovable.  Not relevant for setters. */
118
  false, /* isEliminatable.  Not relevant for setters. */
119
  false, /* isAlwaysInSlot.  Only relevant for getters. */
120
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
121
  false,  /* isTypedMethod.  Only relevant for methods. */
122
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
123
};
124
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
125
static_assert(0 < 1, "There is no slot for us");
126
127
MOZ_CAN_RUN_SCRIPT static bool
128
get_srcdoc(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
129
0
{
130
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.srcdoc", DOM, cx);
131
0
132
0
  DOMString result;
133
0
  self->GetSrcdoc(result);
134
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
135
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
136
0
    return false;
137
0
  }
138
0
  return true;
139
0
}
140
141
MOZ_CAN_RUN_SCRIPT static bool
142
set_srcdoc(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitSetterCallArgs args)
143
0
{
144
0
  AUTO_PROFILER_LABEL_FAST("set HTMLIFrameElement.srcdoc", DOM, cx);
145
0
146
0
  binding_detail::FakeString arg0;
147
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
148
0
    return false;
149
0
  }
150
0
  Maybe<AutoCEReaction> ceReaction;
151
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
152
0
    DocGroup* docGroup = self->GetDocGroup();
153
0
    if (docGroup) {
154
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
155
0
    }
156
0
  }
157
0
  FastErrorResult rv;
158
0
  self->SetSrcdoc(NonNullHelper(Constify(arg0)), rv);
159
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
160
0
    return false;
161
0
  }
162
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
163
0
164
0
  return true;
165
0
}
166
167
static const JSJitInfo srcdoc_getterinfo = {
168
  { (JSJitGetterOp)get_srcdoc },
169
  { prototypes::id::HTMLIFrameElement },
170
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
171
  JSJitInfo::Getter,
172
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
173
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
174
  false,  /* isInfallible. False in setters. */
175
  true,  /* isMovable.  Not relevant for setters. */
176
  true, /* isEliminatable.  Not relevant for setters. */
177
  false, /* isAlwaysInSlot.  Only relevant for getters. */
178
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
179
  false,  /* isTypedMethod.  Only relevant for methods. */
180
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
181
};
182
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
183
static_assert(0 < 1, "There is no slot for us");
184
static const JSJitInfo srcdoc_setterinfo = {
185
  { (JSJitGetterOp)set_srcdoc },
186
  { prototypes::id::HTMLIFrameElement },
187
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
188
  JSJitInfo::Setter,
189
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
190
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
191
  false,  /* isInfallible. False in setters. */
192
  false,  /* isMovable.  Not relevant for setters. */
193
  false, /* isEliminatable.  Not relevant for setters. */
194
  false, /* isAlwaysInSlot.  Only relevant for getters. */
195
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
196
  false,  /* isTypedMethod.  Only relevant for methods. */
197
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
198
};
199
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
200
static_assert(0 < 1, "There is no slot for us");
201
202
MOZ_CAN_RUN_SCRIPT static bool
203
get_name(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
204
0
{
205
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.name", DOM, cx);
206
0
207
0
  DOMString result;
208
0
  self->GetName(result);
209
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
210
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
211
0
    return false;
212
0
  }
213
0
  return true;
214
0
}
215
216
MOZ_CAN_RUN_SCRIPT static bool
217
set_name(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitSetterCallArgs args)
218
0
{
219
0
  AUTO_PROFILER_LABEL_FAST("set HTMLIFrameElement.name", DOM, cx);
220
0
221
0
  binding_detail::FakeString arg0;
222
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
223
0
    return false;
224
0
  }
225
0
  Maybe<AutoCEReaction> ceReaction;
226
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
227
0
    DocGroup* docGroup = self->GetDocGroup();
228
0
    if (docGroup) {
229
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
230
0
    }
231
0
  }
232
0
  FastErrorResult rv;
233
0
  self->SetName(NonNullHelper(Constify(arg0)), rv);
234
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
235
0
    return false;
236
0
  }
237
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
238
0
239
0
  return true;
240
0
}
241
242
static const JSJitInfo name_getterinfo = {
243
  { (JSJitGetterOp)get_name },
244
  { prototypes::id::HTMLIFrameElement },
245
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
246
  JSJitInfo::Getter,
247
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
248
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
249
  false,  /* isInfallible. False in setters. */
250
  true,  /* isMovable.  Not relevant for setters. */
251
  true, /* isEliminatable.  Not relevant for setters. */
252
  false, /* isAlwaysInSlot.  Only relevant for getters. */
253
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
254
  false,  /* isTypedMethod.  Only relevant for methods. */
255
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
256
};
257
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
258
static_assert(0 < 1, "There is no slot for us");
259
static const JSJitInfo name_setterinfo = {
260
  { (JSJitGetterOp)set_name },
261
  { prototypes::id::HTMLIFrameElement },
262
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
263
  JSJitInfo::Setter,
264
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
265
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
266
  false,  /* isInfallible. False in setters. */
267
  false,  /* isMovable.  Not relevant for setters. */
268
  false, /* isEliminatable.  Not relevant for setters. */
269
  false, /* isAlwaysInSlot.  Only relevant for getters. */
270
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
271
  false,  /* isTypedMethod.  Only relevant for methods. */
272
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
273
};
274
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
275
static_assert(0 < 1, "There is no slot for us");
276
277
MOZ_CAN_RUN_SCRIPT static bool
278
get_sandbox(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
279
0
{
280
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.sandbox", DOM, cx);
281
0
282
0
  auto result(StrongOrRawPtr<nsDOMTokenList>(self->Sandbox()));
283
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
284
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
285
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
286
0
    return false;
287
0
  }
288
0
  return true;
289
0
}
290
291
MOZ_CAN_RUN_SCRIPT static bool
292
set_sandbox(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitSetterCallArgs args)
293
0
{
294
0
  AUTO_PROFILER_LABEL_FAST("set HTMLIFrameElement.sandbox", DOM, cx);
295
0
296
0
  JS::Rooted<JS::Value> v(cx);
297
0
  if (!JS_GetProperty(cx, obj, "sandbox", &v)) {
298
0
    return false;
299
0
  }
300
0
301
0
  if (!v.isObject()) {
302
0
    return ThrowErrorMessage(cx, MSG_NOT_OBJECT, "HTMLIFrameElement.sandbox");
303
0
  }
304
0
305
0
  JS::Rooted<JSObject*> targetObj(cx, &v.toObject());
306
0
  return JS_SetProperty(cx, targetObj, "value", args[0]);
307
0
}
308
309
static const JSJitInfo sandbox_getterinfo = {
310
  { (JSJitGetterOp)get_sandbox },
311
  { prototypes::id::HTMLIFrameElement },
312
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
313
  JSJitInfo::Getter,
314
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
315
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
316
  false,  /* isInfallible. False in setters. */
317
  false,  /* isMovable.  Not relevant for setters. */
318
  false, /* isEliminatable.  Not relevant for setters. */
319
  false, /* isAlwaysInSlot.  Only relevant for getters. */
320
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
321
  false,  /* isTypedMethod.  Only relevant for methods. */
322
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
323
};
324
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
325
static_assert(0 < 1, "There is no slot for us");
326
static const JSJitInfo sandbox_setterinfo = {
327
  { (JSJitGetterOp)set_sandbox },
328
  { prototypes::id::HTMLIFrameElement },
329
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
330
  JSJitInfo::Setter,
331
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
332
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
333
  false,  /* isInfallible. False in setters. */
334
  false,  /* isMovable.  Not relevant for setters. */
335
  false, /* isEliminatable.  Not relevant for setters. */
336
  false, /* isAlwaysInSlot.  Only relevant for getters. */
337
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
338
  false,  /* isTypedMethod.  Only relevant for methods. */
339
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
340
};
341
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
342
static_assert(0 < 1, "There is no slot for us");
343
344
MOZ_CAN_RUN_SCRIPT static bool
345
get_allowFullscreen(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
346
0
{
347
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.allowFullscreen", DOM, cx);
348
0
349
0
  bool result(self->AllowFullscreen());
350
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
351
0
  args.rval().setBoolean(result);
352
0
  return true;
353
0
}
354
355
MOZ_CAN_RUN_SCRIPT static bool
356
set_allowFullscreen(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitSetterCallArgs args)
357
0
{
358
0
  AUTO_PROFILER_LABEL_FAST("set HTMLIFrameElement.allowFullscreen", DOM, cx);
359
0
360
0
  bool arg0;
361
0
  if (!ValueToPrimitive<bool, eDefault>(cx, args[0], &arg0)) {
362
0
    return false;
363
0
  }
364
0
  Maybe<AutoCEReaction> ceReaction;
365
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
366
0
    DocGroup* docGroup = self->GetDocGroup();
367
0
    if (docGroup) {
368
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
369
0
    }
370
0
  }
371
0
  FastErrorResult rv;
372
0
  self->SetAllowFullscreen(arg0, rv);
373
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
374
0
    return false;
375
0
  }
376
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
377
0
378
0
  return true;
379
0
}
380
381
static const JSJitInfo allowFullscreen_getterinfo = {
382
  { (JSJitGetterOp)get_allowFullscreen },
383
  { prototypes::id::HTMLIFrameElement },
384
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
385
  JSJitInfo::Getter,
386
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
387
  JSVAL_TYPE_BOOLEAN,  /* returnType.  Not relevant for setters. */
388
  true,  /* isInfallible. False in setters. */
389
  true,  /* isMovable.  Not relevant for setters. */
390
  true, /* isEliminatable.  Not relevant for setters. */
391
  false, /* isAlwaysInSlot.  Only relevant for getters. */
392
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
393
  false,  /* isTypedMethod.  Only relevant for methods. */
394
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
395
};
396
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
397
static_assert(0 < 1, "There is no slot for us");
398
static const JSJitInfo allowFullscreen_setterinfo = {
399
  { (JSJitGetterOp)set_allowFullscreen },
400
  { prototypes::id::HTMLIFrameElement },
401
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
402
  JSJitInfo::Setter,
403
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
404
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
405
  false,  /* isInfallible. False in setters. */
406
  false,  /* isMovable.  Not relevant for setters. */
407
  false, /* isEliminatable.  Not relevant for setters. */
408
  false, /* isAlwaysInSlot.  Only relevant for getters. */
409
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
410
  false,  /* isTypedMethod.  Only relevant for methods. */
411
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
412
};
413
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
414
static_assert(0 < 1, "There is no slot for us");
415
416
MOZ_CAN_RUN_SCRIPT static bool
417
get_allowPaymentRequest(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
418
0
{
419
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.allowPaymentRequest", DOM, cx);
420
0
421
0
  bool result(self->AllowPaymentRequest());
422
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
423
0
  args.rval().setBoolean(result);
424
0
  return true;
425
0
}
426
427
MOZ_CAN_RUN_SCRIPT static bool
428
set_allowPaymentRequest(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitSetterCallArgs args)
429
0
{
430
0
  AUTO_PROFILER_LABEL_FAST("set HTMLIFrameElement.allowPaymentRequest", DOM, cx);
431
0
432
0
  bool arg0;
433
0
  if (!ValueToPrimitive<bool, eDefault>(cx, args[0], &arg0)) {
434
0
    return false;
435
0
  }
436
0
  Maybe<AutoCEReaction> ceReaction;
437
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
438
0
    DocGroup* docGroup = self->GetDocGroup();
439
0
    if (docGroup) {
440
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
441
0
    }
442
0
  }
443
0
  FastErrorResult rv;
444
0
  self->SetAllowPaymentRequest(arg0, rv);
445
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
446
0
    return false;
447
0
  }
448
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
449
0
450
0
  return true;
451
0
}
452
453
static const JSJitInfo allowPaymentRequest_getterinfo = {
454
  { (JSJitGetterOp)get_allowPaymentRequest },
455
  { prototypes::id::HTMLIFrameElement },
456
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
457
  JSJitInfo::Getter,
458
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
459
  JSVAL_TYPE_BOOLEAN,  /* returnType.  Not relevant for setters. */
460
  true,  /* isInfallible. False in setters. */
461
  true,  /* isMovable.  Not relevant for setters. */
462
  true, /* isEliminatable.  Not relevant for setters. */
463
  false, /* isAlwaysInSlot.  Only relevant for getters. */
464
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
465
  false,  /* isTypedMethod.  Only relevant for methods. */
466
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
467
};
468
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
469
static_assert(0 < 1, "There is no slot for us");
470
static const JSJitInfo allowPaymentRequest_setterinfo = {
471
  { (JSJitGetterOp)set_allowPaymentRequest },
472
  { prototypes::id::HTMLIFrameElement },
473
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
474
  JSJitInfo::Setter,
475
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
476
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
477
  false,  /* isInfallible. False in setters. */
478
  false,  /* isMovable.  Not relevant for setters. */
479
  false, /* isEliminatable.  Not relevant for setters. */
480
  false, /* isAlwaysInSlot.  Only relevant for getters. */
481
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
482
  false,  /* isTypedMethod.  Only relevant for methods. */
483
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
484
};
485
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
486
static_assert(0 < 1, "There is no slot for us");
487
488
MOZ_CAN_RUN_SCRIPT static bool
489
get_width(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
490
0
{
491
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.width", DOM, cx);
492
0
493
0
  DOMString result;
494
0
  self->GetWidth(result);
495
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
496
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
497
0
    return false;
498
0
  }
499
0
  return true;
500
0
}
501
502
MOZ_CAN_RUN_SCRIPT static bool
503
set_width(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitSetterCallArgs args)
504
0
{
505
0
  AUTO_PROFILER_LABEL_FAST("set HTMLIFrameElement.width", DOM, cx);
506
0
507
0
  binding_detail::FakeString arg0;
508
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
509
0
    return false;
510
0
  }
511
0
  Maybe<AutoCEReaction> ceReaction;
512
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
513
0
    DocGroup* docGroup = self->GetDocGroup();
514
0
    if (docGroup) {
515
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
516
0
    }
517
0
  }
518
0
  FastErrorResult rv;
519
0
  self->SetWidth(NonNullHelper(Constify(arg0)), rv);
520
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
521
0
    return false;
522
0
  }
523
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
524
0
525
0
  return true;
526
0
}
527
528
static const JSJitInfo width_getterinfo = {
529
  { (JSJitGetterOp)get_width },
530
  { prototypes::id::HTMLIFrameElement },
531
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
532
  JSJitInfo::Getter,
533
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
534
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
535
  false,  /* isInfallible. False in setters. */
536
  true,  /* isMovable.  Not relevant for setters. */
537
  true, /* isEliminatable.  Not relevant for setters. */
538
  false, /* isAlwaysInSlot.  Only relevant for getters. */
539
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
540
  false,  /* isTypedMethod.  Only relevant for methods. */
541
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
542
};
543
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
544
static_assert(0 < 1, "There is no slot for us");
545
static const JSJitInfo width_setterinfo = {
546
  { (JSJitGetterOp)set_width },
547
  { prototypes::id::HTMLIFrameElement },
548
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
549
  JSJitInfo::Setter,
550
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
551
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
552
  false,  /* isInfallible. False in setters. */
553
  false,  /* isMovable.  Not relevant for setters. */
554
  false, /* isEliminatable.  Not relevant for setters. */
555
  false, /* isAlwaysInSlot.  Only relevant for getters. */
556
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
557
  false,  /* isTypedMethod.  Only relevant for methods. */
558
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
559
};
560
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
561
static_assert(0 < 1, "There is no slot for us");
562
563
MOZ_CAN_RUN_SCRIPT static bool
564
get_height(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
565
0
{
566
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.height", DOM, cx);
567
0
568
0
  DOMString result;
569
0
  self->GetHeight(result);
570
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
571
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
572
0
    return false;
573
0
  }
574
0
  return true;
575
0
}
576
577
MOZ_CAN_RUN_SCRIPT static bool
578
set_height(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitSetterCallArgs args)
579
0
{
580
0
  AUTO_PROFILER_LABEL_FAST("set HTMLIFrameElement.height", DOM, cx);
581
0
582
0
  binding_detail::FakeString arg0;
583
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
584
0
    return false;
585
0
  }
586
0
  Maybe<AutoCEReaction> ceReaction;
587
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
588
0
    DocGroup* docGroup = self->GetDocGroup();
589
0
    if (docGroup) {
590
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
591
0
    }
592
0
  }
593
0
  FastErrorResult rv;
594
0
  self->SetHeight(NonNullHelper(Constify(arg0)), rv);
595
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
596
0
    return false;
597
0
  }
598
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
599
0
600
0
  return true;
601
0
}
602
603
static const JSJitInfo height_getterinfo = {
604
  { (JSJitGetterOp)get_height },
605
  { prototypes::id::HTMLIFrameElement },
606
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
607
  JSJitInfo::Getter,
608
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
609
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
610
  false,  /* isInfallible. False in setters. */
611
  true,  /* isMovable.  Not relevant for setters. */
612
  true, /* isEliminatable.  Not relevant for setters. */
613
  false, /* isAlwaysInSlot.  Only relevant for getters. */
614
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
615
  false,  /* isTypedMethod.  Only relevant for methods. */
616
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
617
};
618
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
619
static_assert(0 < 1, "There is no slot for us");
620
static const JSJitInfo height_setterinfo = {
621
  { (JSJitGetterOp)set_height },
622
  { prototypes::id::HTMLIFrameElement },
623
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
624
  JSJitInfo::Setter,
625
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
626
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
627
  false,  /* isInfallible. False in setters. */
628
  false,  /* isMovable.  Not relevant for setters. */
629
  false, /* isEliminatable.  Not relevant for setters. */
630
  false, /* isAlwaysInSlot.  Only relevant for getters. */
631
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
632
  false,  /* isTypedMethod.  Only relevant for methods. */
633
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
634
};
635
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
636
static_assert(0 < 1, "There is no slot for us");
637
638
MOZ_CAN_RUN_SCRIPT static bool
639
get_referrerPolicy(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
640
0
{
641
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.referrerPolicy", DOM, cx);
642
0
643
0
  DOMString result;
644
0
  self->GetReferrerPolicy(result);
645
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
646
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
647
0
    return false;
648
0
  }
649
0
  return true;
650
0
}
651
652
MOZ_CAN_RUN_SCRIPT static bool
653
set_referrerPolicy(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitSetterCallArgs args)
654
0
{
655
0
  AUTO_PROFILER_LABEL_FAST("set HTMLIFrameElement.referrerPolicy", DOM, cx);
656
0
657
0
  binding_detail::FakeString arg0;
658
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
659
0
    return false;
660
0
  }
661
0
  Maybe<AutoCEReaction> ceReaction;
662
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
663
0
    DocGroup* docGroup = self->GetDocGroup();
664
0
    if (docGroup) {
665
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
666
0
    }
667
0
  }
668
0
  FastErrorResult rv;
669
0
  self->SetReferrerPolicy(NonNullHelper(Constify(arg0)), rv);
670
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
671
0
    return false;
672
0
  }
673
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
674
0
675
0
  return true;
676
0
}
677
678
static const JSJitInfo referrerPolicy_getterinfo = {
679
  { (JSJitGetterOp)get_referrerPolicy },
680
  { prototypes::id::HTMLIFrameElement },
681
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
682
  JSJitInfo::Getter,
683
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
684
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
685
  false,  /* isInfallible. False in setters. */
686
  true,  /* isMovable.  Not relevant for setters. */
687
  true, /* isEliminatable.  Not relevant for setters. */
688
  false, /* isAlwaysInSlot.  Only relevant for getters. */
689
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
690
  false,  /* isTypedMethod.  Only relevant for methods. */
691
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
692
};
693
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
694
static_assert(0 < 1, "There is no slot for us");
695
static const JSJitInfo referrerPolicy_setterinfo = {
696
  { (JSJitGetterOp)set_referrerPolicy },
697
  { prototypes::id::HTMLIFrameElement },
698
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
699
  JSJitInfo::Setter,
700
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
701
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
702
  false,  /* isInfallible. False in setters. */
703
  false,  /* isMovable.  Not relevant for setters. */
704
  false, /* isEliminatable.  Not relevant for setters. */
705
  false, /* isAlwaysInSlot.  Only relevant for getters. */
706
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
707
  false,  /* isTypedMethod.  Only relevant for methods. */
708
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
709
};
710
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
711
static_assert(0 < 1, "There is no slot for us");
712
713
MOZ_CAN_RUN_SCRIPT static bool
714
get_contentDocument(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
715
0
{
716
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.contentDocument", DOM, cx);
717
0
718
0
  NonNull<nsIPrincipal> subjectPrincipal;
719
0
  {
720
0
    JS::Realm* realm = js::GetContextRealm(cx);
721
0
    MOZ_ASSERT(realm);
722
0
    JSPrincipals* principals = JS::GetRealmPrincipals(realm);
723
0
    nsIPrincipal* principal = nsJSPrincipals::get(principals);
724
0
725
0
    subjectPrincipal = principal;
726
0
  }
727
0
  auto result(StrongOrRawPtr<nsIDocument>(self->GetContentDocument(subjectPrincipal)));
728
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
729
0
  if (!result) {
730
0
    args.rval().setNull();
731
0
    return true;
732
0
  }
733
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
734
0
    MOZ_CRASH("Looks like bug 1488480/1405521, with getting the reflector failing");
735
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
736
0
    return false;
737
0
  }
738
0
  return true;
739
0
}
740
741
static const JSJitInfo contentDocument_getterinfo = {
742
  { (JSJitGetterOp)get_contentDocument },
743
  { prototypes::id::HTMLIFrameElement },
744
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
745
  JSJitInfo::Getter,
746
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
747
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
748
  false,  /* isInfallible. False in setters. */
749
  false,  /* isMovable.  Not relevant for setters. */
750
  false, /* isEliminatable.  Not relevant for setters. */
751
  false, /* isAlwaysInSlot.  Only relevant for getters. */
752
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
753
  false,  /* isTypedMethod.  Only relevant for methods. */
754
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
755
};
756
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
757
static_assert(0 < 1, "There is no slot for us");
758
759
MOZ_CAN_RUN_SCRIPT static bool
760
get_contentWindow(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
761
0
{
762
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.contentWindow", DOM, cx);
763
0
764
0
  auto result(StrongOrRawPtr<nsPIDOMWindowOuter>(self->GetContentWindow()));
765
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
766
0
  if (!result) {
767
0
    args.rval().setNull();
768
0
    return true;
769
0
  }
770
0
  if (!WrapObject(cx, result, args.rval())) {
771
0
    return false;
772
0
  }
773
0
  return true;
774
0
}
775
776
static const JSJitInfo contentWindow_getterinfo = {
777
  { (JSJitGetterOp)get_contentWindow },
778
  { prototypes::id::HTMLIFrameElement },
779
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
780
  JSJitInfo::Getter,
781
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
782
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
783
  false,  /* isInfallible. False in setters. */
784
  false,  /* isMovable.  Not relevant for setters. */
785
  false, /* isEliminatable.  Not relevant for setters. */
786
  false, /* isAlwaysInSlot.  Only relevant for getters. */
787
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
788
  false,  /* isTypedMethod.  Only relevant for methods. */
789
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
790
};
791
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
792
static_assert(0 < 1, "There is no slot for us");
793
794
MOZ_CAN_RUN_SCRIPT static bool
795
get_align(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
796
0
{
797
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.align", DOM, cx);
798
0
799
0
  DOMString result;
800
0
  self->GetAlign(result);
801
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
802
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
803
0
    return false;
804
0
  }
805
0
  return true;
806
0
}
807
808
MOZ_CAN_RUN_SCRIPT static bool
809
set_align(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitSetterCallArgs args)
810
0
{
811
0
  AUTO_PROFILER_LABEL_FAST("set HTMLIFrameElement.align", DOM, cx);
812
0
813
0
  binding_detail::FakeString arg0;
814
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
815
0
    return false;
816
0
  }
817
0
  Maybe<AutoCEReaction> ceReaction;
818
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
819
0
    DocGroup* docGroup = self->GetDocGroup();
820
0
    if (docGroup) {
821
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
822
0
    }
823
0
  }
824
0
  FastErrorResult rv;
825
0
  self->SetAlign(NonNullHelper(Constify(arg0)), rv);
826
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
827
0
    return false;
828
0
  }
829
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
830
0
831
0
  return true;
832
0
}
833
834
static const JSJitInfo align_getterinfo = {
835
  { (JSJitGetterOp)get_align },
836
  { prototypes::id::HTMLIFrameElement },
837
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
838
  JSJitInfo::Getter,
839
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
840
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
841
  false,  /* isInfallible. False in setters. */
842
  true,  /* isMovable.  Not relevant for setters. */
843
  true, /* isEliminatable.  Not relevant for setters. */
844
  false, /* isAlwaysInSlot.  Only relevant for getters. */
845
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
846
  false,  /* isTypedMethod.  Only relevant for methods. */
847
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
848
};
849
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
850
static_assert(0 < 1, "There is no slot for us");
851
static const JSJitInfo align_setterinfo = {
852
  { (JSJitGetterOp)set_align },
853
  { prototypes::id::HTMLIFrameElement },
854
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
855
  JSJitInfo::Setter,
856
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
857
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
858
  false,  /* isInfallible. False in setters. */
859
  false,  /* isMovable.  Not relevant for setters. */
860
  false, /* isEliminatable.  Not relevant for setters. */
861
  false, /* isAlwaysInSlot.  Only relevant for getters. */
862
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
863
  false,  /* isTypedMethod.  Only relevant for methods. */
864
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
865
};
866
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
867
static_assert(0 < 1, "There is no slot for us");
868
869
MOZ_CAN_RUN_SCRIPT static bool
870
get_scrolling(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
871
0
{
872
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.scrolling", DOM, cx);
873
0
874
0
  DOMString result;
875
0
  self->GetScrolling(result);
876
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
877
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
878
0
    return false;
879
0
  }
880
0
  return true;
881
0
}
882
883
MOZ_CAN_RUN_SCRIPT static bool
884
set_scrolling(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitSetterCallArgs args)
885
0
{
886
0
  AUTO_PROFILER_LABEL_FAST("set HTMLIFrameElement.scrolling", DOM, cx);
887
0
888
0
  binding_detail::FakeString arg0;
889
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
890
0
    return false;
891
0
  }
892
0
  Maybe<AutoCEReaction> ceReaction;
893
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
894
0
    DocGroup* docGroup = self->GetDocGroup();
895
0
    if (docGroup) {
896
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
897
0
    }
898
0
  }
899
0
  FastErrorResult rv;
900
0
  self->SetScrolling(NonNullHelper(Constify(arg0)), rv);
901
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
902
0
    return false;
903
0
  }
904
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
905
0
906
0
  return true;
907
0
}
908
909
static const JSJitInfo scrolling_getterinfo = {
910
  { (JSJitGetterOp)get_scrolling },
911
  { prototypes::id::HTMLIFrameElement },
912
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
913
  JSJitInfo::Getter,
914
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
915
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
916
  false,  /* isInfallible. False in setters. */
917
  true,  /* isMovable.  Not relevant for setters. */
918
  true, /* isEliminatable.  Not relevant for setters. */
919
  false, /* isAlwaysInSlot.  Only relevant for getters. */
920
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
921
  false,  /* isTypedMethod.  Only relevant for methods. */
922
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
923
};
924
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
925
static_assert(0 < 1, "There is no slot for us");
926
static const JSJitInfo scrolling_setterinfo = {
927
  { (JSJitGetterOp)set_scrolling },
928
  { prototypes::id::HTMLIFrameElement },
929
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
930
  JSJitInfo::Setter,
931
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
932
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
933
  false,  /* isInfallible. False in setters. */
934
  false,  /* isMovable.  Not relevant for setters. */
935
  false, /* isEliminatable.  Not relevant for setters. */
936
  false, /* isAlwaysInSlot.  Only relevant for getters. */
937
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
938
  false,  /* isTypedMethod.  Only relevant for methods. */
939
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
940
};
941
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
942
static_assert(0 < 1, "There is no slot for us");
943
944
MOZ_CAN_RUN_SCRIPT static bool
945
get_frameBorder(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
946
0
{
947
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.frameBorder", DOM, cx);
948
0
949
0
  DOMString result;
950
0
  self->GetFrameBorder(result);
951
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
952
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
953
0
    return false;
954
0
  }
955
0
  return true;
956
0
}
957
958
MOZ_CAN_RUN_SCRIPT static bool
959
set_frameBorder(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitSetterCallArgs args)
960
0
{
961
0
  AUTO_PROFILER_LABEL_FAST("set HTMLIFrameElement.frameBorder", DOM, cx);
962
0
963
0
  binding_detail::FakeString arg0;
964
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
965
0
    return false;
966
0
  }
967
0
  Maybe<AutoCEReaction> ceReaction;
968
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
969
0
    DocGroup* docGroup = self->GetDocGroup();
970
0
    if (docGroup) {
971
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
972
0
    }
973
0
  }
974
0
  FastErrorResult rv;
975
0
  self->SetFrameBorder(NonNullHelper(Constify(arg0)), rv);
976
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
977
0
    return false;
978
0
  }
979
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
980
0
981
0
  return true;
982
0
}
983
984
static const JSJitInfo frameBorder_getterinfo = {
985
  { (JSJitGetterOp)get_frameBorder },
986
  { prototypes::id::HTMLIFrameElement },
987
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
988
  JSJitInfo::Getter,
989
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
990
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
991
  false,  /* isInfallible. False in setters. */
992
  true,  /* isMovable.  Not relevant for setters. */
993
  true, /* isEliminatable.  Not relevant for setters. */
994
  false, /* isAlwaysInSlot.  Only relevant for getters. */
995
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
996
  false,  /* isTypedMethod.  Only relevant for methods. */
997
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
998
};
999
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1000
static_assert(0 < 1, "There is no slot for us");
1001
static const JSJitInfo frameBorder_setterinfo = {
1002
  { (JSJitGetterOp)set_frameBorder },
1003
  { prototypes::id::HTMLIFrameElement },
1004
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
1005
  JSJitInfo::Setter,
1006
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1007
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1008
  false,  /* isInfallible. False in setters. */
1009
  false,  /* isMovable.  Not relevant for setters. */
1010
  false, /* isEliminatable.  Not relevant for setters. */
1011
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1012
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1013
  false,  /* isTypedMethod.  Only relevant for methods. */
1014
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1015
};
1016
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1017
static_assert(0 < 1, "There is no slot for us");
1018
1019
MOZ_CAN_RUN_SCRIPT static bool
1020
get_longDesc(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
1021
0
{
1022
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.longDesc", DOM, cx);
1023
0
1024
0
  DOMString result;
1025
0
  self->GetLongDesc(result);
1026
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1027
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
1028
0
    return false;
1029
0
  }
1030
0
  return true;
1031
0
}
1032
1033
MOZ_CAN_RUN_SCRIPT static bool
1034
set_longDesc(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitSetterCallArgs args)
1035
0
{
1036
0
  AUTO_PROFILER_LABEL_FAST("set HTMLIFrameElement.longDesc", DOM, cx);
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
  Maybe<AutoCEReaction> ceReaction;
1043
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
1044
0
    DocGroup* docGroup = self->GetDocGroup();
1045
0
    if (docGroup) {
1046
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
1047
0
    }
1048
0
  }
1049
0
  FastErrorResult rv;
1050
0
  self->SetLongDesc(NonNullHelper(Constify(arg0)), rv);
1051
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1052
0
    return false;
1053
0
  }
1054
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1055
0
1056
0
  return true;
1057
0
}
1058
1059
static const JSJitInfo longDesc_getterinfo = {
1060
  { (JSJitGetterOp)get_longDesc },
1061
  { prototypes::id::HTMLIFrameElement },
1062
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
1063
  JSJitInfo::Getter,
1064
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
1065
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
1066
  false,  /* isInfallible. False in setters. */
1067
  true,  /* isMovable.  Not relevant for setters. */
1068
  true, /* isEliminatable.  Not relevant for setters. */
1069
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1070
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1071
  false,  /* isTypedMethod.  Only relevant for methods. */
1072
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1073
};
1074
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1075
static_assert(0 < 1, "There is no slot for us");
1076
static const JSJitInfo longDesc_setterinfo = {
1077
  { (JSJitGetterOp)set_longDesc },
1078
  { prototypes::id::HTMLIFrameElement },
1079
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
1080
  JSJitInfo::Setter,
1081
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1082
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1083
  false,  /* isInfallible. False in setters. */
1084
  false,  /* isMovable.  Not relevant for setters. */
1085
  false, /* isEliminatable.  Not relevant for setters. */
1086
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1087
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1088
  false,  /* isTypedMethod.  Only relevant for methods. */
1089
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1090
};
1091
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1092
static_assert(0 < 1, "There is no slot for us");
1093
1094
MOZ_CAN_RUN_SCRIPT static bool
1095
get_marginHeight(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
1096
0
{
1097
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.marginHeight", DOM, cx);
1098
0
1099
0
  DOMString result;
1100
0
  self->GetMarginHeight(result);
1101
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1102
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
1103
0
    return false;
1104
0
  }
1105
0
  return true;
1106
0
}
1107
1108
MOZ_CAN_RUN_SCRIPT static bool
1109
set_marginHeight(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitSetterCallArgs args)
1110
0
{
1111
0
  AUTO_PROFILER_LABEL_FAST("set HTMLIFrameElement.marginHeight", DOM, cx);
1112
0
1113
0
  binding_detail::FakeString arg0;
1114
0
  if (!ConvertJSValueToString(cx, args[0], eEmpty, eStringify, arg0)) {
1115
0
    return false;
1116
0
  }
1117
0
  Maybe<AutoCEReaction> ceReaction;
1118
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
1119
0
    DocGroup* docGroup = self->GetDocGroup();
1120
0
    if (docGroup) {
1121
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
1122
0
    }
1123
0
  }
1124
0
  FastErrorResult rv;
1125
0
  self->SetMarginHeight(NonNullHelper(Constify(arg0)), rv);
1126
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1127
0
    return false;
1128
0
  }
1129
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1130
0
1131
0
  return true;
1132
0
}
1133
1134
static const JSJitInfo marginHeight_getterinfo = {
1135
  { (JSJitGetterOp)get_marginHeight },
1136
  { prototypes::id::HTMLIFrameElement },
1137
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
1138
  JSJitInfo::Getter,
1139
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
1140
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
1141
  false,  /* isInfallible. False in setters. */
1142
  true,  /* isMovable.  Not relevant for setters. */
1143
  true, /* isEliminatable.  Not relevant for setters. */
1144
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1145
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1146
  false,  /* isTypedMethod.  Only relevant for methods. */
1147
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1148
};
1149
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1150
static_assert(0 < 1, "There is no slot for us");
1151
static const JSJitInfo marginHeight_setterinfo = {
1152
  { (JSJitGetterOp)set_marginHeight },
1153
  { prototypes::id::HTMLIFrameElement },
1154
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
1155
  JSJitInfo::Setter,
1156
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1157
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1158
  false,  /* isInfallible. False in setters. */
1159
  false,  /* isMovable.  Not relevant for setters. */
1160
  false, /* isEliminatable.  Not relevant for setters. */
1161
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1162
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1163
  false,  /* isTypedMethod.  Only relevant for methods. */
1164
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1165
};
1166
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1167
static_assert(0 < 1, "There is no slot for us");
1168
1169
MOZ_CAN_RUN_SCRIPT static bool
1170
get_marginWidth(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
1171
0
{
1172
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.marginWidth", DOM, cx);
1173
0
1174
0
  DOMString result;
1175
0
  self->GetMarginWidth(result);
1176
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1177
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
1178
0
    return false;
1179
0
  }
1180
0
  return true;
1181
0
}
1182
1183
MOZ_CAN_RUN_SCRIPT static bool
1184
set_marginWidth(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitSetterCallArgs args)
1185
0
{
1186
0
  AUTO_PROFILER_LABEL_FAST("set HTMLIFrameElement.marginWidth", DOM, cx);
1187
0
1188
0
  binding_detail::FakeString arg0;
1189
0
  if (!ConvertJSValueToString(cx, args[0], eEmpty, eStringify, arg0)) {
1190
0
    return false;
1191
0
  }
1192
0
  Maybe<AutoCEReaction> ceReaction;
1193
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
1194
0
    DocGroup* docGroup = self->GetDocGroup();
1195
0
    if (docGroup) {
1196
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
1197
0
    }
1198
0
  }
1199
0
  FastErrorResult rv;
1200
0
  self->SetMarginWidth(NonNullHelper(Constify(arg0)), rv);
1201
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1202
0
    return false;
1203
0
  }
1204
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1205
0
1206
0
  return true;
1207
0
}
1208
1209
static const JSJitInfo marginWidth_getterinfo = {
1210
  { (JSJitGetterOp)get_marginWidth },
1211
  { prototypes::id::HTMLIFrameElement },
1212
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
1213
  JSJitInfo::Getter,
1214
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
1215
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
1216
  false,  /* isInfallible. False in setters. */
1217
  true,  /* isMovable.  Not relevant for setters. */
1218
  true, /* isEliminatable.  Not relevant for setters. */
1219
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1220
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1221
  false,  /* isTypedMethod.  Only relevant for methods. */
1222
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1223
};
1224
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1225
static_assert(0 < 1, "There is no slot for us");
1226
static const JSJitInfo marginWidth_setterinfo = {
1227
  { (JSJitGetterOp)set_marginWidth },
1228
  { prototypes::id::HTMLIFrameElement },
1229
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
1230
  JSJitInfo::Setter,
1231
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1232
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1233
  false,  /* isInfallible. False in setters. */
1234
  false,  /* isMovable.  Not relevant for setters. */
1235
  false, /* isEliminatable.  Not relevant for setters. */
1236
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1237
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1238
  false,  /* isTypedMethod.  Only relevant for methods. */
1239
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1240
};
1241
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1242
static_assert(0 < 1, "There is no slot for us");
1243
1244
MOZ_CAN_RUN_SCRIPT static bool
1245
getSVGDocument(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
1246
0
{
1247
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.getSVGDocument", DOM, cx);
1248
0
1249
0
  NonNull<nsIPrincipal> subjectPrincipal;
1250
0
  {
1251
0
    JS::Realm* realm = js::GetContextRealm(cx);
1252
0
    MOZ_ASSERT(realm);
1253
0
    JSPrincipals* principals = JS::GetRealmPrincipals(realm);
1254
0
    nsIPrincipal* principal = nsJSPrincipals::get(principals);
1255
0
1256
0
    subjectPrincipal = principal;
1257
0
  }
1258
0
  auto result(StrongOrRawPtr<nsIDocument>(self->GetSVGDocument(subjectPrincipal)));
1259
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1260
0
  if (!result) {
1261
0
    args.rval().setNull();
1262
0
    return true;
1263
0
  }
1264
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1265
0
    MOZ_CRASH("Looks like bug 1488480/1405521, with getting the reflector failing");
1266
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1267
0
    return false;
1268
0
  }
1269
0
  return true;
1270
0
}
1271
1272
static const JSJitInfo getSVGDocument_methodinfo = {
1273
  { (JSJitGetterOp)getSVGDocument },
1274
  { prototypes::id::HTMLIFrameElement },
1275
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
1276
  JSJitInfo::Method,
1277
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1278
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
1279
  false,  /* isInfallible. False in setters. */
1280
  false,  /* isMovable.  Not relevant for setters. */
1281
  false, /* isEliminatable.  Not relevant for setters. */
1282
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1283
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1284
  false,  /* isTypedMethod.  Only relevant for methods. */
1285
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1286
};
1287
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1288
static_assert(0 < 1, "There is no slot for us");
1289
1290
MOZ_CAN_RUN_SCRIPT static bool
1291
get_mozbrowser(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
1292
0
{
1293
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.mozbrowser", DOM, cx);
1294
0
1295
0
  bool result(self->Mozbrowser());
1296
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1297
0
  args.rval().setBoolean(result);
1298
0
  return true;
1299
0
}
1300
1301
MOZ_CAN_RUN_SCRIPT static bool
1302
set_mozbrowser(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitSetterCallArgs args)
1303
0
{
1304
0
  AUTO_PROFILER_LABEL_FAST("set HTMLIFrameElement.mozbrowser", DOM, cx);
1305
0
1306
0
  bool arg0;
1307
0
  if (!ValueToPrimitive<bool, eDefault>(cx, args[0], &arg0)) {
1308
0
    return false;
1309
0
  }
1310
0
  FastErrorResult rv;
1311
0
  self->SetMozbrowser(arg0, rv);
1312
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1313
0
    return false;
1314
0
  }
1315
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1316
0
1317
0
  return true;
1318
0
}
1319
1320
static const JSJitInfo mozbrowser_getterinfo = {
1321
  { (JSJitGetterOp)get_mozbrowser },
1322
  { prototypes::id::HTMLIFrameElement },
1323
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
1324
  JSJitInfo::Getter,
1325
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1326
  JSVAL_TYPE_BOOLEAN,  /* returnType.  Not relevant for setters. */
1327
  true,  /* isInfallible. False in setters. */
1328
  false,  /* isMovable.  Not relevant for setters. */
1329
  false, /* isEliminatable.  Not relevant for setters. */
1330
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1331
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1332
  false,  /* isTypedMethod.  Only relevant for methods. */
1333
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1334
};
1335
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1336
static_assert(0 < 1, "There is no slot for us");
1337
static const JSJitInfo mozbrowser_setterinfo = {
1338
  { (JSJitGetterOp)set_mozbrowser },
1339
  { prototypes::id::HTMLIFrameElement },
1340
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
1341
  JSJitInfo::Setter,
1342
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1343
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1344
  false,  /* isInfallible. False in setters. */
1345
  false,  /* isMovable.  Not relevant for setters. */
1346
  false, /* isEliminatable.  Not relevant for setters. */
1347
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1348
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1349
  false,  /* isTypedMethod.  Only relevant for methods. */
1350
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1351
};
1352
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1353
static_assert(0 < 1, "There is no slot for us");
1354
1355
MOZ_CAN_RUN_SCRIPT static bool
1356
addNextPaintListener(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
1357
0
{
1358
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.addNextPaintListener", DOM, cx);
1359
0
1360
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1361
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "HTMLIFrameElement.addNextPaintListener");
1362
0
  }
1363
0
  RootedCallback<OwningNonNull<binding_detail::FastBrowserElementNextPaintEventCallback>> arg0(cx);
1364
0
  if (args[0].isObject()) {
1365
0
    if (JS::IsCallable(&args[0].toObject())) {
1366
0
    { // scope for tempRoot and tempGlobalRoot if needed
1367
0
      arg0 = new binding_detail::FastBrowserElementNextPaintEventCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
1368
0
    }
1369
0
    } else {
1370
0
      ThrowErrorMessage(cx, MSG_NOT_CALLABLE, "Argument 1 of HTMLIFrameElement.addNextPaintListener");
1371
0
      return false;
1372
0
    }
1373
0
  } else {
1374
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of HTMLIFrameElement.addNextPaintListener");
1375
0
    return false;
1376
0
  }
1377
0
  FastErrorResult rv;
1378
0
  self->AddNextPaintListener(NonNullHelper(arg0), rv);
1379
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1380
0
    return false;
1381
0
  }
1382
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1383
0
  args.rval().setUndefined();
1384
0
  return true;
1385
0
}
1386
1387
static const JSJitInfo addNextPaintListener_methodinfo = {
1388
  { (JSJitGetterOp)addNextPaintListener },
1389
  { prototypes::id::HTMLIFrameElement },
1390
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
1391
  JSJitInfo::Method,
1392
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1393
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1394
  false,  /* isInfallible. False in setters. */
1395
  false,  /* isMovable.  Not relevant for setters. */
1396
  false, /* isEliminatable.  Not relevant for setters. */
1397
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1398
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1399
  false,  /* isTypedMethod.  Only relevant for methods. */
1400
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1401
};
1402
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1403
static_assert(0 < 1, "There is no slot for us");
1404
1405
MOZ_CAN_RUN_SCRIPT static bool
1406
removeNextPaintListener(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
1407
0
{
1408
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.removeNextPaintListener", DOM, cx);
1409
0
1410
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1411
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "HTMLIFrameElement.removeNextPaintListener");
1412
0
  }
1413
0
  RootedCallback<OwningNonNull<binding_detail::FastBrowserElementNextPaintEventCallback>> arg0(cx);
1414
0
  if (args[0].isObject()) {
1415
0
    if (JS::IsCallable(&args[0].toObject())) {
1416
0
    { // scope for tempRoot and tempGlobalRoot if needed
1417
0
      arg0 = new binding_detail::FastBrowserElementNextPaintEventCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
1418
0
    }
1419
0
    } else {
1420
0
      ThrowErrorMessage(cx, MSG_NOT_CALLABLE, "Argument 1 of HTMLIFrameElement.removeNextPaintListener");
1421
0
      return false;
1422
0
    }
1423
0
  } else {
1424
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of HTMLIFrameElement.removeNextPaintListener");
1425
0
    return false;
1426
0
  }
1427
0
  FastErrorResult rv;
1428
0
  self->RemoveNextPaintListener(NonNullHelper(arg0), rv);
1429
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1430
0
    return false;
1431
0
  }
1432
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1433
0
  args.rval().setUndefined();
1434
0
  return true;
1435
0
}
1436
1437
static const JSJitInfo removeNextPaintListener_methodinfo = {
1438
  { (JSJitGetterOp)removeNextPaintListener },
1439
  { prototypes::id::HTMLIFrameElement },
1440
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
1441
  JSJitInfo::Method,
1442
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1443
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1444
  false,  /* isInfallible. False in setters. */
1445
  false,  /* isMovable.  Not relevant for setters. */
1446
  false, /* isEliminatable.  Not relevant for setters. */
1447
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1448
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1449
  false,  /* isTypedMethod.  Only relevant for methods. */
1450
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1451
};
1452
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1453
static_assert(0 < 1, "There is no slot for us");
1454
1455
MOZ_CAN_RUN_SCRIPT static bool
1456
sendMouseEvent(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
1457
0
{
1458
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.sendMouseEvent", DOM, cx);
1459
0
1460
0
  if (MOZ_UNLIKELY(args.length() < 6)) {
1461
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "HTMLIFrameElement.sendMouseEvent");
1462
0
  }
1463
0
  binding_detail::FakeString arg0;
1464
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1465
0
    return false;
1466
0
  }
1467
0
  uint32_t arg1;
1468
0
  if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], &arg1)) {
1469
0
    return false;
1470
0
  }
1471
0
  uint32_t arg2;
1472
0
  if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[2], &arg2)) {
1473
0
    return false;
1474
0
  }
1475
0
  uint32_t arg3;
1476
0
  if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[3], &arg3)) {
1477
0
    return false;
1478
0
  }
1479
0
  uint32_t arg4;
1480
0
  if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[4], &arg4)) {
1481
0
    return false;
1482
0
  }
1483
0
  uint32_t arg5;
1484
0
  if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[5], &arg5)) {
1485
0
    return false;
1486
0
  }
1487
0
  FastErrorResult rv;
1488
0
  self->SendMouseEvent(NonNullHelper(Constify(arg0)), arg1, arg2, arg3, arg4, arg5, rv);
1489
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1490
0
    return false;
1491
0
  }
1492
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1493
0
  args.rval().setUndefined();
1494
0
  return true;
1495
0
}
1496
1497
static const JSJitInfo sendMouseEvent_methodinfo = {
1498
  { (JSJitGetterOp)sendMouseEvent },
1499
  { prototypes::id::HTMLIFrameElement },
1500
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
1501
  JSJitInfo::Method,
1502
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1503
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1504
  false,  /* isInfallible. False in setters. */
1505
  false,  /* isMovable.  Not relevant for setters. */
1506
  false, /* isEliminatable.  Not relevant for setters. */
1507
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1508
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1509
  false,  /* isTypedMethod.  Only relevant for methods. */
1510
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1511
};
1512
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1513
static_assert(0 < 1, "There is no slot for us");
1514
1515
MOZ_CAN_RUN_SCRIPT static bool
1516
sendTouchEvent(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
1517
0
{
1518
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.sendTouchEvent", DOM, cx);
1519
0
1520
0
  if (MOZ_UNLIKELY(args.length() < 10)) {
1521
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "HTMLIFrameElement.sendTouchEvent");
1522
0
  }
1523
0
  binding_detail::FakeString arg0;
1524
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1525
0
    return false;
1526
0
  }
1527
0
  binding_detail::AutoSequence<uint32_t> arg1;
1528
0
  if (args[1].isObject()) {
1529
0
    JS::ForOfIterator iter(cx);
1530
0
    if (!iter.init(args[1], JS::ForOfIterator::AllowNonIterable)) {
1531
0
      return false;
1532
0
    }
1533
0
    if (!iter.valueIsIterable()) {
1534
0
      ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 2 of HTMLIFrameElement.sendTouchEvent");
1535
0
      return false;
1536
0
    }
1537
0
    binding_detail::AutoSequence<uint32_t> &arr = arg1;
1538
0
    JS::Rooted<JS::Value> temp(cx);
1539
0
    while (true) {
1540
0
      bool done;
1541
0
      if (!iter.next(&temp, &done)) {
1542
0
        return false;
1543
0
      }
1544
0
      if (done) {
1545
0
        break;
1546
0
      }
1547
0
      uint32_t* slotPtr = arr.AppendElement(mozilla::fallible);
1548
0
      if (!slotPtr) {
1549
0
        JS_ReportOutOfMemory(cx);
1550
0
        return false;
1551
0
      }
1552
0
      uint32_t& slot = *slotPtr;
1553
0
      if (!ValueToPrimitive<uint32_t, eDefault>(cx, temp, &slot)) {
1554
0
        return false;
1555
0
      }
1556
0
    }
1557
0
  } else {
1558
0
    ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 2 of HTMLIFrameElement.sendTouchEvent");
1559
0
    return false;
1560
0
  }
1561
0
  binding_detail::AutoSequence<int32_t> arg2;
1562
0
  if (args[2].isObject()) {
1563
0
    JS::ForOfIterator iter(cx);
1564
0
    if (!iter.init(args[2], JS::ForOfIterator::AllowNonIterable)) {
1565
0
      return false;
1566
0
    }
1567
0
    if (!iter.valueIsIterable()) {
1568
0
      ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 3 of HTMLIFrameElement.sendTouchEvent");
1569
0
      return false;
1570
0
    }
1571
0
    binding_detail::AutoSequence<int32_t> &arr = arg2;
1572
0
    JS::Rooted<JS::Value> temp(cx);
1573
0
    while (true) {
1574
0
      bool done;
1575
0
      if (!iter.next(&temp, &done)) {
1576
0
        return false;
1577
0
      }
1578
0
      if (done) {
1579
0
        break;
1580
0
      }
1581
0
      int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
1582
0
      if (!slotPtr) {
1583
0
        JS_ReportOutOfMemory(cx);
1584
0
        return false;
1585
0
      }
1586
0
      int32_t& slot = *slotPtr;
1587
0
      if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, &slot)) {
1588
0
        return false;
1589
0
      }
1590
0
    }
1591
0
  } else {
1592
0
    ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 3 of HTMLIFrameElement.sendTouchEvent");
1593
0
    return false;
1594
0
  }
1595
0
  binding_detail::AutoSequence<int32_t> arg3;
1596
0
  if (args[3].isObject()) {
1597
0
    JS::ForOfIterator iter(cx);
1598
0
    if (!iter.init(args[3], JS::ForOfIterator::AllowNonIterable)) {
1599
0
      return false;
1600
0
    }
1601
0
    if (!iter.valueIsIterable()) {
1602
0
      ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 4 of HTMLIFrameElement.sendTouchEvent");
1603
0
      return false;
1604
0
    }
1605
0
    binding_detail::AutoSequence<int32_t> &arr = arg3;
1606
0
    JS::Rooted<JS::Value> temp(cx);
1607
0
    while (true) {
1608
0
      bool done;
1609
0
      if (!iter.next(&temp, &done)) {
1610
0
        return false;
1611
0
      }
1612
0
      if (done) {
1613
0
        break;
1614
0
      }
1615
0
      int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
1616
0
      if (!slotPtr) {
1617
0
        JS_ReportOutOfMemory(cx);
1618
0
        return false;
1619
0
      }
1620
0
      int32_t& slot = *slotPtr;
1621
0
      if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, &slot)) {
1622
0
        return false;
1623
0
      }
1624
0
    }
1625
0
  } else {
1626
0
    ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 4 of HTMLIFrameElement.sendTouchEvent");
1627
0
    return false;
1628
0
  }
1629
0
  binding_detail::AutoSequence<uint32_t> arg4;
1630
0
  if (args[4].isObject()) {
1631
0
    JS::ForOfIterator iter(cx);
1632
0
    if (!iter.init(args[4], JS::ForOfIterator::AllowNonIterable)) {
1633
0
      return false;
1634
0
    }
1635
0
    if (!iter.valueIsIterable()) {
1636
0
      ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 5 of HTMLIFrameElement.sendTouchEvent");
1637
0
      return false;
1638
0
    }
1639
0
    binding_detail::AutoSequence<uint32_t> &arr = arg4;
1640
0
    JS::Rooted<JS::Value> temp(cx);
1641
0
    while (true) {
1642
0
      bool done;
1643
0
      if (!iter.next(&temp, &done)) {
1644
0
        return false;
1645
0
      }
1646
0
      if (done) {
1647
0
        break;
1648
0
      }
1649
0
      uint32_t* slotPtr = arr.AppendElement(mozilla::fallible);
1650
0
      if (!slotPtr) {
1651
0
        JS_ReportOutOfMemory(cx);
1652
0
        return false;
1653
0
      }
1654
0
      uint32_t& slot = *slotPtr;
1655
0
      if (!ValueToPrimitive<uint32_t, eDefault>(cx, temp, &slot)) {
1656
0
        return false;
1657
0
      }
1658
0
    }
1659
0
  } else {
1660
0
    ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 5 of HTMLIFrameElement.sendTouchEvent");
1661
0
    return false;
1662
0
  }
1663
0
  binding_detail::AutoSequence<uint32_t> arg5;
1664
0
  if (args[5].isObject()) {
1665
0
    JS::ForOfIterator iter(cx);
1666
0
    if (!iter.init(args[5], JS::ForOfIterator::AllowNonIterable)) {
1667
0
      return false;
1668
0
    }
1669
0
    if (!iter.valueIsIterable()) {
1670
0
      ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 6 of HTMLIFrameElement.sendTouchEvent");
1671
0
      return false;
1672
0
    }
1673
0
    binding_detail::AutoSequence<uint32_t> &arr = arg5;
1674
0
    JS::Rooted<JS::Value> temp(cx);
1675
0
    while (true) {
1676
0
      bool done;
1677
0
      if (!iter.next(&temp, &done)) {
1678
0
        return false;
1679
0
      }
1680
0
      if (done) {
1681
0
        break;
1682
0
      }
1683
0
      uint32_t* slotPtr = arr.AppendElement(mozilla::fallible);
1684
0
      if (!slotPtr) {
1685
0
        JS_ReportOutOfMemory(cx);
1686
0
        return false;
1687
0
      }
1688
0
      uint32_t& slot = *slotPtr;
1689
0
      if (!ValueToPrimitive<uint32_t, eDefault>(cx, temp, &slot)) {
1690
0
        return false;
1691
0
      }
1692
0
    }
1693
0
  } else {
1694
0
    ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 6 of HTMLIFrameElement.sendTouchEvent");
1695
0
    return false;
1696
0
  }
1697
0
  binding_detail::AutoSequence<float> arg6;
1698
0
  if (args[6].isObject()) {
1699
0
    JS::ForOfIterator iter(cx);
1700
0
    if (!iter.init(args[6], JS::ForOfIterator::AllowNonIterable)) {
1701
0
      return false;
1702
0
    }
1703
0
    if (!iter.valueIsIterable()) {
1704
0
      ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 7 of HTMLIFrameElement.sendTouchEvent");
1705
0
      return false;
1706
0
    }
1707
0
    binding_detail::AutoSequence<float> &arr = arg6;
1708
0
    JS::Rooted<JS::Value> temp(cx);
1709
0
    while (true) {
1710
0
      bool done;
1711
0
      if (!iter.next(&temp, &done)) {
1712
0
        return false;
1713
0
      }
1714
0
      if (done) {
1715
0
        break;
1716
0
      }
1717
0
      float* slotPtr = arr.AppendElement(mozilla::fallible);
1718
0
      if (!slotPtr) {
1719
0
        JS_ReportOutOfMemory(cx);
1720
0
        return false;
1721
0
      }
1722
0
      float& slot = *slotPtr;
1723
0
      if (!ValueToPrimitive<float, eDefault>(cx, temp, &slot)) {
1724
0
        return false;
1725
0
      } else if (!mozilla::IsFinite(slot)) {
1726
0
        ThrowErrorMessage(cx, MSG_NOT_FINITE, "Element of argument 7 of HTMLIFrameElement.sendTouchEvent");
1727
0
        return false;
1728
0
      }
1729
0
    }
1730
0
  } else {
1731
0
    ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 7 of HTMLIFrameElement.sendTouchEvent");
1732
0
    return false;
1733
0
  }
1734
0
  binding_detail::AutoSequence<float> arg7;
1735
0
  if (args[7].isObject()) {
1736
0
    JS::ForOfIterator iter(cx);
1737
0
    if (!iter.init(args[7], JS::ForOfIterator::AllowNonIterable)) {
1738
0
      return false;
1739
0
    }
1740
0
    if (!iter.valueIsIterable()) {
1741
0
      ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 8 of HTMLIFrameElement.sendTouchEvent");
1742
0
      return false;
1743
0
    }
1744
0
    binding_detail::AutoSequence<float> &arr = arg7;
1745
0
    JS::Rooted<JS::Value> temp(cx);
1746
0
    while (true) {
1747
0
      bool done;
1748
0
      if (!iter.next(&temp, &done)) {
1749
0
        return false;
1750
0
      }
1751
0
      if (done) {
1752
0
        break;
1753
0
      }
1754
0
      float* slotPtr = arr.AppendElement(mozilla::fallible);
1755
0
      if (!slotPtr) {
1756
0
        JS_ReportOutOfMemory(cx);
1757
0
        return false;
1758
0
      }
1759
0
      float& slot = *slotPtr;
1760
0
      if (!ValueToPrimitive<float, eDefault>(cx, temp, &slot)) {
1761
0
        return false;
1762
0
      } else if (!mozilla::IsFinite(slot)) {
1763
0
        ThrowErrorMessage(cx, MSG_NOT_FINITE, "Element of argument 8 of HTMLIFrameElement.sendTouchEvent");
1764
0
        return false;
1765
0
      }
1766
0
    }
1767
0
  } else {
1768
0
    ThrowErrorMessage(cx, MSG_NOT_SEQUENCE, "Argument 8 of HTMLIFrameElement.sendTouchEvent");
1769
0
    return false;
1770
0
  }
1771
0
  uint32_t arg8;
1772
0
  if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[8], &arg8)) {
1773
0
    return false;
1774
0
  }
1775
0
  uint32_t arg9;
1776
0
  if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[9], &arg9)) {
1777
0
    return false;
1778
0
  }
1779
0
  FastErrorResult rv;
1780
0
  self->SendTouchEvent(NonNullHelper(Constify(arg0)), Constify(arg1), Constify(arg2), Constify(arg3), Constify(arg4), Constify(arg5), Constify(arg6), Constify(arg7), arg8, arg9, rv);
1781
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1782
0
    return false;
1783
0
  }
1784
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1785
0
  args.rval().setUndefined();
1786
0
  return true;
1787
0
}
1788
1789
static const JSJitInfo sendTouchEvent_methodinfo = {
1790
  { (JSJitGetterOp)sendTouchEvent },
1791
  { prototypes::id::HTMLIFrameElement },
1792
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
1793
  JSJitInfo::Method,
1794
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1795
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1796
  false,  /* isInfallible. False in setters. */
1797
  false,  /* isMovable.  Not relevant for setters. */
1798
  false, /* isEliminatable.  Not relevant for setters. */
1799
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1800
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1801
  false,  /* isTypedMethod.  Only relevant for methods. */
1802
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1803
};
1804
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1805
static_assert(0 < 1, "There is no slot for us");
1806
1807
MOZ_CAN_RUN_SCRIPT static bool
1808
goBack(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
1809
0
{
1810
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.goBack", DOM, cx);
1811
0
1812
0
  FastErrorResult rv;
1813
0
  self->GoBack(rv);
1814
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1815
0
    return false;
1816
0
  }
1817
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1818
0
  args.rval().setUndefined();
1819
0
  return true;
1820
0
}
1821
1822
static const JSJitInfo goBack_methodinfo = {
1823
  { (JSJitGetterOp)goBack },
1824
  { prototypes::id::HTMLIFrameElement },
1825
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
1826
  JSJitInfo::Method,
1827
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1828
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1829
  false,  /* isInfallible. False in setters. */
1830
  false,  /* isMovable.  Not relevant for setters. */
1831
  false, /* isEliminatable.  Not relevant for setters. */
1832
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1833
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1834
  false,  /* isTypedMethod.  Only relevant for methods. */
1835
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1836
};
1837
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1838
static_assert(0 < 1, "There is no slot for us");
1839
1840
MOZ_CAN_RUN_SCRIPT static bool
1841
goForward(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
1842
0
{
1843
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.goForward", DOM, cx);
1844
0
1845
0
  FastErrorResult rv;
1846
0
  self->GoForward(rv);
1847
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1848
0
    return false;
1849
0
  }
1850
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1851
0
  args.rval().setUndefined();
1852
0
  return true;
1853
0
}
1854
1855
static const JSJitInfo goForward_methodinfo = {
1856
  { (JSJitGetterOp)goForward },
1857
  { prototypes::id::HTMLIFrameElement },
1858
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
1859
  JSJitInfo::Method,
1860
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1861
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1862
  false,  /* isInfallible. False in setters. */
1863
  false,  /* isMovable.  Not relevant for setters. */
1864
  false, /* isEliminatable.  Not relevant for setters. */
1865
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1866
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1867
  false,  /* isTypedMethod.  Only relevant for methods. */
1868
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1869
};
1870
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1871
static_assert(0 < 1, "There is no slot for us");
1872
1873
MOZ_CAN_RUN_SCRIPT static bool
1874
reload(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
1875
0
{
1876
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.reload", DOM, cx);
1877
0
1878
0
  bool arg0;
1879
0
  if (args.hasDefined(0)) {
1880
0
    if (!ValueToPrimitive<bool, eDefault>(cx, args[0], &arg0)) {
1881
0
      return false;
1882
0
    }
1883
0
  } else {
1884
0
    arg0 = false;
1885
0
  }
1886
0
  FastErrorResult rv;
1887
0
  self->Reload(arg0, rv);
1888
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1889
0
    return false;
1890
0
  }
1891
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1892
0
  args.rval().setUndefined();
1893
0
  return true;
1894
0
}
1895
1896
static const JSJitInfo reload_methodinfo = {
1897
  { (JSJitGetterOp)reload },
1898
  { prototypes::id::HTMLIFrameElement },
1899
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
1900
  JSJitInfo::Method,
1901
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1902
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1903
  false,  /* isInfallible. False in setters. */
1904
  false,  /* isMovable.  Not relevant for setters. */
1905
  false, /* isEliminatable.  Not relevant for setters. */
1906
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1907
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1908
  false,  /* isTypedMethod.  Only relevant for methods. */
1909
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1910
};
1911
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1912
static_assert(0 < 1, "There is no slot for us");
1913
1914
MOZ_CAN_RUN_SCRIPT static bool
1915
stop(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
1916
0
{
1917
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.stop", DOM, cx);
1918
0
1919
0
  FastErrorResult rv;
1920
0
  self->Stop(rv);
1921
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1922
0
    return false;
1923
0
  }
1924
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1925
0
  args.rval().setUndefined();
1926
0
  return true;
1927
0
}
1928
1929
static const JSJitInfo stop_methodinfo = {
1930
  { (JSJitGetterOp)stop },
1931
  { prototypes::id::HTMLIFrameElement },
1932
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
1933
  JSJitInfo::Method,
1934
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1935
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1936
  false,  /* isInfallible. False in setters. */
1937
  false,  /* isMovable.  Not relevant for setters. */
1938
  false, /* isEliminatable.  Not relevant for setters. */
1939
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1940
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1941
  false,  /* isTypedMethod.  Only relevant for methods. */
1942
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1943
};
1944
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1945
static_assert(0 < 1, "There is no slot for us");
1946
1947
MOZ_CAN_RUN_SCRIPT static bool
1948
download(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
1949
0
{
1950
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.download", DOM, cx);
1951
0
1952
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1953
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "HTMLIFrameElement.download");
1954
0
  }
1955
0
  binding_detail::FakeString arg0;
1956
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1957
0
    return false;
1958
0
  }
1959
0
  binding_detail::FastBrowserElementDownloadOptions arg1;
1960
0
  if (!arg1.Init(cx, (args.hasDefined(1)) ? args[1] : JS::NullHandleValue,  "Argument 2 of HTMLIFrameElement.download", false)) {
1961
0
    return false;
1962
0
  }
1963
0
  FastErrorResult rv;
1964
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMRequest>(self->Download(NonNullHelper(Constify(arg0)), Constify(arg1), rv)));
1965
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1966
0
    return false;
1967
0
  }
1968
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
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 download_methodinfo = {
1977
  { (JSJitGetterOp)download },
1978
  { prototypes::id::HTMLIFrameElement },
1979
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::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
purgeHistory(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
1996
0
{
1997
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.purgeHistory", DOM, cx);
1998
0
1999
0
  FastErrorResult rv;
2000
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMRequest>(self->PurgeHistory(rv)));
2001
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2002
0
    return false;
2003
0
  }
2004
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2005
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2006
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2007
0
    return false;
2008
0
  }
2009
0
  return true;
2010
0
}
2011
2012
static const JSJitInfo purgeHistory_methodinfo = {
2013
  { (JSJitGetterOp)purgeHistory },
2014
  { prototypes::id::HTMLIFrameElement },
2015
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
2016
  JSJitInfo::Method,
2017
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2018
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2019
  false,  /* isInfallible. False in setters. */
2020
  false,  /* isMovable.  Not relevant for setters. */
2021
  false, /* isEliminatable.  Not relevant for setters. */
2022
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2023
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2024
  false,  /* isTypedMethod.  Only relevant for methods. */
2025
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2026
};
2027
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2028
static_assert(0 < 1, "There is no slot for us");
2029
2030
MOZ_CAN_RUN_SCRIPT static bool
2031
getScreenshot(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
2032
0
{
2033
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.getScreenshot", DOM, cx);
2034
0
2035
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
2036
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "HTMLIFrameElement.getScreenshot");
2037
0
  }
2038
0
  uint32_t arg0;
2039
0
  if (!ValueToPrimitive<uint32_t, eEnforceRange>(cx, args[0], &arg0)) {
2040
0
    return false;
2041
0
  }
2042
0
  uint32_t arg1;
2043
0
  if (!ValueToPrimitive<uint32_t, eEnforceRange>(cx, args[1], &arg1)) {
2044
0
    return false;
2045
0
  }
2046
0
  binding_detail::FakeString arg2;
2047
0
  if (args.hasDefined(2)) {
2048
0
    if (!ConvertJSValueToString(cx, args[2], eStringify, eStringify, arg2)) {
2049
0
      return false;
2050
0
    }
2051
0
  } else {
2052
0
    static const char16_t data[] = { 0 };
2053
0
    arg2.Rebind(data, ArrayLength(data) - 1);
2054
0
  }
2055
0
  FastErrorResult rv;
2056
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMRequest>(self->GetScreenshot(arg0, arg1, NonNullHelper(Constify(arg2)), rv)));
2057
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2058
0
    return false;
2059
0
  }
2060
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2061
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2062
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2063
0
    return false;
2064
0
  }
2065
0
  return true;
2066
0
}
2067
2068
static const JSJitInfo getScreenshot_methodinfo = {
2069
  { (JSJitGetterOp)getScreenshot },
2070
  { prototypes::id::HTMLIFrameElement },
2071
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
2072
  JSJitInfo::Method,
2073
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2074
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2075
  false,  /* isInfallible. False in setters. */
2076
  false,  /* isMovable.  Not relevant for setters. */
2077
  false, /* isEliminatable.  Not relevant for setters. */
2078
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2079
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2080
  false,  /* isTypedMethod.  Only relevant for methods. */
2081
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2082
};
2083
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2084
static_assert(0 < 1, "There is no slot for us");
2085
2086
MOZ_CAN_RUN_SCRIPT static bool
2087
zoom(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
2088
0
{
2089
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.zoom", DOM, cx);
2090
0
2091
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
2092
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "HTMLIFrameElement.zoom");
2093
0
  }
2094
0
  float arg0;
2095
0
  if (!ValueToPrimitive<float, eDefault>(cx, args[0], &arg0)) {
2096
0
    return false;
2097
0
  } else if (!mozilla::IsFinite(arg0)) {
2098
0
    ThrowErrorMessage(cx, MSG_NOT_FINITE, "Argument 1 of HTMLIFrameElement.zoom");
2099
0
    return false;
2100
0
  }
2101
0
  FastErrorResult rv;
2102
0
  self->Zoom(arg0, rv);
2103
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2104
0
    return false;
2105
0
  }
2106
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2107
0
  args.rval().setUndefined();
2108
0
  return true;
2109
0
}
2110
2111
static const JSJitInfo zoom_methodinfo = {
2112
  { (JSJitGetterOp)zoom },
2113
  { prototypes::id::HTMLIFrameElement },
2114
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
2115
  JSJitInfo::Method,
2116
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2117
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
2118
  false,  /* isInfallible. False in setters. */
2119
  false,  /* isMovable.  Not relevant for setters. */
2120
  false, /* isEliminatable.  Not relevant for setters. */
2121
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2122
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2123
  false,  /* isTypedMethod.  Only relevant for methods. */
2124
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2125
};
2126
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2127
static_assert(0 < 1, "There is no slot for us");
2128
2129
MOZ_CAN_RUN_SCRIPT static bool
2130
getCanGoBack(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
2131
0
{
2132
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.getCanGoBack", DOM, cx);
2133
0
2134
0
  FastErrorResult rv;
2135
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMRequest>(self->GetCanGoBack(rv)));
2136
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2137
0
    return false;
2138
0
  }
2139
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2140
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2141
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2142
0
    return false;
2143
0
  }
2144
0
  return true;
2145
0
}
2146
2147
static const JSJitInfo getCanGoBack_methodinfo = {
2148
  { (JSJitGetterOp)getCanGoBack },
2149
  { prototypes::id::HTMLIFrameElement },
2150
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
2151
  JSJitInfo::Method,
2152
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2153
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2154
  false,  /* isInfallible. False in setters. */
2155
  false,  /* isMovable.  Not relevant for setters. */
2156
  false, /* isEliminatable.  Not relevant for setters. */
2157
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2158
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2159
  false,  /* isTypedMethod.  Only relevant for methods. */
2160
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2161
};
2162
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2163
static_assert(0 < 1, "There is no slot for us");
2164
2165
MOZ_CAN_RUN_SCRIPT static bool
2166
getCanGoForward(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
2167
0
{
2168
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.getCanGoForward", DOM, cx);
2169
0
2170
0
  FastErrorResult rv;
2171
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMRequest>(self->GetCanGoForward(rv)));
2172
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2173
0
    return false;
2174
0
  }
2175
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2176
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2177
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2178
0
    return false;
2179
0
  }
2180
0
  return true;
2181
0
}
2182
2183
static const JSJitInfo getCanGoForward_methodinfo = {
2184
  { (JSJitGetterOp)getCanGoForward },
2185
  { prototypes::id::HTMLIFrameElement },
2186
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
2187
  JSJitInfo::Method,
2188
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2189
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2190
  false,  /* isInfallible. False in setters. */
2191
  false,  /* isMovable.  Not relevant for setters. */
2192
  false, /* isEliminatable.  Not relevant for setters. */
2193
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2194
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2195
  false,  /* isTypedMethod.  Only relevant for methods. */
2196
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2197
};
2198
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2199
static_assert(0 < 1, "There is no slot for us");
2200
2201
MOZ_CAN_RUN_SCRIPT static bool
2202
getContentDimensions(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
2203
0
{
2204
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.getContentDimensions", DOM, cx);
2205
0
2206
0
  FastErrorResult rv;
2207
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMRequest>(self->GetContentDimensions(rv)));
2208
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2209
0
    return false;
2210
0
  }
2211
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2212
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2213
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2214
0
    return false;
2215
0
  }
2216
0
  return true;
2217
0
}
2218
2219
static const JSJitInfo getContentDimensions_methodinfo = {
2220
  { (JSJitGetterOp)getContentDimensions },
2221
  { prototypes::id::HTMLIFrameElement },
2222
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
2223
  JSJitInfo::Method,
2224
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2225
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2226
  false,  /* isInfallible. False in setters. */
2227
  false,  /* isMovable.  Not relevant for setters. */
2228
  false, /* isEliminatable.  Not relevant for setters. */
2229
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2230
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2231
  false,  /* isTypedMethod.  Only relevant for methods. */
2232
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2233
};
2234
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2235
static_assert(0 < 1, "There is no slot for us");
2236
2237
MOZ_CAN_RUN_SCRIPT static bool
2238
findAll(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
2239
0
{
2240
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.findAll", DOM, cx);
2241
0
2242
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
2243
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "HTMLIFrameElement.findAll");
2244
0
  }
2245
0
  binding_detail::FakeString arg0;
2246
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
2247
0
    return false;
2248
0
  }
2249
0
  BrowserFindCaseSensitivity arg1;
2250
0
  {
2251
0
    int index;
2252
0
    if (!FindEnumStringIndex<true>(cx, args[1], BrowserFindCaseSensitivityValues::strings, "BrowserFindCaseSensitivity", "Argument 2 of HTMLIFrameElement.findAll", &index)) {
2253
0
      return false;
2254
0
    }
2255
0
    MOZ_ASSERT(index >= 0);
2256
0
    arg1 = static_cast<BrowserFindCaseSensitivity>(index);
2257
0
  }
2258
0
  FastErrorResult rv;
2259
0
  self->FindAll(NonNullHelper(Constify(arg0)), arg1, rv);
2260
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2261
0
    return false;
2262
0
  }
2263
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2264
0
  args.rval().setUndefined();
2265
0
  return true;
2266
0
}
2267
2268
static const JSJitInfo findAll_methodinfo = {
2269
  { (JSJitGetterOp)findAll },
2270
  { prototypes::id::HTMLIFrameElement },
2271
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
2272
  JSJitInfo::Method,
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
findNext(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
2288
0
{
2289
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.findNext", DOM, cx);
2290
0
2291
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
2292
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "HTMLIFrameElement.findNext");
2293
0
  }
2294
0
  BrowserFindDirection arg0;
2295
0
  {
2296
0
    int index;
2297
0
    if (!FindEnumStringIndex<true>(cx, args[0], BrowserFindDirectionValues::strings, "BrowserFindDirection", "Argument 1 of HTMLIFrameElement.findNext", &index)) {
2298
0
      return false;
2299
0
    }
2300
0
    MOZ_ASSERT(index >= 0);
2301
0
    arg0 = static_cast<BrowserFindDirection>(index);
2302
0
  }
2303
0
  FastErrorResult rv;
2304
0
  self->FindNext(arg0, rv);
2305
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2306
0
    return false;
2307
0
  }
2308
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2309
0
  args.rval().setUndefined();
2310
0
  return true;
2311
0
}
2312
2313
static const JSJitInfo findNext_methodinfo = {
2314
  { (JSJitGetterOp)findNext },
2315
  { prototypes::id::HTMLIFrameElement },
2316
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
2317
  JSJitInfo::Method,
2318
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2319
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
2320
  false,  /* isInfallible. False in setters. */
2321
  false,  /* isMovable.  Not relevant for setters. */
2322
  false, /* isEliminatable.  Not relevant for setters. */
2323
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2324
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2325
  false,  /* isTypedMethod.  Only relevant for methods. */
2326
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2327
};
2328
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2329
static_assert(0 < 1, "There is no slot for us");
2330
2331
MOZ_CAN_RUN_SCRIPT static bool
2332
clearMatch(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
2333
0
{
2334
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.clearMatch", DOM, cx);
2335
0
2336
0
  FastErrorResult rv;
2337
0
  self->ClearMatch(rv);
2338
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2339
0
    return false;
2340
0
  }
2341
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2342
0
  args.rval().setUndefined();
2343
0
  return true;
2344
0
}
2345
2346
static const JSJitInfo clearMatch_methodinfo = {
2347
  { (JSJitGetterOp)clearMatch },
2348
  { prototypes::id::HTMLIFrameElement },
2349
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
2350
  JSJitInfo::Method,
2351
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2352
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
2353
  false,  /* isInfallible. False in setters. */
2354
  false,  /* isMovable.  Not relevant for setters. */
2355
  false, /* isEliminatable.  Not relevant for setters. */
2356
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2357
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2358
  false,  /* isTypedMethod.  Only relevant for methods. */
2359
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2360
};
2361
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2362
static_assert(0 < 1, "There is no slot for us");
2363
2364
MOZ_CAN_RUN_SCRIPT static bool
2365
executeScript(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
2366
0
{
2367
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.executeScript", DOM, cx);
2368
0
2369
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
2370
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "HTMLIFrameElement.executeScript");
2371
0
  }
2372
0
  binding_detail::FakeString arg0;
2373
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
2374
0
    return false;
2375
0
  }
2376
0
  binding_detail::FastBrowserElementExecuteScriptOptions arg1;
2377
0
  if (!arg1.Init(cx, (args.hasDefined(1)) ? args[1] : JS::NullHandleValue,  "Argument 2 of HTMLIFrameElement.executeScript", false)) {
2378
0
    return false;
2379
0
  }
2380
0
  FastErrorResult rv;
2381
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMRequest>(self->ExecuteScript(NonNullHelper(Constify(arg0)), Constify(arg1), rv)));
2382
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2383
0
    return false;
2384
0
  }
2385
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2386
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2387
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2388
0
    return false;
2389
0
  }
2390
0
  return true;
2391
0
}
2392
2393
static const JSJitInfo executeScript_methodinfo = {
2394
  { (JSJitGetterOp)executeScript },
2395
  { prototypes::id::HTMLIFrameElement },
2396
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
2397
  JSJitInfo::Method,
2398
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2399
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2400
  false,  /* isInfallible. False in setters. */
2401
  false,  /* isMovable.  Not relevant for setters. */
2402
  false, /* isEliminatable.  Not relevant for setters. */
2403
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2404
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2405
  false,  /* isTypedMethod.  Only relevant for methods. */
2406
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2407
};
2408
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2409
static_assert(0 < 1, "There is no slot for us");
2410
2411
MOZ_CAN_RUN_SCRIPT static bool
2412
getWebManifest(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
2413
0
{
2414
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.getWebManifest", DOM, cx);
2415
0
2416
0
  FastErrorResult rv;
2417
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMRequest>(self->GetWebManifest(rv)));
2418
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2419
0
    return false;
2420
0
  }
2421
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2422
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2423
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2424
0
    return false;
2425
0
  }
2426
0
  return true;
2427
0
}
2428
2429
static const JSJitInfo getWebManifest_methodinfo = {
2430
  { (JSJitGetterOp)getWebManifest },
2431
  { prototypes::id::HTMLIFrameElement },
2432
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
2433
  JSJitInfo::Method,
2434
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2435
  JSVAL_TYPE_OBJECT,  /* 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_frameLoader(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, JSJitGetterCallArgs args)
2449
0
{
2450
0
  AUTO_PROFILER_LABEL_FAST("get HTMLIFrameElement.frameLoader", DOM, cx);
2451
0
2452
0
  auto result(StrongOrRawPtr<nsFrameLoader>(self->GetFrameLoader()));
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 frameLoader_getterinfo = {
2466
  { (JSJitGetterOp)get_frameLoader },
2467
  { prototypes::id::HTMLIFrameElement },
2468
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
2469
  JSJitInfo::Getter,
2470
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2471
  JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
2472
  false,  /* isInfallible. False in setters. */
2473
  false,  /* isMovable.  Not relevant for setters. */
2474
  false, /* 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
presetOpenerWindow(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
2485
0
{
2486
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.presetOpenerWindow", DOM, cx);
2487
0
2488
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
2489
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "HTMLIFrameElement.presetOpenerWindow");
2490
0
  }
2491
0
  nsPIDOMWindowOuter* arg0;
2492
0
  RefPtr<nsPIDOMWindowOuter> arg0_holder;
2493
0
  if (args[0].isObject()) {
2494
0
    JS::Rooted<JSObject*> source(cx, &args[0].toObject());
2495
0
    if (NS_FAILED(UnwrapArg<nsPIDOMWindowOuter>(cx, source, getter_AddRefs(arg0_holder)))) {
2496
0
      ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of HTMLIFrameElement.presetOpenerWindow", "WindowProxy");
2497
0
      return false;
2498
0
    }
2499
0
    MOZ_ASSERT(arg0_holder);
2500
0
    arg0 = arg0_holder;
2501
0
  } else if (args[0].isNullOrUndefined()) {
2502
0
    arg0 = nullptr;
2503
0
  } else {
2504
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of HTMLIFrameElement.presetOpenerWindow");
2505
0
    return false;
2506
0
  }
2507
0
  FastErrorResult rv;
2508
0
  self->PresetOpenerWindow(MOZ_KnownLive(Constify(arg0)), rv);
2509
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2510
0
    return false;
2511
0
  }
2512
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2513
0
  args.rval().setUndefined();
2514
0
  return true;
2515
0
}
2516
2517
static const JSJitInfo presetOpenerWindow_methodinfo = {
2518
  { (JSJitGetterOp)presetOpenerWindow },
2519
  { prototypes::id::HTMLIFrameElement },
2520
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
2521
  JSJitInfo::Method,
2522
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2523
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
2524
  false,  /* isInfallible. False in setters. */
2525
  false,  /* isMovable.  Not relevant for setters. */
2526
  false, /* isEliminatable.  Not relevant for setters. */
2527
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2528
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2529
  false,  /* isTypedMethod.  Only relevant for methods. */
2530
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2531
};
2532
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2533
static_assert(0 < 1, "There is no slot for us");
2534
2535
MOZ_CAN_RUN_SCRIPT static bool
2536
swapFrameLoaders(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLIFrameElement* self, const JSJitMethodCallArgs& args)
2537
0
{
2538
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement.swapFrameLoaders", DOM, cx);
2539
0
2540
0
  unsigned argcount = std::min(args.length(), 1u);
2541
0
  switch (argcount) {
2542
0
    case 1: {
2543
0
      if (args[0].isObject()) {
2544
0
        do {
2545
0
          NonNull<mozilla::dom::XULFrameElement> arg0;
2546
0
          {
2547
0
            nsresult rv = UnwrapObject<prototypes::id::XULFrameElement, mozilla::dom::XULFrameElement>(args[0], arg0);
2548
0
            if (NS_FAILED(rv)) {
2549
0
              break;
2550
0
            }
2551
0
          }
2552
0
          FastErrorResult rv;
2553
0
          self->SwapFrameLoaders(MOZ_KnownLive(NonNullHelper(arg0)), rv);
2554
0
          if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2555
0
            return false;
2556
0
          }
2557
0
          MOZ_ASSERT(!JS_IsExceptionPending(cx));
2558
0
          args.rval().setUndefined();
2559
0
          return true;
2560
0
        } while (false);
2561
0
        do {
2562
0
          NonNull<mozilla::dom::HTMLIFrameElement> arg0;
2563
0
          {
2564
0
            nsresult rv = UnwrapObject<prototypes::id::HTMLIFrameElement, mozilla::dom::HTMLIFrameElement>(args[0], arg0);
2565
0
            if (NS_FAILED(rv)) {
2566
0
              break;
2567
0
            }
2568
0
          }
2569
0
          FastErrorResult rv;
2570
0
          self->SwapFrameLoaders(MOZ_KnownLive(NonNullHelper(arg0)), rv);
2571
0
          if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2572
0
            return false;
2573
0
          }
2574
0
          MOZ_ASSERT(!JS_IsExceptionPending(cx));
2575
0
          args.rval().setUndefined();
2576
0
          return true;
2577
0
        } while (false);
2578
0
      }
2579
0
      return ThrowErrorMessage(cx, MSG_OVERLOAD_RESOLUTION_FAILED, "1", "1", "HTMLIFrameElement.swapFrameLoaders");
2580
0
      break;
2581
0
    }
2582
0
    default: {
2583
0
      return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "HTMLIFrameElement.swapFrameLoaders");
2584
0
      break;
2585
0
    }
2586
0
  }
2587
0
  MOZ_CRASH("We have an always-returning default case");
2588
0
  return false;
2589
0
}
2590
2591
static const JSJitInfo swapFrameLoaders_methodinfo = {
2592
  { (JSJitGetterOp)swapFrameLoaders },
2593
  { prototypes::id::HTMLIFrameElement },
2594
  { PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth },
2595
  JSJitInfo::Method,
2596
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2597
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
2598
  false,  /* isInfallible. False in setters. */
2599
  false,  /* isMovable.  Not relevant for setters. */
2600
  false, /* isEliminatable.  Not relevant for setters. */
2601
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2602
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2603
  false,  /* isTypedMethod.  Only relevant for methods. */
2604
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2605
};
2606
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2607
static_assert(0 < 1, "There is no slot for us");
2608
2609
static bool
2610
_addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
2611
0
{
2612
0
  mozilla::dom::HTMLIFrameElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLIFrameElement>(obj);
2613
0
  // We don't want to preserve if we don't have a wrapper, and we
2614
0
  // obviously can't preserve if we're not initialized.
2615
0
  if (self && self->GetWrapperPreserveColor()) {
2616
0
    PreserveWrapper(self);
2617
0
  }
2618
0
  return true;
2619
0
}
2620
2621
static void
2622
_finalize(js::FreeOp* fop, JSObject* obj)
2623
0
{
2624
0
  mozilla::dom::HTMLIFrameElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLIFrameElement>(obj);
2625
0
  if (self) {
2626
0
    ClearWrapper(self, self, obj);
2627
0
    AddForDeferredFinalization<mozilla::dom::HTMLIFrameElement>(self);
2628
0
  }
2629
0
}
2630
2631
static size_t
2632
_objectMoved(JSObject* obj, JSObject* old)
2633
0
{
2634
0
  mozilla::dom::HTMLIFrameElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLIFrameElement>(obj);
2635
0
  if (self) {
2636
0
    UpdateWrapper(self, self, obj, old);
2637
0
  }
2638
0
2639
0
  return 0;
2640
0
}
2641
2642
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
2643
#if defined(__clang__)
2644
#pragma clang diagnostic push
2645
#pragma clang diagnostic ignored "-Wmissing-braces"
2646
#endif
2647
static const JSFunctionSpec sMethods_specs[] = {
2648
  JS_FNSPEC("getSVGDocument", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getSVGDocument_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
2649
  JS_FS_END
2650
};
2651
#if defined(__clang__)
2652
#pragma clang diagnostic pop
2653
#endif
2654
2655
2656
static const Prefable<const JSFunctionSpec> sMethods[] = {
2657
  { nullptr, &sMethods_specs[0] },
2658
  { nullptr, nullptr }
2659
};
2660
2661
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
2662
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
2663
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
2664
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
2665
2666
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
2667
#if defined(__clang__)
2668
#pragma clang diagnostic push
2669
#pragma clang diagnostic ignored "-Wmissing-braces"
2670
#endif
2671
static const JSFunctionSpec sChromeMethods_specs[] = {
2672
  JS_FNSPEC("addNextPaintListener", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&addNextPaintListener_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
2673
  JS_FNSPEC("removeNextPaintListener", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&removeNextPaintListener_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
2674
  JS_FNSPEC("sendMouseEvent", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&sendMouseEvent_methodinfo), 6, JSPROP_ENUMERATE, nullptr),
2675
  JS_FS_END,
2676
  JS_FNSPEC("sendTouchEvent", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&sendTouchEvent_methodinfo), 10, JSPROP_ENUMERATE, nullptr),
2677
  JS_FS_END,
2678
  JS_FNSPEC("goBack", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&goBack_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
2679
  JS_FNSPEC("goForward", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&goForward_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
2680
  JS_FNSPEC("reload", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&reload_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
2681
  JS_FNSPEC("stop", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&stop_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
2682
  JS_FNSPEC("download", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&download_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
2683
  JS_FNSPEC("purgeHistory", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&purgeHistory_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
2684
  JS_FNSPEC("getScreenshot", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getScreenshot_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
2685
  JS_FNSPEC("zoom", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&zoom_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
2686
  JS_FNSPEC("getCanGoBack", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getCanGoBack_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
2687
  JS_FNSPEC("getCanGoForward", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getCanGoForward_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
2688
  JS_FNSPEC("getContentDimensions", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getContentDimensions_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
2689
  JS_FNSPEC("findAll", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&findAll_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
2690
  JS_FNSPEC("findNext", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&findNext_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
2691
  JS_FNSPEC("clearMatch", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&clearMatch_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
2692
  JS_FNSPEC("executeScript", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&executeScript_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
2693
  JS_FNSPEC("getWebManifest", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getWebManifest_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
2694
  JS_FS_END,
2695
  JS_FNSPEC("presetOpenerWindow", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&presetOpenerWindow_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
2696
  JS_FNSPEC("swapFrameLoaders", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&swapFrameLoaders_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
2697
  JS_FS_END
2698
};
2699
#if defined(__clang__)
2700
#pragma clang diagnostic pop
2701
#endif
2702
2703
// Can't be const because the pref-enabled boolean needs to be writable
2704
static PrefableDisablers sChromeMethods_disablers0 = {
2705
  true, false, 0, nullptr
2706
};
2707
2708
// Can't be const because the pref-enabled boolean needs to be writable
2709
static PrefableDisablers sChromeMethods_disablers4 = {
2710
  true, false, 0, &TouchEvent::PrefEnabled
2711
};
2712
2713
// Can't be const because the pref-enabled boolean needs to be writable
2714
static PrefableDisablers sChromeMethods_disablers6 = {
2715
  true, false, 0, nullptr
2716
};
2717
2718
static const Prefable<const JSFunctionSpec> sChromeMethods[] = {
2719
  { &sChromeMethods_disablers0, &sChromeMethods_specs[0] },
2720
  { &sChromeMethods_disablers4, &sChromeMethods_specs[4] },
2721
  { &sChromeMethods_disablers6, &sChromeMethods_specs[6] },
2722
  { nullptr, &sChromeMethods_specs[23] },
2723
  { nullptr, nullptr }
2724
};
2725
2726
static_assert(4 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
2727
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
2728
static_assert(16 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
2729
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
2730
2731
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
2732
#if defined(__clang__)
2733
#pragma clang diagnostic push
2734
#pragma clang diagnostic ignored "-Wmissing-braces"
2735
#endif
2736
static const JSPropertySpec sAttributes_specs[] = {
2737
  { "src", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &src_getterinfo, GenericSetter<NormalThisPolicy>, &src_setterinfo },
2738
  { "srcdoc", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &srcdoc_getterinfo, GenericSetter<NormalThisPolicy>, &srcdoc_setterinfo },
2739
  { "name", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &name_getterinfo, GenericSetter<NormalThisPolicy>, &name_setterinfo },
2740
  { "sandbox", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &sandbox_getterinfo, GenericSetter<NormalThisPolicy>, &sandbox_setterinfo },
2741
  { "allowFullscreen", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &allowFullscreen_getterinfo, GenericSetter<NormalThisPolicy>, &allowFullscreen_setterinfo },
2742
  { "allowPaymentRequest", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &allowPaymentRequest_getterinfo, GenericSetter<NormalThisPolicy>, &allowPaymentRequest_setterinfo },
2743
  { "width", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &width_getterinfo, GenericSetter<NormalThisPolicy>, &width_setterinfo },
2744
  { "height", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &height_getterinfo, GenericSetter<NormalThisPolicy>, &height_setterinfo },
2745
  { "referrerPolicy", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &referrerPolicy_getterinfo, GenericSetter<NormalThisPolicy>, &referrerPolicy_setterinfo },
2746
  { "contentDocument", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &contentDocument_getterinfo, nullptr, nullptr },
2747
  { "contentWindow", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &contentWindow_getterinfo, nullptr, nullptr },
2748
  { "align", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &align_getterinfo, GenericSetter<NormalThisPolicy>, &align_setterinfo },
2749
  { "scrolling", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &scrolling_getterinfo, GenericSetter<NormalThisPolicy>, &scrolling_setterinfo },
2750
  { "frameBorder", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &frameBorder_getterinfo, GenericSetter<NormalThisPolicy>, &frameBorder_setterinfo },
2751
  { "longDesc", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &longDesc_getterinfo, GenericSetter<NormalThisPolicy>, &longDesc_setterinfo },
2752
  { "marginHeight", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &marginHeight_getterinfo, GenericSetter<NormalThisPolicy>, &marginHeight_setterinfo },
2753
  { "marginWidth", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &marginWidth_getterinfo, GenericSetter<NormalThisPolicy>, &marginWidth_setterinfo },
2754
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
2755
};
2756
#if defined(__clang__)
2757
#pragma clang diagnostic pop
2758
#endif
2759
2760
2761
static const Prefable<const JSPropertySpec> sAttributes[] = {
2762
  { nullptr, &sAttributes_specs[0] },
2763
  { nullptr, nullptr }
2764
};
2765
2766
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
2767
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
2768
static_assert(17 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
2769
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
2770
2771
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
2772
#if defined(__clang__)
2773
#pragma clang diagnostic push
2774
#pragma clang diagnostic ignored "-Wmissing-braces"
2775
#endif
2776
static const JSPropertySpec sChromeAttributes_specs[] = {
2777
  { "mozbrowser", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &mozbrowser_getterinfo, GenericSetter<NormalThisPolicy>, &mozbrowser_setterinfo },
2778
  { "frameLoader", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &frameLoader_getterinfo, nullptr, nullptr },
2779
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
2780
};
2781
#if defined(__clang__)
2782
#pragma clang diagnostic pop
2783
#endif
2784
2785
2786
static const Prefable<const JSPropertySpec> sChromeAttributes[] = {
2787
  { nullptr, &sChromeAttributes_specs[0] },
2788
  { nullptr, nullptr }
2789
};
2790
2791
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
2792
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
2793
static_assert(2 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
2794
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
2795
2796
2797
static uint16_t sNativeProperties_sortedPropertyIndices[18];
2798
static PropertyInfo sNativeProperties_propertyInfos[18];
2799
2800
static const NativePropertiesN<2> sNativeProperties = {
2801
  false, 0,
2802
  false, 0,
2803
  true,  0 /* sMethods */,
2804
  true,  1 /* sAttributes */,
2805
  false, 0,
2806
  false, 0,
2807
  false, 0,
2808
  -1,
2809
  18,
2810
  sNativeProperties_sortedPropertyIndices,
2811
  {
2812
    { sMethods, &sNativeProperties_propertyInfos[0] },
2813
    { sAttributes, &sNativeProperties_propertyInfos[1] }
2814
  }
2815
};
2816
static_assert(18 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
2817
    "We have a property info count that is oversized");
2818
2819
static uint16_t sChromeOnlyNativeProperties_sortedPropertyIndices[24];
2820
static PropertyInfo sChromeOnlyNativeProperties_propertyInfos[24];
2821
2822
static const NativePropertiesN<2> sChromeOnlyNativeProperties = {
2823
  false, 0,
2824
  false, 0,
2825
  true,  0 /* sChromeMethods */,
2826
  true,  1 /* sChromeAttributes */,
2827
  false, 0,
2828
  false, 0,
2829
  false, 0,
2830
  -1,
2831
  24,
2832
  sChromeOnlyNativeProperties_sortedPropertyIndices,
2833
  {
2834
    { sChromeMethods, &sChromeOnlyNativeProperties_propertyInfos[0] },
2835
    { sChromeAttributes, &sChromeOnlyNativeProperties_propertyInfos[22] }
2836
  }
2837
};
2838
static_assert(24 < 1ull << CHAR_BIT * sizeof(sChromeOnlyNativeProperties.propertyInfoCount),
2839
    "We have a property info count that is oversized");
2840
2841
static bool
2842
_constructor(JSContext* cx, unsigned argc, JS::Value* vp)
2843
0
{
2844
0
  AUTO_PROFILER_LABEL_FAST("HTMLIFrameElement constructor", DOM, cx);
2845
0
2846
0
  return HTMLConstructor(cx, argc, vp,
2847
0
                         constructors::id::HTMLIFrameElement,
2848
0
                         prototypes::id::HTMLIFrameElement,
2849
0
                         CreateInterfaceObjects);
2850
0
}
2851
2852
static const js::ClassOps sInterfaceObjectClassOps = {
2853
    nullptr,               /* addProperty */
2854
    nullptr,               /* delProperty */
2855
    nullptr,               /* enumerate */
2856
    nullptr,               /* newEnumerate */
2857
    nullptr,               /* resolve */
2858
    nullptr,               /* mayResolve */
2859
    nullptr,               /* finalize */
2860
    _constructor, /* call */
2861
    nullptr,               /* hasInstance */
2862
    _constructor, /* construct */
2863
    nullptr,               /* trace */
2864
};
2865
2866
static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
2867
  {
2868
    "Function",
2869
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE),
2870
    &sInterfaceObjectClassOps,
2871
    JS_NULL_CLASS_SPEC,
2872
    JS_NULL_CLASS_EXT,
2873
    &sInterfaceObjectClassObjectOps
2874
  },
2875
  eInterface,
2876
  true,
2877
  prototypes::id::HTMLIFrameElement,
2878
  PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth,
2879
  sNativePropertyHooks,
2880
  "function HTMLIFrameElement() {\n    [native code]\n}",
2881
  HTMLElement_Binding::GetConstructorObject
2882
};
2883
2884
static const DOMIfaceAndProtoJSClass sPrototypeClass = {
2885
  {
2886
    "HTMLIFrameElementPrototype",
2887
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE),
2888
    JS_NULL_CLASS_OPS,
2889
    JS_NULL_CLASS_SPEC,
2890
    JS_NULL_CLASS_EXT,
2891
    JS_NULL_OBJECT_OPS
2892
  },
2893
  eInterfacePrototype,
2894
  false,
2895
  prototypes::id::HTMLIFrameElement,
2896
  PrototypeTraits<prototypes::id::HTMLIFrameElement>::Depth,
2897
  sNativePropertyHooks,
2898
  "[object HTMLIFrameElementPrototype]",
2899
  HTMLElement_Binding::GetProtoObject
2900
};
2901
2902
static const js::ClassOps sClassOps = {
2903
  _addProperty, /* addProperty */
2904
  nullptr,               /* delProperty */
2905
  nullptr,               /* enumerate */
2906
  nullptr, /* newEnumerate */
2907
  nullptr, /* resolve */
2908
  nullptr, /* mayResolve */
2909
  _finalize, /* finalize */
2910
  nullptr, /* call */
2911
  nullptr,               /* hasInstance */
2912
  nullptr,               /* construct */
2913
  nullptr, /* trace */
2914
};
2915
2916
static const js::ClassExtension sClassExtension = {
2917
  nullptr, /* weakmapKeyDelegateOp */
2918
  _objectMoved /* objectMovedOp */
2919
};
2920
2921
static const DOMJSClass sClass = {
2922
  { "HTMLIFrameElement",
2923
    JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
2924
    &sClassOps,
2925
    JS_NULL_CLASS_SPEC,
2926
    &sClassExtension,
2927
    JS_NULL_OBJECT_OPS
2928
  },
2929
  { prototypes::id::EventTarget, prototypes::id::Node, prototypes::id::Element, prototypes::id::HTMLElement, prototypes::id::HTMLIFrameElement, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
2930
  IsBaseOf<nsISupports, mozilla::dom::HTMLIFrameElement >::value,
2931
  sNativePropertyHooks,
2932
  FindAssociatedGlobalForNative<mozilla::dom::HTMLIFrameElement>::Get,
2933
  GetProtoObjectHandle,
2934
  GetCCParticipant<mozilla::dom::HTMLIFrameElement>::Get()
2935
};
2936
static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
2937
              "Must have the right minimal number of reserved slots.");
2938
static_assert(1 >= 1,
2939
              "Must have enough reserved slots.");
2940
2941
const JSClass*
2942
GetJSClass()
2943
0
{
2944
0
  return sClass.ToJSClass();
2945
0
}
2946
2947
bool
2948
Wrap(JSContext* aCx, mozilla::dom::HTMLIFrameElement* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
2949
0
{
2950
0
  static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::dom::HTMLIFrameElement>::value,
2951
0
                "Shouldn't have wrappercached things that are not refcounted.");
2952
0
  MOZ_ASSERT(static_cast<mozilla::dom::HTMLIFrameElement*>(aObject) ==
2953
0
             reinterpret_cast<mozilla::dom::HTMLIFrameElement*>(aObject),
2954
0
             "Multiple inheritance for mozilla::dom::HTMLIFrameElement is broken.");
2955
0
  MOZ_ASSERT(static_cast<nsGenericHTMLElement*>(aObject) ==
2956
0
             reinterpret_cast<nsGenericHTMLElement*>(aObject),
2957
0
             "Multiple inheritance for nsGenericHTMLElement is broken.");
2958
0
  MOZ_ASSERT(static_cast<mozilla::dom::Element*>(aObject) ==
2959
0
             reinterpret_cast<mozilla::dom::Element*>(aObject),
2960
0
             "Multiple inheritance for mozilla::dom::Element is broken.");
2961
0
  MOZ_ASSERT(static_cast<nsINode*>(aObject) ==
2962
0
             reinterpret_cast<nsINode*>(aObject),
2963
0
             "Multiple inheritance for nsINode is broken.");
2964
0
  MOZ_ASSERT(static_cast<mozilla::dom::EventTarget*>(aObject) ==
2965
0
             reinterpret_cast<mozilla::dom::EventTarget*>(aObject),
2966
0
             "Multiple inheritance for mozilla::dom::EventTarget is broken.");
2967
0
  MOZ_ASSERT(ToSupportsIsCorrect(aObject));
2968
0
  MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
2969
0
  MOZ_ASSERT(!aCache->GetWrapper(),
2970
0
             "You should probably not be using Wrap() directly; use "
2971
0
             "GetOrCreateDOMReflector instead");
2972
0
2973
0
  MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
2974
0
             "nsISupports must be on our primary inheritance chain");
2975
0
2976
0
  JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
2977
0
  if (!global) {
2978
0
    return false;
2979
0
  }
2980
0
  MOZ_ASSERT(JS_IsGlobalObject(global));
2981
0
  MOZ_ASSERT(JS::ObjectIsNotGray(global));
2982
0
2983
0
  // That might have ended up wrapping us already, due to the wonders
2984
0
  // of XBL.  Check for that, and bail out as needed.
2985
0
  aReflector.set(aCache->GetWrapper());
2986
0
  if (aReflector) {
2987
#ifdef DEBUG
2988
    AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
2989
#endif // DEBUG
2990
    return true;
2991
0
  }
2992
0
2993
0
  JSAutoRealm ar(aCx, global);
2994
0
  JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
2995
0
  if (!canonicalProto) {
2996
0
    return false;
2997
0
  }
2998
0
  JS::Rooted<JSObject*> proto(aCx);
2999
0
  if (aGivenProto) {
3000
0
    proto = aGivenProto;
3001
0
    // Unfortunately, while aGivenProto was in the compartment of aCx
3002
0
    // coming in, we changed compartments to that of "parent" so may need
3003
0
    // to wrap the proto here.
3004
0
    if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) {
3005
0
      if (!JS_WrapObject(aCx, &proto)) {
3006
0
        return false;
3007
0
      }
3008
0
    }
3009
0
  } else {
3010
0
    proto = canonicalProto;
3011
0
  }
3012
0
3013
0
  BindingJSObjectCreator<mozilla::dom::HTMLIFrameElement> creator(aCx);
3014
0
  creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
3015
0
  if (!aReflector) {
3016
0
    return false;
3017
0
  }
3018
0
3019
0
  aCache->SetWrapper(aReflector);
3020
0
  creator.InitializationSucceeded();
3021
0
3022
0
  MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&
3023
0
             aCache->GetWrapperPreserveColor() == aReflector);
3024
0
  // If proto != canonicalProto, we have to preserve our wrapper;
3025
0
  // otherwise we won't be able to properly recreate it later, since
3026
0
  // we won't know what proto to use.  Note that we don't check
3027
0
  // aGivenProto here, since it's entirely possible (and even
3028
0
  // somewhat common) to have a non-null aGivenProto which is the
3029
0
  // same as canonicalProto.
3030
0
  if (proto != canonicalProto) {
3031
0
    PreserveWrapper(aObject);
3032
0
  }
3033
0
3034
0
  return true;
3035
0
}
3036
3037
const NativePropertyHooks sNativePropertyHooks[] = { {
3038
  nullptr,
3039
  nullptr,
3040
  nullptr,
3041
  { sNativeProperties.Upcast(), sChromeOnlyNativeProperties.Upcast() },
3042
  prototypes::id::HTMLIFrameElement,
3043
  constructors::id::HTMLIFrameElement,
3044
  HTMLElement_Binding::sNativePropertyHooks,
3045
  &DefaultXrayExpandoObjectClass
3046
} };
3047
3048
void
3049
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
3050
0
{
3051
0
  JS::Handle<JSObject*> parentProto(HTMLElement_Binding::GetProtoObjectHandle(aCx));
3052
0
  if (!parentProto) {
3053
0
    return;
3054
0
  }
3055
0
3056
0
  JS::Handle<JSObject*> constructorProto(HTMLElement_Binding::GetConstructorObjectHandle(aCx));
3057
0
  if (!constructorProto) {
3058
0
    return;
3059
0
  }
3060
0
3061
0
  static bool sIdsInited = false;
3062
0
  if (!sIdsInited && NS_IsMainThread()) {
3063
0
    if (!InitIds(aCx, sNativeProperties.Upcast())) {
3064
0
      return;
3065
0
    }
3066
0
    if (!InitIds(aCx, sChromeOnlyNativeProperties.Upcast())) {
3067
0
      return;
3068
0
    }
3069
0
    sIdsInited = true;
3070
0
  }
3071
0
3072
0
  static bool sPrefCachesInited = false;
3073
0
  if (!sPrefCachesInited && NS_IsMainThread()) {
3074
0
    sPrefCachesInited = true;
3075
0
    Preferences::AddBoolVarCache(&sChromeMethods[0].disablers->enabled, "dom.mozBrowserFramesEnabled");
3076
0
    Preferences::AddBoolVarCache(&sChromeMethods[1].disablers->enabled, "dom.mozBrowserFramesEnabled");
3077
0
    Preferences::AddBoolVarCache(&sChromeMethods[2].disablers->enabled, "dom.mozBrowserFramesEnabled");
3078
0
  }
3079
0
3080
0
  JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::HTMLIFrameElement);
3081
0
  JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::HTMLIFrameElement);
3082
0
  dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
3083
0
                              &sPrototypeClass.mBase, protoCache,
3084
0
                              nullptr,
3085
0
                              constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr,
3086
0
                              interfaceCache,
3087
0
                              sNativeProperties.Upcast(),
3088
0
                              sChromeOnlyNativeProperties.Upcast(),
3089
0
                              "HTMLIFrameElement", aDefineOnGlobal,
3090
0
                              nullptr,
3091
0
                              false);
3092
0
}
3093
3094
JSObject*
3095
GetConstructorObject(JSContext* aCx)
3096
0
{
3097
0
  return GetConstructorObjectHandle(aCx);
3098
0
}
3099
3100
} // namespace HTMLIFrameElement_Binding
3101
3102
3103
3104
} // namespace dom
3105
} // namespace mozilla