Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dom/bindings/HTMLAnchorElementBinding.cpp
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM HTMLAnchorElement.webidl BY Codegen.py - DO NOT EDIT */
2
3
#include "HTMLAnchorElementBinding.h"
4
#include "HTMLElementBinding.h"
5
#include "WrapperFactory.h"
6
#include "mozilla/OwningNonNull.h"
7
#include "mozilla/dom/BindingUtils.h"
8
#include "mozilla/dom/CustomElementRegistry.h"
9
#include "mozilla/dom/DOMJSClass.h"
10
#include "mozilla/dom/DocGroup.h"
11
#include "mozilla/dom/HTMLAnchorElement.h"
12
#include "mozilla/dom/NonRefcountedDOMObject.h"
13
#include "mozilla/dom/XrayExpandoClass.h"
14
#include "nsDOMTokenList.h"
15
16
namespace mozilla {
17
namespace dom {
18
19
namespace binding_detail {}; // Just to make sure it's known as a namespace
20
using namespace mozilla::dom::binding_detail;
21
22
23
namespace HTMLAnchorElement_Binding {
24
25
static_assert(IsRefcounted<NativeType>::value == IsRefcounted<HTMLElement_Binding::NativeType>::value,
26
              "Can't inherit from an interface with a different ownership model.");
27
28
MOZ_CAN_RUN_SCRIPT static bool
29
get_target(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
30
0
{
31
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.target", DOM, cx);
32
0
33
0
  DOMString result;
34
0
  self->GetTarget(result);
35
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
36
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
37
0
    return false;
38
0
  }
39
0
  return true;
40
0
}
41
42
MOZ_CAN_RUN_SCRIPT static bool
43
set_target(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
44
0
{
45
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.target", DOM, cx);
46
0
47
0
  binding_detail::FakeString arg0;
48
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
49
0
    return false;
50
0
  }
51
0
  Maybe<AutoCEReaction> ceReaction;
52
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
53
0
    DocGroup* docGroup = self->GetDocGroup();
54
0
    if (docGroup) {
55
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
56
0
    }
57
0
  }
58
0
  FastErrorResult rv;
59
0
  self->SetTarget(NonNullHelper(Constify(arg0)), rv);
60
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
61
0
    return false;
62
0
  }
63
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
64
0
65
0
  return true;
66
0
}
67
68
static const JSJitInfo target_getterinfo = {
69
  { (JSJitGetterOp)get_target },
70
  { prototypes::id::HTMLAnchorElement },
71
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
72
  JSJitInfo::Getter,
73
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
74
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
75
  false,  /* isInfallible. False in setters. */
76
  false,  /* isMovable.  Not relevant for setters. */
77
  false, /* isEliminatable.  Not relevant for setters. */
78
  false, /* isAlwaysInSlot.  Only relevant for getters. */
79
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
80
  false,  /* isTypedMethod.  Only relevant for methods. */
81
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
82
};
83
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
84
static_assert(0 < 1, "There is no slot for us");
85
static const JSJitInfo target_setterinfo = {
86
  { (JSJitGetterOp)set_target },
87
  { prototypes::id::HTMLAnchorElement },
88
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
89
  JSJitInfo::Setter,
90
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
91
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
92
  false,  /* isInfallible. False in setters. */
93
  false,  /* isMovable.  Not relevant for setters. */
94
  false, /* isEliminatable.  Not relevant for setters. */
95
  false, /* isAlwaysInSlot.  Only relevant for getters. */
96
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
97
  false,  /* isTypedMethod.  Only relevant for methods. */
98
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
99
};
100
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
101
static_assert(0 < 1, "There is no slot for us");
102
103
MOZ_CAN_RUN_SCRIPT static bool
104
get_download(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
105
0
{
106
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.download", DOM, cx);
107
0
108
0
  DOMString result;
109
0
  self->GetDownload(result);
110
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
111
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
112
0
    return false;
113
0
  }
114
0
  return true;
115
0
}
116
117
MOZ_CAN_RUN_SCRIPT static bool
118
set_download(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
119
0
{
120
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.download", DOM, cx);
121
0
122
0
  binding_detail::FakeString arg0;
123
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
124
0
    return false;
125
0
  }
126
0
  Maybe<AutoCEReaction> ceReaction;
127
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
128
0
    DocGroup* docGroup = self->GetDocGroup();
129
0
    if (docGroup) {
130
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
131
0
    }
132
0
  }
133
0
  FastErrorResult rv;
134
0
  self->SetDownload(NonNullHelper(Constify(arg0)), rv);
135
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
136
0
    return false;
137
0
  }
138
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
139
0
140
0
  return true;
141
0
}
142
143
static const JSJitInfo download_getterinfo = {
144
  { (JSJitGetterOp)get_download },
145
  { prototypes::id::HTMLAnchorElement },
146
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
147
  JSJitInfo::Getter,
148
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
149
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
150
  false,  /* isInfallible. False in setters. */
151
  false,  /* isMovable.  Not relevant for setters. */
152
  false, /* isEliminatable.  Not relevant for setters. */
153
  false, /* isAlwaysInSlot.  Only relevant for getters. */
154
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
155
  false,  /* isTypedMethod.  Only relevant for methods. */
156
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
157
};
158
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
159
static_assert(0 < 1, "There is no slot for us");
160
static const JSJitInfo download_setterinfo = {
161
  { (JSJitGetterOp)set_download },
162
  { prototypes::id::HTMLAnchorElement },
163
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
164
  JSJitInfo::Setter,
165
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
166
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
167
  false,  /* isInfallible. False in setters. */
168
  false,  /* isMovable.  Not relevant for setters. */
169
  false, /* isEliminatable.  Not relevant for setters. */
170
  false, /* isAlwaysInSlot.  Only relevant for getters. */
171
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
172
  false,  /* isTypedMethod.  Only relevant for methods. */
173
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
174
};
175
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
176
static_assert(0 < 1, "There is no slot for us");
177
178
MOZ_CAN_RUN_SCRIPT static bool
179
get_ping(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
180
0
{
181
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.ping", DOM, cx);
182
0
183
0
  DOMString result;
184
0
  self->GetPing(result);
185
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
186
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
187
0
    return false;
188
0
  }
189
0
  return true;
190
0
}
191
192
MOZ_CAN_RUN_SCRIPT static bool
193
set_ping(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
194
0
{
195
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.ping", DOM, cx);
196
0
197
0
  binding_detail::FakeString arg0;
198
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
199
0
    return false;
200
0
  }
201
0
  Maybe<AutoCEReaction> ceReaction;
202
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
203
0
    DocGroup* docGroup = self->GetDocGroup();
204
0
    if (docGroup) {
205
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
206
0
    }
207
0
  }
208
0
  FastErrorResult rv;
209
0
  self->SetPing(NonNullHelper(Constify(arg0)), rv);
210
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
211
0
    return false;
212
0
  }
213
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
214
0
215
0
  return true;
216
0
}
217
218
static const JSJitInfo ping_getterinfo = {
219
  { (JSJitGetterOp)get_ping },
220
  { prototypes::id::HTMLAnchorElement },
221
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
222
  JSJitInfo::Getter,
223
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
224
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
225
  false,  /* isInfallible. False in setters. */
226
  false,  /* isMovable.  Not relevant for setters. */
227
  false, /* isEliminatable.  Not relevant for setters. */
228
  false, /* isAlwaysInSlot.  Only relevant for getters. */
229
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
230
  false,  /* isTypedMethod.  Only relevant for methods. */
231
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
232
};
233
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
234
static_assert(0 < 1, "There is no slot for us");
235
static const JSJitInfo ping_setterinfo = {
236
  { (JSJitGetterOp)set_ping },
237
  { prototypes::id::HTMLAnchorElement },
238
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
239
  JSJitInfo::Setter,
240
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
241
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
242
  false,  /* isInfallible. False in setters. */
243
  false,  /* isMovable.  Not relevant for setters. */
244
  false, /* isEliminatable.  Not relevant for setters. */
245
  false, /* isAlwaysInSlot.  Only relevant for getters. */
246
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
247
  false,  /* isTypedMethod.  Only relevant for methods. */
248
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
249
};
250
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
251
static_assert(0 < 1, "There is no slot for us");
252
253
MOZ_CAN_RUN_SCRIPT static bool
254
get_rel(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
255
0
{
256
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.rel", DOM, cx);
257
0
258
0
  DOMString result;
259
0
  self->GetRel(result);
260
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
261
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
262
0
    return false;
263
0
  }
264
0
  return true;
265
0
}
266
267
MOZ_CAN_RUN_SCRIPT static bool
268
set_rel(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
269
0
{
270
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.rel", DOM, cx);
271
0
272
0
  binding_detail::FakeString arg0;
273
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
274
0
    return false;
275
0
  }
276
0
  Maybe<AutoCEReaction> ceReaction;
277
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
278
0
    DocGroup* docGroup = self->GetDocGroup();
279
0
    if (docGroup) {
280
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
281
0
    }
282
0
  }
283
0
  FastErrorResult rv;
284
0
  self->SetRel(NonNullHelper(Constify(arg0)), rv);
285
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
286
0
    return false;
287
0
  }
288
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
289
0
290
0
  return true;
