Coverage Report

Created: 2018-09-25 14:53

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