291
0
}
292
293
static const JSJitInfo rel_getterinfo = {
294
  { (JSJitGetterOp)get_rel },
295
  { prototypes::id::HTMLAnchorElement },
296
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
297
  JSJitInfo::Getter,
298
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
299
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
300
  false,  /* isInfallible. False in setters. */
301
  false,  /* isMovable.  Not relevant for setters. */
302
  false, /* isEliminatable.  Not relevant for setters. */
303
  false, /* isAlwaysInSlot.  Only relevant for getters. */
304
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
305
  false,  /* isTypedMethod.  Only relevant for methods. */
306
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
307
};
308
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
309
static_assert(0 < 1, "There is no slot for us");
310
static const JSJitInfo rel_setterinfo = {
311
  { (JSJitGetterOp)set_rel },
312
  { prototypes::id::HTMLAnchorElement },
313
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
314
  JSJitInfo::Setter,
315
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
316
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
317
  false,  /* isInfallible. False in setters. */
318
  false,  /* isMovable.  Not relevant for setters. */
319
  false, /* isEliminatable.  Not relevant for setters. */
320
  false, /* isAlwaysInSlot.  Only relevant for getters. */
321
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
322
  false,  /* isTypedMethod.  Only relevant for methods. */
323
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
324
};
325
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
326
static_assert(0 < 1, "There is no slot for us");
327
328
MOZ_CAN_RUN_SCRIPT static bool
329
get_referrerPolicy(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
330
0
{
331
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.referrerPolicy", DOM, cx);
332
0
333
0
  DOMString result;
334
0
  self->GetReferrerPolicy(result);
335
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
336
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
337
0
    return false;
338
0
  }
339
0
  return true;
340
0
}
341
342
MOZ_CAN_RUN_SCRIPT static bool
343
set_referrerPolicy(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
344
0
{
345
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.referrerPolicy", DOM, cx);
346
0
347
0
  binding_detail::FakeString arg0;
348
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
349
0
    return false;
350
0
  }
351
0
  Maybe<AutoCEReaction> ceReaction;
352
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
353
0
    DocGroup* docGroup = self->GetDocGroup();
354
0
    if (docGroup) {
355
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
356
0
    }
357
0
  }
358
0
  FastErrorResult rv;
359
0
  self->SetReferrerPolicy(NonNullHelper(Constify(arg0)), rv);
360
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
361
0
    return false;
362
0
  }
363
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
364
0
365
0
  return true;
366
0
}
367
368
static const JSJitInfo referrerPolicy_getterinfo = {
369
  { (JSJitGetterOp)get_referrerPolicy },
370
  { prototypes::id::HTMLAnchorElement },
371
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
372
  JSJitInfo::Getter,
373
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
374
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
375
  false,  /* isInfallible. False in setters. */
376
  false,  /* isMovable.  Not relevant for setters. */
377
  false, /* isEliminatable.  Not relevant for setters. */
378
  false, /* isAlwaysInSlot.  Only relevant for getters. */
379
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
380
  false,  /* isTypedMethod.  Only relevant for methods. */
381
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
382
};
383
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
384
static_assert(0 < 1, "There is no slot for us");
385
static const JSJitInfo referrerPolicy_setterinfo = {
386
  { (JSJitGetterOp)set_referrerPolicy },
387
  { prototypes::id::HTMLAnchorElement },
388
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
389
  JSJitInfo::Setter,
390
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
391
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
392
  false,  /* isInfallible. False in setters. */
393
  false,  /* isMovable.  Not relevant for setters. */
394
  false, /* isEliminatable.  Not relevant for setters. */
395
  false, /* isAlwaysInSlot.  Only relevant for getters. */
396
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
397
  false,  /* isTypedMethod.  Only relevant for methods. */
398
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
399
};
400
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
401
static_assert(0 < 1, "There is no slot for us");
402
403
MOZ_CAN_RUN_SCRIPT static bool
404
get_relList(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
405
0
{
406
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.relList", DOM, cx);
407
0
408
0
  auto result(StrongOrRawPtr<nsDOMTokenList>(self->RelList()));
409
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
410
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
411
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
412
0
    return false;
413
0
  }
414
0
  return true;
415
0
}
416
417
MOZ_CAN_RUN_SCRIPT static bool
418
set_relList(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
419
0
{
420
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.relList", DOM, cx);
421
0
422
0
  JS::Rooted<JS::Value> v(cx);
423
0
  if (!JS_GetProperty(cx, obj, "relList", &v)) {
424
0
    return false;
425
0
  }
426
0
427
0
  if (!v.isObject()) {
428
0
    return ThrowErrorMessage(cx, MSG_NOT_OBJECT, "HTMLAnchorElement.relList");
429
0
  }
430
0
431
0
  JS::Rooted<JSObject*> targetObj(cx, &v.toObject());
432
0
  return JS_SetProperty(cx, targetObj, "value", args[0]);
433
0
}
434
435
static const JSJitInfo relList_getterinfo = {
436
  { (JSJitGetterOp)get_relList },
437
  { prototypes::id::HTMLAnchorElement },
438
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
439
  JSJitInfo::Getter,
440
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
441
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
442
  false,  /* isInfallible. False in setters. */
443
  false,  /* isMovable.  Not relevant for setters. */
444
  false, /* isEliminatable.  Not relevant for setters. */
445
  false, /* isAlwaysInSlot.  Only relevant for getters. */
446
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
447
  false,  /* isTypedMethod.  Only relevant for methods. */
448
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
449
};
450
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
451
static_assert(0 < 1, "There is no slot for us");
452
static const JSJitInfo relList_setterinfo = {
453
  { (JSJitGetterOp)set_relList },
454
  { prototypes::id::HTMLAnchorElement },
455
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
456
  JSJitInfo::Setter,
457
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
458
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
459
  false,  /* isInfallible. False in setters. */
460
  false,  /* isMovable.  Not relevant for setters. */
461
  false, /* isEliminatable.  Not relevant for setters. */
462
  false, /* isAlwaysInSlot.  Only relevant for getters. */
463
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
464
  false,  /* isTypedMethod.  Only relevant for methods. */
465
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
466
};
467
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
468
static_assert(0 < 1, "There is no slot for us");
469
470
MOZ_CAN_RUN_SCRIPT static bool
471
get_hreflang(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
472
0
{
473
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.hreflang", DOM, cx);
474
0
475
0
  DOMString result;
476
0
  self->GetHreflang(result);
477
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
478
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
479
0
    return false;
480
0
  }
481
0
  return true;
482
0
}
483
484
MOZ_CAN_RUN_SCRIPT static bool
485
set_hreflang(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
486
0
{
487
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.hreflang", DOM, cx);
488
0
489
0
  binding_detail::FakeString arg0;
490
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
491
0
    return false;
492
0
  }
493
0
  Maybe<AutoCEReaction> ceReaction;
494
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
495
0
    DocGroup* docGroup = self->GetDocGroup();
496
0
    if (docGroup) {
497
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
498
0
    }
499
0
  }
500
0
  FastErrorResult rv;
501
0
  self->SetHreflang(NonNullHelper(Constify(arg0)), rv);
502
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
503
0
    return false;
504
0
  }
505
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
506
0
507
0
  return true;
508
0
}
509
510
static const JSJitInfo hreflang_getterinfo = {
511
  { (JSJitGetterOp)get_hreflang },
512
  { prototypes::id::HTMLAnchorElement },
513
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
514
  JSJitInfo::Getter,
515
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
516
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
517
  false,  /* isInfallible. False in setters. */
518
  false,  /* isMovable.  Not relevant for setters. */
519
  false, /* isEliminatable.  Not relevant for setters. */
520
  false, /* isAlwaysInSlot.  Only relevant for getters. */
521
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
522
  false,  /* isTypedMethod.  Only relevant for methods. */
523
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
524
};
525
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
526
static_assert(0 < 1, "There is no slot for us");
527
static const JSJitInfo hreflang_setterinfo = {
528
  { (JSJitGetterOp)set_hreflang },
529
  { prototypes::id::HTMLAnchorElement },
530
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
531
  JSJitInfo::Setter,
532
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
533
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
534
  false,  /* isInfallible. False in setters. */
535
  false,  /* isMovable.  Not relevant for setters. */
536
  false, /* isEliminatable.  Not relevant for setters. */
537
  false, /* isAlwaysInSlot.  Only relevant for getters. */
538
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
539
  false,  /* isTypedMethod.  Only relevant for methods. */
540
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
541
};
542
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
543
static_assert(0 < 1, "There is no slot for us");
544
545
MOZ_CAN_RUN_SCRIPT static bool
546
get_type(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
547
0
{
548
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.type", DOM, cx);
549
0
550
0
  DOMString result;
551
0
  self->GetType(result);
552
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
553
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
554
0
    return false;
555
0
  }
556
0
  return true;
557
0
}
558
559
MOZ_CAN_RUN_SCRIPT static bool
560
set_type(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
561
0
{
562
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.type", DOM, cx);
563
0
564
0
  binding_detail::FakeString arg0;
565
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
566
0
    return false;
567
0
  }
568
0
  Maybe<AutoCEReaction> ceReaction;
569
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
570
0
    DocGroup* docGroup = self->GetDocGroup();
571
0
    if (docGroup) {
572
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
573
0
    }
574
0
  }
575
0
  FastErrorResult rv;
576
0
  self->SetType(NonNullHelper(Constify(arg0)), rv);
577
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
578
0
    return false;
579
0
  }
580
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
581
0
582
0
  return true;
583
0
}
584
585
static const JSJitInfo type_getterinfo = {
586
  { (JSJitGetterOp)get_type },
587
  { prototypes::id::HTMLAnchorElement },
588
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
589
  JSJitInfo::Getter,
590
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
591
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
592
  false,  /* isInfallible. False in setters. */
593
  false,  /* isMovable.  Not relevant for setters. */
594
  false, /* isEliminatable.  Not relevant for setters. */
595
  false, /* isAlwaysInSlot.  Only relevant for getters. */
596
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
597
  false,  /* isTypedMethod.  Only relevant for methods. */
598
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
599
};
600
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
601
static_assert(0 < 1, "There is no slot for us");
602
static const JSJitInfo type_setterinfo = {
603
  { (JSJitGetterOp)set_type },
604
  { prototypes::id::HTMLAnchorElement },
605
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
606
  JSJitInfo::Setter,
607
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
608
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
609
  false,  /* isInfallible. False in setters. */
610
  false,  /* isMovable.  Not relevant for setters. */
611
  false, /* isEliminatable.  Not relevant for setters. */
612
  false, /* isAlwaysInSlot.  Only relevant for getters. */
613
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
614
  false,  /* isTypedMethod.  Only relevant for methods. */
615
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
616
};
617
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
618
static_assert(0 < 1, "There is no slot for us");
619
620
MOZ_CAN_RUN_SCRIPT static bool
621
get_text(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
622
0
{
623
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.text", DOM, cx);
624
0
625
0
  FastErrorResult rv;
626
0
  DOMString result;
627
0
  self->GetText(result, rv);
628
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
629
0
    return false;
630
0
  }
631
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
632
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
633
0
    return false;
634
0
  }
635
0
  return true;
636
0
}
637
638
MOZ_CAN_RUN_SCRIPT static bool
639
set_text(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
640
0
{
641
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.text", DOM, cx);
642
0
643
0
  binding_detail::FakeString arg0;
644
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
645
0
    return false;
646
0
  }
647
0
  Maybe<AutoCEReaction> ceReaction;
648
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
649
0
    DocGroup* docGroup = self->GetDocGroup();
650
0
    if (docGroup) {
651
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
652
0
    }
653
0
  }
654
0
  FastErrorResult rv;
655
0
  self->SetText(NonNullHelper(Constify(arg0)), rv);
656
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
657
0
    return false;
658
0
  }
659
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
660
0
661
0
  return true;
662
0
}
663
664
static const JSJitInfo text_getterinfo = {
665
  { (JSJitGetterOp)get_text },
666
  { prototypes::id::HTMLAnchorElement },
667
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
668
  JSJitInfo::Getter,
669
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
670
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
671
  false,  /* isInfallible. False in setters. */
672
  false,  /* isMovable.  Not relevant for setters. */
673
  false, /* isEliminatable.  Not relevant for setters. */
674
  false, /* isAlwaysInSlot.  Only relevant for getters. */
675
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
676
  false,  /* isTypedMethod.  Only relevant for methods. */
677
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
678
};
679
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
680
static_assert(0 < 1, "There is no slot for us");
681
static const JSJitInfo text_setterinfo = {
682
  { (JSJitGetterOp)set_text },
683
  { prototypes::id::HTMLAnchorElement },
684
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
685
  JSJitInfo::Setter,
686
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
687
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
688
  false,  /* isInfallible. False in setters. */
689
  false,  /* isMovable.  Not relevant for setters. */
690
  false, /* isEliminatable.  Not relevant for setters. */
691
  false, /* isAlwaysInSlot.  Only relevant for getters. */
692
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
693
  false,  /* isTypedMethod.  Only relevant for methods. */
694
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
695
};
696
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
697
static_assert(0 < 1, "There is no slot for us");
698
699
MOZ_CAN_RUN_SCRIPT static bool
700
get_coords(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
701
0
{
702
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.coords", DOM, cx);
703
0
704
0
  DOMString result;
705
0
  self->GetCoords(result);
706
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
707
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
708
0
    return false;
709
0
  }
710
0
  return true;
711
0
}
712
713
MOZ_CAN_RUN_SCRIPT static bool
714
set_coords(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
715
0
{
716
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.coords", DOM, cx);
717
0
718
0
  binding_detail::FakeString arg0;
719
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
720
0
    return false;
721
0
  }
722
0
  Maybe<AutoCEReaction> ceReaction;
723
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
724
0
    DocGroup* docGroup = self->GetDocGroup();
725
0
    if (docGroup) {
726
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
727
0
    }
728
0
  }
729
0
  FastErrorResult rv;
730
0
  self->SetCoords(NonNullHelper(Constify(arg0)), rv);
731
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
732
0
    return false;
733
0
  }
734
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
735
0
736
0
  return true;
737
0
}
738
739
static const JSJitInfo coords_getterinfo = {
740
  { (JSJitGetterOp)get_coords },
741
  { prototypes::id::HTMLAnchorElement },
742
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
743
  JSJitInfo::Getter,
744
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
745
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
746
  false,  /* isInfallible. False in setters. */
747
  false,  /* isMovable.  Not relevant for setters. */
748
  false, /* isEliminatable.  Not relevant for setters. */
749
  false, /* isAlwaysInSlot.  Only relevant for getters. */
750
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
751
  false,  /* isTypedMethod.  Only relevant for methods. */
752
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
753
};
754
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
755
static_assert(0 < 1, "There is no slot for us");
756
static const JSJitInfo coords_setterinfo = {
757
  { (JSJitGetterOp)set_coords },
758
  { prototypes::id::HTMLAnchorElement },
759
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
760
  JSJitInfo::Setter,
761
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
762
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
763
  false,  /* isInfallible. False in setters. */
764
  false,  /* isMovable.  Not relevant for setters. */
765
  false, /* isEliminatable.  Not relevant for setters. */
766
  false, /* isAlwaysInSlot.  Only relevant for getters. */
767
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
768
  false,  /* isTypedMethod.  Only relevant for methods. */
769
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
770
};
771
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
772
static_assert(0 < 1, "There is no slot for us");
773
774
MOZ_CAN_RUN_SCRIPT static bool
775
get_charset(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
776
0
{
777
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.charset", DOM, cx);
778
0
779
0
  DOMString result;
780
0
  self->GetCharset(result);
781
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
782
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
783
0
    return false;
784
0
  }
785
0
  return true;
786
0
}
787
788
MOZ_CAN_RUN_SCRIPT static bool
789
set_charset(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
790
0
{
791
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.charset", DOM, cx);
792
0
793
0
  binding_detail::FakeString arg0;
794
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
795
0
    return false;
796
0
  }
797
0
  Maybe<AutoCEReaction> ceReaction;
798
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
799
0
    DocGroup* docGroup = self->GetDocGroup();
800
0
    if (docGroup) {
801
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
802
0
    }
803
0
  }
804
0
  FastErrorResult rv;
805
0
  self->SetCharset(NonNullHelper(Constify(arg0)), rv);
806
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
807
0
    return false;
808
0
  }
809
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
810
0
811
0
  return true;
812
0
}
813
814
static const JSJitInfo charset_getterinfo = {
815
  { (JSJitGetterOp)get_charset },
816
  { prototypes::id::HTMLAnchorElement },
817
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
818
  JSJitInfo::Getter,
819
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
820
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
821
  false,  /* isInfallible. False in setters. */
822
  false,  /* isMovable.  Not relevant for setters. */
823
  false, /* isEliminatable.  Not relevant for setters. */
824
  false, /* isAlwaysInSlot.  Only relevant for getters. */
825
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
826
  false,  /* isTypedMethod.  Only relevant for methods. */
827
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
828
};
829
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
830
static_assert(0 < 1, "There is no slot for us");
831
static const JSJitInfo charset_setterinfo = {
832
  { (JSJitGetterOp)set_charset },
833
  { prototypes::id::HTMLAnchorElement },
834
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
835
  JSJitInfo::Setter,
836
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
837
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
838
  false,  /* isInfallible. False in setters. */
839
  false,  /* isMovable.  Not relevant for setters. */
840
  false, /* isEliminatable.  Not relevant for setters. */
841
  false, /* isAlwaysInSlot.  Only relevant for getters. */
842
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
843
  false,  /* isTypedMethod.  Only relevant for methods. */
844
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
845
};
846
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
847
static_assert(0 < 1, "There is no slot for us");
848
849
MOZ_CAN_RUN_SCRIPT static bool
850
get_name(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
851
0
{
852
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.name", DOM, cx);
853
0
854
0
  DOMString result;
855
0
  self->GetName(result);
856
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
857
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
858
0
    return false;
859
0
  }
860
0
  return true;
861
0
}
862
863
MOZ_CAN_RUN_SCRIPT static bool
864
set_name(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
865
0
{
866
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.name", DOM, cx);
867
0
868
0
  binding_detail::FakeString arg0;
869
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
870
0
    return false;
871
0
  }
872
0
  Maybe<AutoCEReaction> ceReaction;
873
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
874
0
    DocGroup* docGroup = self->GetDocGroup();
875
0
    if (docGroup) {
876
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
877
0
    }
878
0
  }
879
0
  FastErrorResult rv;
880
0
  self->SetName(NonNullHelper(Constify(arg0)), rv);
881
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
882
0
    return false;
883
0
  }
884
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
885
0
886
0
  return true;
887
0
}
888
889
static const JSJitInfo name_getterinfo = {
890
  { (JSJitGetterOp)get_name },
891
  { prototypes::id::HTMLAnchorElement },
892
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
893
  JSJitInfo::Getter,
894
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
895
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
896
  false,  /* isInfallible. False in setters. */
897
  false,  /* isMovable.  Not relevant for setters. */
898
  false, /* isEliminatable.  Not relevant for setters. */
899
  false, /* isAlwaysInSlot.  Only relevant for getters. */
900
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
901
  false,  /* isTypedMethod.  Only relevant for methods. */
902
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
903
};
904
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
905
static_assert(0 < 1, "There is no slot for us");
906
static const JSJitInfo name_setterinfo = {
907
  { (JSJitGetterOp)set_name },
908
  { prototypes::id::HTMLAnchorElement },
909
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
910
  JSJitInfo::Setter,
911
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
912
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
913
  false,  /* isInfallible. False in setters. */
914
  false,  /* isMovable.  Not relevant for setters. */
915
  false, /* isEliminatable.  Not relevant for setters. */
916
  false, /* isAlwaysInSlot.  Only relevant for getters. */
917
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
918
  false,  /* isTypedMethod.  Only relevant for methods. */
919
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
920
};
921
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
922
static_assert(0 < 1, "There is no slot for us");
923
924
MOZ_CAN_RUN_SCRIPT static bool
925
get_rev(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
926
0
{
927
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.rev", DOM, cx);
928
0
929
0
  DOMString result;
930
0
  self->GetRev(result);
931
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
932
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
933
0
    return false;
934
0
  }
935
0
  return true;
936
0
}
937
938
MOZ_CAN_RUN_SCRIPT static bool
939
set_rev(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
940
0
{
941
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.rev", DOM, cx);
942
0
943
0
  binding_detail::FakeString arg0;
944
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
945
0
    return false;
946
0
  }
947
0
  Maybe<AutoCEReaction> ceReaction;
948
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
949
0
    DocGroup* docGroup = self->GetDocGroup();
950
0
    if (docGroup) {
951
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
952
0
    }
953
0
  }
954
0
  FastErrorResult rv;
955
0
  self->SetRev(NonNullHelper(Constify(arg0)), rv);
956
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
957
0
    return false;
958
0
  }
959
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
960
0
961
0
  return true;
962
0
}
963
964
static const JSJitInfo rev_getterinfo = {
965
  { (JSJitGetterOp)get_rev },
966
  { prototypes::id::HTMLAnchorElement },
967
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
968
  JSJitInfo::Getter,
969
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
970
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
971
  false,  /* isInfallible. False in setters. */
972
  false,  /* isMovable.  Not relevant for setters. */
973
  false, /* isEliminatable.  Not relevant for setters. */
974
  false, /* isAlwaysInSlot.  Only relevant for getters. */
975
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
976
  false,  /* isTypedMethod.  Only relevant for methods. */
977
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
978
};
979
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
980
static_assert(0 < 1, "There is no slot for us");
981
static const JSJitInfo rev_setterinfo = {
982
  { (JSJitGetterOp)set_rev },
983
  { prototypes::id::HTMLAnchorElement },
984
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
985
  JSJitInfo::Setter,
986
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
987
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
988
  false,  /* isInfallible. False in setters. */
989
  false,  /* isMovable.  Not relevant for setters. */
990
  false, /* isEliminatable.  Not relevant for setters. */
991
  false, /* isAlwaysInSlot.  Only relevant for getters. */
992
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
993
  false,  /* isTypedMethod.  Only relevant for methods. */
994
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
995
};
996
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
997
static_assert(0 < 1, "There is no slot for us");
998
999
MOZ_CAN_RUN_SCRIPT static bool
1000
get_shape(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
1001
0
{
1002
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.shape", DOM, cx);
1003
0
1004
0
  DOMString result;
1005
0
  self->GetShape(result);
1006
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1007
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
1008
0
    return false;
1009
0
  }
1010
0
  return true;
1011
0
}
1012
1013
MOZ_CAN_RUN_SCRIPT static bool
1014
set_shape(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
1015
0
{
1016
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.shape", DOM, cx);
1017
0
1018
0
  binding_detail::FakeString arg0;
1019
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1020
0
    return false;
1021
0
  }
1022
0
  Maybe<AutoCEReaction> ceReaction;
1023
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
1024
0
    DocGroup* docGroup = self->GetDocGroup();
1025
0
    if (docGroup) {
1026
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
1027
0
    }
1028
0
  }
1029
0
  FastErrorResult rv;
1030
0
  self->SetShape(NonNullHelper(Constify(arg0)), rv);
1031
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1032
0
    return false;
1033
0
  }
1034
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1035
0
1036
0
  return true;
1037
0
}
1038
1039
static const JSJitInfo shape_getterinfo = {
1040
  { (JSJitGetterOp)get_shape },
1041
  { prototypes::id::HTMLAnchorElement },
1042
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1043
  JSJitInfo::Getter,
1044
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1045
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
1046
  false,  /* isInfallible. False in setters. */
1047
  false,  /* isMovable.  Not relevant for setters. */
1048
  false, /* isEliminatable.  Not relevant for setters. */
1049
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1050
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1051
  false,  /* isTypedMethod.  Only relevant for methods. */
1052
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1053
};
1054
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1055
static_assert(0 < 1, "There is no slot for us");
1056
static const JSJitInfo shape_setterinfo = {
1057
  { (JSJitGetterOp)set_shape },
1058
  { prototypes::id::HTMLAnchorElement },
1059
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1060
  JSJitInfo::Setter,
1061
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1062
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1063
  false,  /* isInfallible. False in setters. */
1064
  false,  /* isMovable.  Not relevant for setters. */
1065
  false, /* isEliminatable.  Not relevant for setters. */
1066
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1067
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1068
  false,  /* isTypedMethod.  Only relevant for methods. */
1069
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1070
};
1071
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1072
static_assert(0 < 1, "There is no slot for us");
1073
1074
MOZ_CAN_RUN_SCRIPT static bool
1075
__stringifier(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, const JSJitMethodCallArgs& args)
1076
0
{
1077
0
  AUTO_PROFILER_LABEL_FAST("HTMLAnchorElement.__stringifier", DOM, cx);
1078
0
1079
0
  DOMString result;
1080
0
  self->Stringify(result);
1081
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1082
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
1083
0
    return false;
1084
0
  }
1085
0
  return true;
1086
0
}
1087
1088
static const JSJitInfo __stringifier_methodinfo = {
1089
  { (JSJitGetterOp)__stringifier },
1090
  { prototypes::id::HTMLAnchorElement },
1091
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1092
  JSJitInfo::Method,
1093
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1094
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
1095
  false,  /* isInfallible. False in setters. */
1096
  false,  /* isMovable.  Not relevant for setters. */
1097
  false, /* isEliminatable.  Not relevant for setters. */
1098
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1099
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1100
  false,  /* isTypedMethod.  Only relevant for methods. */
1101
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1102
};
1103
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1104
static_assert(0 < 1, "There is no slot for us");
1105
1106
MOZ_CAN_RUN_SCRIPT static bool
1107
get_href(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
1108
0
{
1109
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.href", DOM, cx);
1110
0
1111
0
  DOMString result;
1112
0
  self->GetHref(result);
1113
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1114
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
1115
0
    return false;
1116
0
  }
1117
0
  return true;
1118
0
}
1119
1120
MOZ_CAN_RUN_SCRIPT static bool
1121
set_href(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
1122
0
{
1123
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.href", DOM, cx);
1124
0
1125
0
  binding_detail::FakeString arg0;
1126
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1127
0
    return false;
1128
0
  }
1129
0
  NormalizeUSVString(arg0);
1130
0
  Maybe<AutoCEReaction> ceReaction;
1131
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
1132
0
    DocGroup* docGroup = self->GetDocGroup();
1133
0
    if (docGroup) {
1134
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
1135
0
    }
1136
0
  }
1137
0
  FastErrorResult rv;
1138
0
  self->SetHref(Constify(arg0), rv);
1139
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
1140
0
    return false;
1141
0
  }
1142
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1143
0
1144
0
  return true;
1145
0
}
1146
1147
static const JSJitInfo href_getterinfo = {
1148
  { (JSJitGetterOp)get_href },
1149
  { prototypes::id::HTMLAnchorElement },
1150
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1151
  JSJitInfo::Getter,
1152
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1153
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
1154
  false,  /* isInfallible. False in setters. */
1155
  false,  /* isMovable.  Not relevant for setters. */
1156
  false, /* isEliminatable.  Not relevant for setters. */
1157
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1158
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1159
  false,  /* isTypedMethod.  Only relevant for methods. */
1160
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1161
};
1162
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1163
static_assert(0 < 1, "There is no slot for us");
1164
static const JSJitInfo href_setterinfo = {
1165
  { (JSJitGetterOp)set_href },
1166
  { prototypes::id::HTMLAnchorElement },
1167
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1168
  JSJitInfo::Setter,
1169
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1170
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1171
  false,  /* isInfallible. False in setters. */
1172
  false,  /* isMovable.  Not relevant for setters. */
1173
  false, /* isEliminatable.  Not relevant for setters. */
1174
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1175
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1176
  false,  /* isTypedMethod.  Only relevant for methods. */
1177
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1178
};
1179
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1180
static_assert(0 < 1, "There is no slot for us");
1181
1182
MOZ_CAN_RUN_SCRIPT static bool
1183
get_origin(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
1184
0
{
1185
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.origin", DOM, cx);
1186
0
1187
0
  DOMString result;
1188
0
  self->GetOrigin(result);
1189
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1190
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
1191
0
    return false;
1192
0
  }
1193
0
  return true;
1194
0
}
1195
1196
static const JSJitInfo origin_getterinfo = {
1197
  { (JSJitGetterOp)get_origin },
1198
  { prototypes::id::HTMLAnchorElement },
1199
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1200
  JSJitInfo::Getter,
1201
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1202
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
1203
  false,  /* isInfallible. False in setters. */
1204
  false,  /* isMovable.  Not relevant for setters. */
1205
  false, /* isEliminatable.  Not relevant for setters. */
1206
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1207
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1208
  false,  /* isTypedMethod.  Only relevant for methods. */
1209
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1210
};
1211
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1212
static_assert(0 < 1, "There is no slot for us");
1213
1214
MOZ_CAN_RUN_SCRIPT static bool
1215
get_protocol(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
1216
0
{
1217
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.protocol", DOM, cx);
1218
0
1219
0
  DOMString result;
1220
0
  self->GetProtocol(result);
1221
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1222
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
1223
0
    return false;
1224
0
  }
1225
0
  return true;
1226
0
}
1227
1228
MOZ_CAN_RUN_SCRIPT static bool
1229
set_protocol(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
1230
0
{
1231
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.protocol", DOM, cx);
1232
0
1233
0
  binding_detail::FakeString arg0;
1234
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1235
0
    return false;
1236
0
  }
1237
0
  NormalizeUSVString(arg0);
1238
0
  Maybe<AutoCEReaction> ceReaction;
1239
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
1240
0
    DocGroup* docGroup = self->GetDocGroup();
1241
0
    if (docGroup) {
1242
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
1243
0
    }
1244
0
  }
1245
0
  self->SetProtocol(Constify(arg0));
1246
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1247
0
1248
0
  return true;
1249
0
}
1250
1251
static const JSJitInfo protocol_getterinfo = {
1252
  { (JSJitGetterOp)get_protocol },
1253
  { prototypes::id::HTMLAnchorElement },
1254
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1255
  JSJitInfo::Getter,
1256
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1257
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
1258
  false,  /* isInfallible. False in setters. */
1259
  false,  /* isMovable.  Not relevant for setters. */
1260
  false, /* isEliminatable.  Not relevant for setters. */
1261
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1262
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1263
  false,  /* isTypedMethod.  Only relevant for methods. */
1264
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1265
};
1266
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1267
static_assert(0 < 1, "There is no slot for us");
1268
static const JSJitInfo protocol_setterinfo = {
1269
  { (JSJitGetterOp)set_protocol },
1270
  { prototypes::id::HTMLAnchorElement },
1271
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1272
  JSJitInfo::Setter,
1273
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1274
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1275
  false,  /* isInfallible. False in setters. */
1276
  false,  /* isMovable.  Not relevant for setters. */
1277
  false, /* isEliminatable.  Not relevant for setters. */
1278
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1279
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1280
  false,  /* isTypedMethod.  Only relevant for methods. */
1281
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1282
};
1283
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1284
static_assert(0 < 1, "There is no slot for us");
1285
1286
MOZ_CAN_RUN_SCRIPT static bool
1287
get_username(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
1288
0
{
1289
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.username", DOM, cx);
1290
0
1291
0
  DOMString result;
1292
0
  self->GetUsername(result);
1293
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1294
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
1295
0
    return false;
1296
0
  }
1297
0
  return true;
1298
0
}
1299
1300
MOZ_CAN_RUN_SCRIPT static bool
1301
set_username(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
1302
0
{
1303
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.username", DOM, cx);
1304
0
1305
0
  binding_detail::FakeString arg0;
1306
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1307
0
    return false;
1308
0
  }
1309
0
  NormalizeUSVString(arg0);
1310
0
  Maybe<AutoCEReaction> ceReaction;
1311
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
1312
0
    DocGroup* docGroup = self->GetDocGroup();
1313
0
    if (docGroup) {
1314
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
1315
0
    }
1316
0
  }
1317
0
  self->SetUsername(Constify(arg0));
1318
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1319
0
1320
0
  return true;
1321
0
}
1322
1323
static const JSJitInfo username_getterinfo = {
1324
  { (JSJitGetterOp)get_username },
1325
  { prototypes::id::HTMLAnchorElement },
1326
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1327
  JSJitInfo::Getter,
1328
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1329
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
1330
  false,  /* isInfallible. False in setters. */
1331
  false,  /* isMovable.  Not relevant for setters. */
1332
  false, /* isEliminatable.  Not relevant for setters. */
1333
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1334
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1335
  false,  /* isTypedMethod.  Only relevant for methods. */
1336
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1337
};
1338
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1339
static_assert(0 < 1, "There is no slot for us");
1340
static const JSJitInfo username_setterinfo = {
1341
  { (JSJitGetterOp)set_username },
1342
  { prototypes::id::HTMLAnchorElement },
1343
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1344
  JSJitInfo::Setter,
1345
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1346
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1347
  false,  /* isInfallible. False in setters. */
1348
  false,  /* isMovable.  Not relevant for setters. */
1349
  false, /* isEliminatable.  Not relevant for setters. */
1350
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1351
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1352
  false,  /* isTypedMethod.  Only relevant for methods. */
1353
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1354
};
1355
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1356
static_assert(0 < 1, "There is no slot for us");
1357
1358
MOZ_CAN_RUN_SCRIPT static bool
1359
get_password(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
1360
0
{
1361
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.password", DOM, cx);
1362
0
1363
0
  DOMString result;
1364
0
  self->GetPassword(result);
1365
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1366
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
1367
0
    return false;
1368
0
  }
1369
0
  return true;
1370
0
}
1371
1372
MOZ_CAN_RUN_SCRIPT static bool
1373
set_password(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
1374
0
{
1375
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.password", DOM, cx);
1376
0
1377
0
  binding_detail::FakeString arg0;
1378
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1379
0
    return false;
1380
0
  }
1381
0
  NormalizeUSVString(arg0);
1382
0
  Maybe<AutoCEReaction> ceReaction;
1383
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
1384
0
    DocGroup* docGroup = self->GetDocGroup();
1385
0
    if (docGroup) {
1386
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
1387
0
    }
1388
0
  }
1389
0
  self->SetPassword(Constify(arg0));
1390
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1391
0
1392
0
  return true;
1393
0
}
1394
1395
static const JSJitInfo password_getterinfo = {
1396
  { (JSJitGetterOp)get_password },
1397
  { prototypes::id::HTMLAnchorElement },
1398
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1399
  JSJitInfo::Getter,
1400
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1401
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
1402
  false,  /* isInfallible. False in setters. */
1403
  false,  /* isMovable.  Not relevant for setters. */
1404
  false, /* isEliminatable.  Not relevant for setters. */
1405
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1406
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1407
  false,  /* isTypedMethod.  Only relevant for methods. */
1408
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1409
};
1410
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1411
static_assert(0 < 1, "There is no slot for us");
1412
static const JSJitInfo password_setterinfo = {
1413
  { (JSJitGetterOp)set_password },
1414
  { prototypes::id::HTMLAnchorElement },
1415
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1416
  JSJitInfo::Setter,
1417
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1418
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1419
  false,  /* isInfallible. False in setters. */
1420
  false,  /* isMovable.  Not relevant for setters. */
1421
  false, /* isEliminatable.  Not relevant for setters. */
1422
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1423
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1424
  false,  /* isTypedMethod.  Only relevant for methods. */
1425
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1426
};
1427
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1428
static_assert(0 < 1, "There is no slot for us");
1429
1430
MOZ_CAN_RUN_SCRIPT static bool
1431
get_host(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
1432
0
{
1433
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.host", DOM, cx);
1434
0
1435
0
  DOMString result;
1436
0
  self->GetHost(result);
1437
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1438
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
1439
0
    return false;
1440
0
  }
1441
0
  return true;
1442
0
}
1443
1444
MOZ_CAN_RUN_SCRIPT static bool
1445
set_host(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
1446
0
{
1447
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.host", DOM, cx);
1448
0
1449
0
  binding_detail::FakeString arg0;
1450
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1451
0
    return false;
1452
0
  }
1453
0
  NormalizeUSVString(arg0);
1454
0
  Maybe<AutoCEReaction> ceReaction;
1455
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
1456
0
    DocGroup* docGroup = self->GetDocGroup();
1457
0
    if (docGroup) {
1458
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
1459
0
    }
1460
0
  }
1461
0
  self->SetHost(Constify(arg0));
1462
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1463
0
1464
0
  return true;
1465
0
}
1466
1467
static const JSJitInfo host_getterinfo = {
1468
  { (JSJitGetterOp)get_host },
1469
  { prototypes::id::HTMLAnchorElement },
1470
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1471
  JSJitInfo::Getter,
1472
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1473
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
1474
  false,  /* isInfallible. False in setters. */
1475
  false,  /* isMovable.  Not relevant for setters. */
1476
  false, /* isEliminatable.  Not relevant for setters. */
1477
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1478
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1479
  false,  /* isTypedMethod.  Only relevant for methods. */
1480
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1481
};
1482
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1483
static_assert(0 < 1, "There is no slot for us");
1484
static const JSJitInfo host_setterinfo = {
1485
  { (JSJitGetterOp)set_host },
1486
  { prototypes::id::HTMLAnchorElement },
1487
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1488
  JSJitInfo::Setter,
1489
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1490
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1491
  false,  /* isInfallible. False in setters. */
1492
  false,  /* isMovable.  Not relevant for setters. */
1493
  false, /* isEliminatable.  Not relevant for setters. */
1494
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1495
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1496
  false,  /* isTypedMethod.  Only relevant for methods. */
1497
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1498
};
1499
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1500
static_assert(0 < 1, "There is no slot for us");
1501
1502
MOZ_CAN_RUN_SCRIPT static bool
1503
get_hostname(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
1504
0
{
1505
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.hostname", DOM, cx);
1506
0
1507
0
  DOMString result;
1508
0
  self->GetHostname(result);
1509
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1510
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
1511
0
    return false;
1512
0
  }
1513
0
  return true;
1514
0
}
1515
1516
MOZ_CAN_RUN_SCRIPT static bool
1517
set_hostname(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
1518
0
{
1519
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.hostname", DOM, cx);
1520
0
1521
0
  binding_detail::FakeString arg0;
1522
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1523
0
    return false;
1524
0
  }
1525
0
  NormalizeUSVString(arg0);
1526
0
  Maybe<AutoCEReaction> ceReaction;
1527
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
1528
0
    DocGroup* docGroup = self->GetDocGroup();
1529
0
    if (docGroup) {
1530
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
1531
0
    }
1532
0
  }
1533
0
  self->SetHostname(Constify(arg0));
1534
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1535
0
1536
0
  return true;
1537
0
}
1538
1539
static const JSJitInfo hostname_getterinfo = {
1540
  { (JSJitGetterOp)get_hostname },
1541
  { prototypes::id::HTMLAnchorElement },
1542
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1543
  JSJitInfo::Getter,
1544
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1545
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
1546
  false,  /* isInfallible. False in setters. */
1547
  false,  /* isMovable.  Not relevant for setters. */
1548
  false, /* isEliminatable.  Not relevant for setters. */
1549
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1550
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1551
  false,  /* isTypedMethod.  Only relevant for methods. */
1552
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1553
};
1554
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1555
static_assert(0 < 1, "There is no slot for us");
1556
static const JSJitInfo hostname_setterinfo = {
1557
  { (JSJitGetterOp)set_hostname },
1558
  { prototypes::id::HTMLAnchorElement },
1559
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1560
  JSJitInfo::Setter,
1561
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1562
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1563
  false,  /* isInfallible. False in setters. */
1564
  false,  /* isMovable.  Not relevant for setters. */
1565
  false, /* isEliminatable.  Not relevant for setters. */
1566
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1567
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1568
  false,  /* isTypedMethod.  Only relevant for methods. */
1569
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1570
};
1571
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1572
static_assert(0 < 1, "There is no slot for us");
1573
1574
MOZ_CAN_RUN_SCRIPT static bool
1575
get_port(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
1576
0
{
1577
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.port", DOM, cx);
1578
0
1579
0
  DOMString result;
1580
0
  self->GetPort(result);
1581
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1582
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
1583
0
    return false;
1584
0
  }
1585
0
  return true;
1586
0
}
1587
1588
MOZ_CAN_RUN_SCRIPT static bool
1589
set_port(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
1590
0
{
1591
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.port", DOM, cx);
1592
0
1593
0
  binding_detail::FakeString arg0;
1594
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1595
0
    return false;
1596
0
  }
1597
0
  NormalizeUSVString(arg0);
1598
0
  Maybe<AutoCEReaction> ceReaction;
1599
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
1600
0
    DocGroup* docGroup = self->GetDocGroup();
1601
0
    if (docGroup) {
1602
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
1603
0
    }
1604
0
  }
1605
0
  self->SetPort(Constify(arg0));
1606
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1607
0
1608
0
  return true;
1609
0
}
1610
1611
static const JSJitInfo port_getterinfo = {
1612
  { (JSJitGetterOp)get_port },
1613
  { prototypes::id::HTMLAnchorElement },
1614
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1615
  JSJitInfo::Getter,
1616
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1617
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
1618
  false,  /* isInfallible. False in setters. */
1619
  false,  /* isMovable.  Not relevant for setters. */
1620
  false, /* isEliminatable.  Not relevant for setters. */
1621
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1622
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1623
  false,  /* isTypedMethod.  Only relevant for methods. */
1624
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1625
};
1626
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1627
static_assert(0 < 1, "There is no slot for us");
1628
static const JSJitInfo port_setterinfo = {
1629
  { (JSJitGetterOp)set_port },
1630
  { prototypes::id::HTMLAnchorElement },
1631
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1632
  JSJitInfo::Setter,
1633
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1634
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1635
  false,  /* isInfallible. False in setters. */
1636
  false,  /* isMovable.  Not relevant for setters. */
1637
  false, /* isEliminatable.  Not relevant for setters. */
1638
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1639
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1640
  false,  /* isTypedMethod.  Only relevant for methods. */
1641
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1642
};
1643
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1644
static_assert(0 < 1, "There is no slot for us");
1645
1646
MOZ_CAN_RUN_SCRIPT static bool
1647
get_pathname(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
1648
0
{
1649
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.pathname", DOM, cx);
1650
0
1651
0
  DOMString result;
1652
0
  self->GetPathname(result);
1653
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1654
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
1655
0
    return false;
1656
0
  }
1657
0
  return true;
1658
0
}
1659
1660
MOZ_CAN_RUN_SCRIPT static bool
1661
set_pathname(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
1662
0
{
1663
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.pathname", DOM, cx);
1664
0
1665
0
  binding_detail::FakeString arg0;
1666
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1667
0
    return false;
1668
0
  }
1669
0
  NormalizeUSVString(arg0);
1670
0
  Maybe<AutoCEReaction> ceReaction;
1671
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
1672
0
    DocGroup* docGroup = self->GetDocGroup();
1673
0
    if (docGroup) {
1674
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
1675
0
    }
1676
0
  }
1677
0
  self->SetPathname(Constify(arg0));
1678
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1679
0
1680
0
  return true;
1681
0
}
1682
1683
static const JSJitInfo pathname_getterinfo = {
1684
  { (JSJitGetterOp)get_pathname },
1685
  { prototypes::id::HTMLAnchorElement },
1686
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1687
  JSJitInfo::Getter,
1688
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1689
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
1690
  false,  /* isInfallible. False in setters. */
1691
  false,  /* isMovable.  Not relevant for setters. */
1692
  false, /* isEliminatable.  Not relevant for setters. */
1693
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1694
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1695
  false,  /* isTypedMethod.  Only relevant for methods. */
1696
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1697
};
1698
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1699
static_assert(0 < 1, "There is no slot for us");
1700
static const JSJitInfo pathname_setterinfo = {
1701
  { (JSJitGetterOp)set_pathname },
1702
  { prototypes::id::HTMLAnchorElement },
1703
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1704
  JSJitInfo::Setter,
1705
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1706
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1707
  false,  /* isInfallible. False in setters. */
1708
  false,  /* isMovable.  Not relevant for setters. */
1709
  false, /* isEliminatable.  Not relevant for setters. */
1710
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1711
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1712
  false,  /* isTypedMethod.  Only relevant for methods. */
1713
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1714
};
1715
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1716
static_assert(0 < 1, "There is no slot for us");
1717
1718
MOZ_CAN_RUN_SCRIPT static bool
1719
get_search(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
1720
0
{
1721
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.search", DOM, cx);
1722
0
1723
0
  DOMString result;
1724
0
  self->GetSearch(result);
1725
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1726
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
1727
0
    return false;
1728
0
  }
1729
0
  return true;
1730
0
}
1731
1732
MOZ_CAN_RUN_SCRIPT static bool
1733
set_search(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
1734
0
{
1735
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.search", DOM, cx);
1736
0
1737
0
  binding_detail::FakeString arg0;
1738
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1739
0
    return false;
1740
0
  }
1741
0
  NormalizeUSVString(arg0);
1742
0
  Maybe<AutoCEReaction> ceReaction;
1743
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
1744
0
    DocGroup* docGroup = self->GetDocGroup();
1745
0
    if (docGroup) {
1746
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
1747
0
    }
1748
0
  }
1749
0
  self->SetSearch(Constify(arg0));
1750
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1751
0
1752
0
  return true;
1753
0
}
1754
1755
static const JSJitInfo search_getterinfo = {
1756
  { (JSJitGetterOp)get_search },
1757
  { prototypes::id::HTMLAnchorElement },
1758
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1759
  JSJitInfo::Getter,
1760
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1761
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
1762
  false,  /* isInfallible. False in setters. */
1763
  false,  /* isMovable.  Not relevant for setters. */
1764
  false, /* isEliminatable.  Not relevant for setters. */
1765
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1766
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1767
  false,  /* isTypedMethod.  Only relevant for methods. */
1768
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1769
};
1770
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1771
static_assert(0 < 1, "There is no slot for us");
1772
static const JSJitInfo search_setterinfo = {
1773
  { (JSJitGetterOp)set_search },
1774
  { prototypes::id::HTMLAnchorElement },
1775
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1776
  JSJitInfo::Setter,
1777
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1778
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1779
  false,  /* isInfallible. False in setters. */
1780
  false,  /* isMovable.  Not relevant for setters. */
1781
  false, /* isEliminatable.  Not relevant for setters. */
1782
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1783
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1784
  false,  /* isTypedMethod.  Only relevant for methods. */
1785
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1786
};
1787
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1788
static_assert(0 < 1, "There is no slot for us");
1789
1790
MOZ_CAN_RUN_SCRIPT static bool
1791
get_hash(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitGetterCallArgs args)
1792
0
{
1793
0
  AUTO_PROFILER_LABEL_FAST("get HTMLAnchorElement.hash", DOM, cx);
1794
0
1795
0
  DOMString result;
1796
0
  self->GetHash(result);
1797
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1798
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
1799
0
    return false;
1800
0
  }
1801
0
  return true;
1802
0
}
1803
1804
MOZ_CAN_RUN_SCRIPT static bool
1805
set_hash(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLAnchorElement* self, JSJitSetterCallArgs args)
1806
0
{
1807
0
  AUTO_PROFILER_LABEL_FAST("set HTMLAnchorElement.hash", DOM, cx);
1808
0
1809
0
  binding_detail::FakeString arg0;
1810
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
1811
0
    return false;
1812
0
  }
1813
0
  NormalizeUSVString(arg0);
1814
0
  Maybe<AutoCEReaction> ceReaction;
1815
0
  if (CustomElementRegistry::IsCustomElementEnabled(cx, obj)) {
1816
0
    DocGroup* docGroup = self->GetDocGroup();
1817
0
    if (docGroup) {
1818
0
      ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
1819
0
    }
1820
0
  }
1821
0
  self->SetHash(Constify(arg0));
1822
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1823
0
1824
0
  return true;
1825
0
}
1826
1827
static const JSJitInfo hash_getterinfo = {
1828
  { (JSJitGetterOp)get_hash },
1829
  { prototypes::id::HTMLAnchorElement },
1830
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1831
  JSJitInfo::Getter,
1832
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1833
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
1834
  false,  /* isInfallible. False in setters. */
1835
  false,  /* isMovable.  Not relevant for setters. */
1836
  false, /* isEliminatable.  Not relevant for setters. */
1837
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1838
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1839
  false,  /* isTypedMethod.  Only relevant for methods. */
1840
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1841
};
1842
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1843
static_assert(0 < 1, "There is no slot for us");
1844
static const JSJitInfo hash_setterinfo = {
1845
  { (JSJitGetterOp)set_hash },
1846
  { prototypes::id::HTMLAnchorElement },
1847
  { PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth },
1848
  JSJitInfo::Setter,
1849
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1850
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1851
  false,  /* isInfallible. False in setters. */
1852
  false,  /* isMovable.  Not relevant for setters. */
1853
  false, /* isEliminatable.  Not relevant for setters. */
1854
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1855
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1856
  false,  /* isTypedMethod.  Only relevant for methods. */
1857
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1858
};
1859
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1860
static_assert(0 < 1, "There is no slot for us");
1861
1862
static bool
1863
_addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
1864
0
{
1865
0
  mozilla::dom::HTMLAnchorElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLAnchorElement>(obj);
1866
0
  // We don't want to preserve if we don't have a wrapper, and we
1867
0
  // obviously can't preserve if we're not initialized.
1868
0
  if (self && self->GetWrapperPreserveColor()) {
1869
0
    PreserveWrapper(self);
1870
0
  }
1871
0
  return true;
1872
0
}
1873
1874
static void
1875
_finalize(js::FreeOp* fop, JSObject* obj)
1876
0
{
1877
0
  mozilla::dom::HTMLAnchorElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLAnchorElement>(obj);
1878
0
  if (self) {
1879
0
    ClearWrapper(self, self, obj);
1880
0
    AddForDeferredFinalization<mozilla::dom::HTMLAnchorElement>(self);
1881
0
  }
1882
0
}
1883
1884
static size_t
1885
_objectMoved(JSObject* obj, JSObject* old)
1886
0
{
1887
0
  mozilla::dom::HTMLAnchorElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLAnchorElement>(obj);
1888
0
  if (self) {
1889
0
    UpdateWrapper(self, self, obj, old);
1890
0
  }
1891
0
1892
0
  return 0;
1893
0
}
1894
1895
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
1896
#if defined(__clang__)
1897
#pragma clang diagnostic push
1898
#pragma clang diagnostic ignored "-Wmissing-braces"
1899
#endif
1900
static const JSFunctionSpec sMethods_specs[] = {
1901
  JS_FNSPEC("toString", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&__stringifier_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
1902
  JS_FS_END
1903
};
1904
#if defined(__clang__)
1905
#pragma clang diagnostic pop
1906
#endif
1907
1908
1909
static const Prefable<const JSFunctionSpec> sMethods[] = {
1910
  { nullptr, &sMethods_specs[0] },
1911
  { nullptr, nullptr }
1912
};
1913
1914
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
1915
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
1916
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
1917
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
1918
1919
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
1920
#if defined(__clang__)
1921
#pragma clang diagnostic push
1922
#pragma clang diagnostic ignored "-Wmissing-braces"
1923
#endif
1924
static const JSPropertySpec sAttributes_specs[] = {
1925
  { "target", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &target_getterinfo, GenericSetter<NormalThisPolicy>, &target_setterinfo },
1926
  { "download", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &download_getterinfo, GenericSetter<NormalThisPolicy>, &download_setterinfo },
1927
  { "ping", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ping_getterinfo, GenericSetter<NormalThisPolicy>, &ping_setterinfo },
1928
  { "rel", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &rel_getterinfo, GenericSetter<NormalThisPolicy>, &rel_setterinfo },
1929
  { "referrerPolicy", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &referrerPolicy_getterinfo, GenericSetter<NormalThisPolicy>, &referrerPolicy_setterinfo },
1930
  { "relList", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &relList_getterinfo, GenericSetter<NormalThisPolicy>, &relList_setterinfo },
1931
  { "hreflang", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &hreflang_getterinfo, GenericSetter<NormalThisPolicy>, &hreflang_setterinfo },
1932
  { "type", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &type_getterinfo, GenericSetter<NormalThisPolicy>, &type_setterinfo },
1933
  { "text", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &text_getterinfo, GenericSetter<NormalThisPolicy>, &text_setterinfo },
1934
  { "coords", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &coords_getterinfo, GenericSetter<NormalThisPolicy>, &coords_setterinfo },
1935
  { "charset", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &charset_getterinfo, GenericSetter<NormalThisPolicy>, &charset_setterinfo },
1936
  { "name", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &name_getterinfo, GenericSetter<NormalThisPolicy>, &name_setterinfo },
1937
  { "rev", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &rev_getterinfo, GenericSetter<NormalThisPolicy>, &rev_setterinfo },
1938
  { "shape", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &shape_getterinfo, GenericSetter<NormalThisPolicy>, &shape_setterinfo },
1939
  { "href", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &href_getterinfo, GenericSetter<NormalThisPolicy>, &href_setterinfo },
1940
  { "origin", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &origin_getterinfo, nullptr, nullptr },
1941
  { "protocol", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &protocol_getterinfo, GenericSetter<NormalThisPolicy>, &protocol_setterinfo },
1942
  { "username", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &username_getterinfo, GenericSetter<NormalThisPolicy>, &username_setterinfo },
1943
  { "password", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &password_getterinfo, GenericSetter<NormalThisPolicy>, &password_setterinfo },
1944
  { "host", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &host_getterinfo, GenericSetter<NormalThisPolicy>, &host_setterinfo },
1945
  { "hostname", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &hostname_getterinfo, GenericSetter<NormalThisPolicy>, &hostname_setterinfo },
1946
  { "port", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &port_getterinfo, GenericSetter<NormalThisPolicy>, &port_setterinfo },
1947
  { "pathname", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &pathname_getterinfo, GenericSetter<NormalThisPolicy>, &pathname_setterinfo },
1948
  { "search", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &search_getterinfo, GenericSetter<NormalThisPolicy>, &search_setterinfo },
1949
  { "hash", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &hash_getterinfo, GenericSetter<NormalThisPolicy>, &hash_setterinfo },
1950
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
1951
};
1952
#if defined(__clang__)
1953
#pragma clang diagnostic pop
1954
#endif
1955
1956
1957
static const Prefable<const JSPropertySpec> sAttributes[] = {
1958
  { nullptr, &sAttributes_specs[0] },
1959
  { nullptr, nullptr }
1960
};
1961
1962
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
1963
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
1964
static_assert(25 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
1965
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
1966
1967
1968
static uint16_t sNativeProperties_sortedPropertyIndices[26];
1969
static PropertyInfo sNativeProperties_propertyInfos[26];
1970
1971
static const NativePropertiesN<2> sNativeProperties = {
1972
  false, 0,
1973
  false, 0,
1974
  true,  0 /* sMethods */,
1975
  true,  1 /* sAttributes */,
1976
  false, 0,
1977
  false, 0,
1978
  false, 0,
1979
  -1,
1980
  26,
1981
  sNativeProperties_sortedPropertyIndices,
1982
  {
1983
    { sMethods, &sNativeProperties_propertyInfos[0] },
1984
    { sAttributes, &sNativeProperties_propertyInfos[1] }
1985
  }
1986
};
1987
static_assert(26 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
1988
    "We have a property info count that is oversized");
1989
1990
static bool
1991
_constructor(JSContext* cx, unsigned argc, JS::Value* vp)
1992
0
{
1993
0
  AUTO_PROFILER_LABEL_FAST("HTMLAnchorElement constructor", DOM, cx);
1994
0
1995
0
  return HTMLConstructor(cx, argc, vp,
1996
0
                         constructors::id::HTMLAnchorElement,
1997
0
                         prototypes::id::HTMLAnchorElement,
1998
0
                         CreateInterfaceObjects);
1999
0
}
2000
2001
static const js::ClassOps sInterfaceObjectClassOps = {
2002
    nullptr,               /* addProperty */
2003
    nullptr,               /* delProperty */
2004
    nullptr,               /* enumerate */
2005
    nullptr,               /* newEnumerate */
2006
    nullptr,               /* resolve */
2007
    nullptr,               /* mayResolve */
2008
    nullptr,               /* finalize */
2009
    _constructor, /* call */
2010
    nullptr,               /* hasInstance */
2011
    _constructor, /* construct */
2012
    nullptr,               /* trace */
2013
};
2014
2015
static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
2016
  {
2017
    "Function",
2018
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE),
2019
    &sInterfaceObjectClassOps,
2020
    JS_NULL_CLASS_SPEC,
2021
    JS_NULL_CLASS_EXT,
2022
    &sInterfaceObjectClassObjectOps
2023
  },
2024
  eInterface,
2025
  true,
2026
  prototypes::id::HTMLAnchorElement,
2027
  PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth,
2028
  sNativePropertyHooks,
2029
  "function HTMLAnchorElement() {\n    [native code]\n}",
2030
  HTMLElement_Binding::GetConstructorObject
2031
};
2032
2033
static const DOMIfaceAndProtoJSClass sPrototypeClass = {
2034
  {
2035
    "HTMLAnchorElementPrototype",
2036
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE),
2037
    JS_NULL_CLASS_OPS,
2038
    JS_NULL_CLASS_SPEC,
2039
    JS_NULL_CLASS_EXT,
2040
    JS_NULL_OBJECT_OPS
2041
  },
2042
  eInterfacePrototype,
2043
  false,
2044
  prototypes::id::HTMLAnchorElement,
2045
  PrototypeTraits<prototypes::id::HTMLAnchorElement>::Depth,
2046
  sNativePropertyHooks,
2047
  "[object HTMLAnchorElementPrototype]",
2048
  HTMLElement_Binding::GetProtoObject
2049
};
2050
2051
static const js::ClassOps sClassOps = {
2052
  _addProperty, /* addProperty */
2053
  nullptr,               /* delProperty */
2054
  nullptr,               /* enumerate */
2055
  nullptr, /* newEnumerate */
2056
  nullptr, /* resolve */
2057
  nullptr, /* mayResolve */
2058
  _finalize, /* finalize */
2059
  nullptr, /* call */
2060
  nullptr,               /* hasInstance */
2061
  nullptr,               /* construct */
2062
  nullptr, /* trace */
2063
};
2064
2065
static const js::ClassExtension sClassExtension = {
2066
  nullptr, /* weakmapKeyDelegateOp */
2067
  _objectMoved /* objectMovedOp */
2068
};
2069
2070
static const DOMJSClass sClass = {
2071
  { "HTMLAnchorElement",
2072
    JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
2073
    &sClassOps,
2074
    JS_NULL_CLASS_SPEC,
2075
    &sClassExtension,
2076
    JS_NULL_OBJECT_OPS
2077
  },
2078
  { prototypes::id::EventTarget, prototypes::id::Node, prototypes::id::Element, prototypes::id::HTMLElement, prototypes::id::HTMLAnchorElement, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
2079
  IsBaseOf<nsISupports, mozilla::dom::HTMLAnchorElement >::value,
2080
  sNativePropertyHooks,
2081
  FindAssociatedGlobalForNative<mozilla::dom::HTMLAnchorElement>::Get,
2082
  GetProtoObjectHandle,
2083
  GetCCParticipant<mozilla::dom::HTMLAnchorElement>::Get()
2084
};
2085
static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
2086
              "Must have the right minimal number of reserved slots.");
2087
static_assert(1 >= 1,
2088
              "Must have enough reserved slots.");
2089
2090
const JSClass*
2091
GetJSClass()
2092
0
{
2093
0
  return sClass.ToJSClass();
2094
0
}
2095
2096
bool
2097
Wrap(JSContext* aCx, mozilla::dom::HTMLAnchorElement* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
2098
0
{
2099
0
  static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::dom::HTMLAnchorElement>::value,
2100
0
                "Shouldn't have wrappercached things that are not refcounted.");
2101
0
  MOZ_ASSERT(static_cast<mozilla::dom::HTMLAnchorElement*>(aObject) ==
2102
0
             reinterpret_cast<mozilla::dom::HTMLAnchorElement*>(aObject),
2103
0
             "Multiple inheritance for mozilla::dom::HTMLAnchorElement is broken.");
2104
0
  MOZ_ASSERT(static_cast<nsGenericHTMLElement*>(aObject) ==
2105
0
             reinterpret_cast<nsGenericHTMLElement*>(aObject),
2106
0
             "Multiple inheritance for nsGenericHTMLElement is broken.");
2107
0
  MOZ_ASSERT(static_cast<mozilla::dom::Element*>(aObject) ==
2108
0
             reinterpret_cast<mozilla::dom::Element*>(aObject),
2109
0
             "Multiple inheritance for mozilla::dom::Element is broken.");
2110
0
  MOZ_ASSERT(static_cast<nsINode*>(aObject) ==
2111
0
             reinterpret_cast<nsINode*>(aObject),
2112
0
             "Multiple inheritance for nsINode is broken.");
2113
0
  MOZ_ASSERT(static_cast<mozilla::dom::EventTarget*>(aObject) ==
2114
0
             reinterpret_cast<mozilla::dom::EventTarget*>(aObject),
2115
0
             "Multiple inheritance for mozilla::dom::EventTarget is broken.");
2116
0
  MOZ_ASSERT(ToSupportsIsCorrect(aObject));
2117
0
  MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
2118
0
  MOZ_ASSERT(!aCache->GetWrapper(),
2119
0
             "You should probably not be using Wrap() directly; use "
2120
0
             "GetOrCreateDOMReflector instead");
2121
0
2122
0
  MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
2123
0
             "nsISupports must be on our primary inheritance chain");
2124
0
2125
0
  JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
2126
0
  if (!global) {
2127
0
    return false;
2128
0
  }
2129
0
  MOZ_ASSERT(JS_IsGlobalObject(global));
2130
0
  MOZ_ASSERT(JS::ObjectIsNotGray(global));
2131
0
2132
0
  // That might have ended up wrapping us already, due to the wonders
2133
0
  // of XBL.  Check for that, and bail out as needed.
2134
0
  aReflector.set(aCache->GetWrapper());
2135
0
  if (aReflector) {
2136
#ifdef DEBUG
2137
    AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
2138
#endif // DEBUG
2139
    return true;
2140
0
  }
2141
0
2142
0
  JSAutoRealm ar(aCx, global);
2143
0
  JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
2144
0
  if (!canonicalProto) {
2145
0
    return false;
2146
0
  }
2147
0
  JS::Rooted<JSObject*> proto(aCx);
2148
0
  if (aGivenProto) {
2149
0
    proto = aGivenProto;
2150
0
    // Unfortunately, while aGivenProto was in the compartment of aCx
2151
0
    // coming in, we changed compartments to that of "parent" so may need
2152
0
    // to wrap the proto here.
2153
0
    if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) {
2154
0
      if (!JS_WrapObject(aCx, &proto)) {
2155
0
        return false;
2156
0
      }
2157
0
    }
2158
0
  } else {
2159
0
    proto = canonicalProto;
2160
0
  }
2161
0
2162
0
  BindingJSObjectCreator<mozilla::dom::HTMLAnchorElement> creator(aCx);
2163
0
  creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
2164
0
  if (!aReflector) {
2165
0
    return false;
2166
0
  }
2167
0
2168
0
  aCache->SetWrapper(aReflector);
2169
0
  creator.InitializationSucceeded();
2170
0
2171
0
  MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&
2172
0
             aCache->GetWrapperPreserveColor() == aReflector);
2173
0
  // If proto != canonicalProto, we have to preserve our wrapper;
2174
0
  // otherwise we won't be able to properly recreate it later, since
2175
0
  // we won't know what proto to use.  Note that we don't check
2176
0
  // aGivenProto here, since it's entirely possible (and even
2177
0
  // somewhat common) to have a non-null aGivenProto which is the
2178
0
  // same as canonicalProto.
2179
0
  if (proto != canonicalProto) {
2180
0
    PreserveWrapper(aObject);
2181
0
  }
2182
0
2183
0
  return true;
2184
0
}
2185
2186
const NativePropertyHooks sNativePropertyHooks[] = { {
2187
  nullptr,
2188
  nullptr,
2189
  nullptr,
2190
  { sNativeProperties.Upcast(), nullptr },
2191
  prototypes::id::HTMLAnchorElement,
2192
  constructors::id::HTMLAnchorElement,
2193
  HTMLElement_Binding::sNativePropertyHooks,
2194
  &DefaultXrayExpandoObjectClass
2195
} };
2196
2197
void
2198
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
2199
0
{
2200
0
  JS::Handle<JSObject*> parentProto(HTMLElement_Binding::GetProtoObjectHandle(aCx));
2201
0
  if (!parentProto) {
2202
0
    return;
2203
0
  }
2204
0
2205
0
  JS::Handle<JSObject*> constructorProto(HTMLElement_Binding::GetConstructorObjectHandle(aCx));
2206
0
  if (!constructorProto) {
2207
0
    return;
2208
0
  }
2209
0
2210
0
  static bool sIdsInited = false;
2211
0
  if (!sIdsInited && NS_IsMainThread()) {
2212
0
    if (!InitIds(aCx, sNativeProperties.Upcast())) {
2213
0
      return;
2214
0
    }
2215
0
    sIdsInited = true;
2216
0
  }
2217
0
2218
0
  JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::HTMLAnchorElement);
2219
0
  JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::HTMLAnchorElement);
2220
0
  dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
2221
0
                              &sPrototypeClass.mBase, protoCache,
2222
0
                              nullptr,
2223
0
                              constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr,
2224
0
                              interfaceCache,
2225
0
                              sNativeProperties.Upcast(),
2226
0
                              nullptr,
2227
0
                              "HTMLAnchorElement", aDefineOnGlobal,
2228
0
                              nullptr,
2229
0
                              false);
2230
0
}
2231
2232
JSObject*
2233
GetConstructorObject(JSContext* aCx)
2234
0
{
2235
0
  return GetConstructorObjectHandle(aCx);
2236
0
}
2237
2238
} // namespace HTMLAnchorElement_Binding
2239
2240
2241
2242
} // namespace dom
2243
} // namespace mozilla