Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM HTMLFieldSetElement.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #include "HTMLElementBinding.h"
4 : #include "HTMLFieldSetElementBinding.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/HTMLFieldSetElement.h"
11 : #include "mozilla/dom/HTMLFormElement.h"
12 : #include "mozilla/dom/NonRefcountedDOMObject.h"
13 : #include "mozilla/dom/Nullable.h"
14 : #include "mozilla/dom/PrimitiveConversions.h"
15 : #include "mozilla/dom/ValidityState.h"
16 : #include "mozilla/dom/XrayExpandoClass.h"
17 : #include "nsContentList.h"
18 :
19 : namespace mozilla {
20 : namespace dom {
21 :
22 : namespace HTMLFieldSetElementBinding {
23 :
24 : static_assert(IsRefcounted<NativeType>::value == IsRefcounted<HTMLElementBinding::NativeType>::value,
25 : "Can't inherit from an interface with a different ownership model.");
26 :
27 : static bool
28 0 : get_disabled(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLFieldSetElement* self, JSJitGetterCallArgs args)
29 : {
30 0 : bool result(self->Disabled());
31 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
32 0 : args.rval().setBoolean(result);
33 0 : return true;
34 : }
35 :
36 : static bool
37 0 : set_disabled(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLFieldSetElement* self, JSJitSetterCallArgs args)
38 : {
39 : bool arg0;
40 0 : if (!ValueToPrimitive<bool, eDefault>(cx, args[0], &arg0)) {
41 0 : return false;
42 : }
43 0 : CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
44 0 : Maybe<AutoCEReaction> ceReaction;
45 0 : if (reactionsStack) {
46 0 : ceReaction.emplace(reactionsStack);
47 : }
48 0 : binding_detail::FastErrorResult rv;
49 0 : self->SetDisabled(arg0, rv);
50 0 : if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
51 0 : return false;
52 : }
53 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
54 :
55 0 : return true;
56 : }
57 :
58 : static const JSJitInfo disabled_getterinfo = {
59 : { (JSJitGetterOp)get_disabled },
60 : { prototypes::id::HTMLFieldSetElement },
61 : { PrototypeTraits<prototypes::id::HTMLFieldSetElement>::Depth },
62 : JSJitInfo::Getter,
63 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
64 : JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
65 : true, /* isInfallible. False in setters. */
66 : false, /* isMovable. Not relevant for setters. */
67 : false, /* isEliminatable. Not relevant for setters. */
68 : false, /* isAlwaysInSlot. Only relevant for getters. */
69 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
70 : false, /* isTypedMethod. Only relevant for methods. */
71 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
72 : };
73 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
74 : static_assert(0 < 1, "There is no slot for us");
75 : static const JSJitInfo disabled_setterinfo = {
76 : { (JSJitGetterOp)set_disabled },
77 : { prototypes::id::HTMLFieldSetElement },
78 : { PrototypeTraits<prototypes::id::HTMLFieldSetElement>::Depth },
79 : JSJitInfo::Setter,
80 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
81 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
82 : false, /* isInfallible. False in setters. */
83 : false, /* isMovable. Not relevant for setters. */
84 : false, /* 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 :
93 : static bool
94 0 : get_form(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLFieldSetElement* self, JSJitGetterCallArgs args)
95 : {
96 0 : auto result(StrongOrRawPtr<mozilla::dom::HTMLFormElement>(self->GetForm()));
97 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
98 0 : if (!result) {
99 0 : args.rval().setNull();
100 0 : return true;
101 : }
102 0 : if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
103 0 : MOZ_ASSERT(true || JS_IsExceptionPending(cx));
104 0 : return false;
105 : }
106 0 : return true;
107 : }
108 :
109 : static const JSJitInfo form_getterinfo = {
110 : { (JSJitGetterOp)get_form },
111 : { prototypes::id::HTMLFieldSetElement },
112 : { PrototypeTraits<prototypes::id::HTMLFieldSetElement>::Depth },
113 : JSJitInfo::Getter,
114 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
115 : JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
116 : false, /* isInfallible. False in setters. */
117 : false, /* isMovable. Not relevant for setters. */
118 : false, /* isEliminatable. Not relevant for setters. */
119 : false, /* isAlwaysInSlot. Only relevant for getters. */
120 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
121 : false, /* isTypedMethod. Only relevant for methods. */
122 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
123 : };
124 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
125 : static_assert(0 < 1, "There is no slot for us");
126 :
127 : static bool
128 0 : get_name(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLFieldSetElement* self, JSJitGetterCallArgs args)
129 : {
130 0 : DOMString result;
131 0 : self->GetName(result);
132 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
133 0 : if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
134 0 : return false;
135 : }
136 0 : return true;
137 : }
138 :
139 : static bool
140 0 : set_name(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLFieldSetElement* self, JSJitSetterCallArgs args)
141 : {
142 0 : binding_detail::FakeString arg0;
143 0 : if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
144 0 : return false;
145 : }
146 0 : CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
147 0 : Maybe<AutoCEReaction> ceReaction;
148 0 : if (reactionsStack) {
149 0 : ceReaction.emplace(reactionsStack);
150 : }
151 0 : binding_detail::FastErrorResult rv;
152 0 : self->SetName(NonNullHelper(Constify(arg0)), rv);
153 0 : if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
154 0 : return false;
155 : }
156 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
157 :
158 0 : return true;
159 : }
160 :
161 : static const JSJitInfo name_getterinfo = {
162 : { (JSJitGetterOp)get_name },
163 : { prototypes::id::HTMLFieldSetElement },
164 : { PrototypeTraits<prototypes::id::HTMLFieldSetElement>::Depth },
165 : JSJitInfo::Getter,
166 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
167 : JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
168 : false, /* isInfallible. False in setters. */
169 : false, /* isMovable. Not relevant for setters. */
170 : false, /* isEliminatable. Not relevant for setters. */
171 : false, /* isAlwaysInSlot. Only relevant for getters. */
172 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
173 : false, /* isTypedMethod. Only relevant for methods. */
174 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
175 : };
176 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
177 : static_assert(0 < 1, "There is no slot for us");
178 : static const JSJitInfo name_setterinfo = {
179 : { (JSJitGetterOp)set_name },
180 : { prototypes::id::HTMLFieldSetElement },
181 : { PrototypeTraits<prototypes::id::HTMLFieldSetElement>::Depth },
182 : JSJitInfo::Setter,
183 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
184 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
185 : false, /* isInfallible. False in setters. */
186 : false, /* isMovable. Not relevant for setters. */
187 : false, /* isEliminatable. Not relevant for setters. */
188 : false, /* isAlwaysInSlot. Only relevant for getters. */
189 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
190 : false, /* isTypedMethod. Only relevant for methods. */
191 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
192 : };
193 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
194 : static_assert(0 < 1, "There is no slot for us");
195 :
196 : static bool
197 0 : get_type(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLFieldSetElement* self, JSJitGetterCallArgs args)
198 : {
199 0 : DOMString result;
200 0 : self->GetType(result);
201 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
202 0 : if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
203 0 : return false;
204 : }
205 0 : return true;
206 : }
207 :
208 : static const JSJitInfo type_getterinfo = {
209 : { (JSJitGetterOp)get_type },
210 : { prototypes::id::HTMLFieldSetElement },
211 : { PrototypeTraits<prototypes::id::HTMLFieldSetElement>::Depth },
212 : JSJitInfo::Getter,
213 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
214 : JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
215 : false, /* isInfallible. False in setters. */
216 : false, /* isMovable. Not relevant for setters. */
217 : false, /* isEliminatable. Not relevant for setters. */
218 : false, /* isAlwaysInSlot. Only relevant for getters. */
219 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
220 : false, /* isTypedMethod. Only relevant for methods. */
221 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
222 : };
223 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
224 : static_assert(0 < 1, "There is no slot for us");
225 :
226 : static bool
227 0 : get_elements(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLFieldSetElement* self, JSJitGetterCallArgs args)
228 : {
229 0 : auto result(StrongOrRawPtr<nsIHTMLCollection>(self->Elements()));
230 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
231 0 : if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
232 0 : MOZ_ASSERT(true || JS_IsExceptionPending(cx));
233 0 : return false;
234 : }
235 0 : return true;
236 : }
237 :
238 : static const JSJitInfo elements_getterinfo = {
239 : { (JSJitGetterOp)get_elements },
240 : { prototypes::id::HTMLFieldSetElement },
241 : { PrototypeTraits<prototypes::id::HTMLFieldSetElement>::Depth },
242 : JSJitInfo::Getter,
243 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
244 : JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
245 : false, /* isInfallible. False in setters. */
246 : false, /* isMovable. Not relevant for setters. */
247 : false, /* isEliminatable. Not relevant for setters. */
248 : false, /* isAlwaysInSlot. Only relevant for getters. */
249 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
250 : false, /* isTypedMethod. Only relevant for methods. */
251 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
252 : };
253 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
254 : static_assert(0 < 1, "There is no slot for us");
255 :
256 : static bool
257 0 : get_willValidate(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLFieldSetElement* self, JSJitGetterCallArgs args)
258 : {
259 0 : bool result(self->WillValidate());
260 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
261 0 : args.rval().setBoolean(result);
262 0 : return true;
263 : }
264 :
265 : static const JSJitInfo willValidate_getterinfo = {
266 : { (JSJitGetterOp)get_willValidate },
267 : { prototypes::id::HTMLFieldSetElement },
268 : { PrototypeTraits<prototypes::id::HTMLFieldSetElement>::Depth },
269 : JSJitInfo::Getter,
270 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
271 : JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
272 : true, /* isInfallible. False in setters. */
273 : false, /* isMovable. Not relevant for setters. */
274 : false, /* isEliminatable. Not relevant for setters. */
275 : false, /* isAlwaysInSlot. Only relevant for getters. */
276 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
277 : false, /* isTypedMethod. Only relevant for methods. */
278 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
279 : };
280 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
281 : static_assert(0 < 1, "There is no slot for us");
282 :
283 : static bool
284 0 : get_validity(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLFieldSetElement* self, JSJitGetterCallArgs args)
285 : {
286 0 : auto result(StrongOrRawPtr<mozilla::dom::ValidityState>(self->Validity()));
287 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
288 0 : if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
289 0 : MOZ_ASSERT(true || JS_IsExceptionPending(cx));
290 0 : return false;
291 : }
292 0 : return true;
293 : }
294 :
295 : static const JSJitInfo validity_getterinfo = {
296 : { (JSJitGetterOp)get_validity },
297 : { prototypes::id::HTMLFieldSetElement },
298 : { PrototypeTraits<prototypes::id::HTMLFieldSetElement>::Depth },
299 : JSJitInfo::Getter,
300 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
301 : JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
302 : false, /* isInfallible. False in setters. */
303 : false, /* isMovable. Not relevant for setters. */
304 : false, /* isEliminatable. Not relevant for setters. */
305 : false, /* isAlwaysInSlot. Only relevant for getters. */
306 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
307 : false, /* isTypedMethod. Only relevant for methods. */
308 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
309 : };
310 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
311 : static_assert(0 < 1, "There is no slot for us");
312 :
313 : static bool
314 0 : get_validationMessage(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLFieldSetElement* self, JSJitGetterCallArgs args)
315 : {
316 0 : DOMString result;
317 0 : self->GetValidationMessage(result);
318 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
319 0 : if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
320 0 : return false;
321 : }
322 0 : return true;
323 : }
324 :
325 : static const JSJitInfo validationMessage_getterinfo = {
326 : { (JSJitGetterOp)get_validationMessage },
327 : { prototypes::id::HTMLFieldSetElement },
328 : { PrototypeTraits<prototypes::id::HTMLFieldSetElement>::Depth },
329 : JSJitInfo::Getter,
330 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
331 : JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
332 : false, /* isInfallible. False in setters. */
333 : false, /* isMovable. Not relevant for setters. */
334 : false, /* isEliminatable. Not relevant for setters. */
335 : false, /* isAlwaysInSlot. Only relevant for getters. */
336 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
337 : false, /* isTypedMethod. Only relevant for methods. */
338 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
339 : };
340 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
341 : static_assert(0 < 1, "There is no slot for us");
342 :
343 : static bool
344 0 : checkValidity(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLFieldSetElement* self, const JSJitMethodCallArgs& args)
345 : {
346 0 : bool result(self->CheckValidity());
347 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
348 0 : args.rval().setBoolean(result);
349 0 : return true;
350 : }
351 :
352 : static const JSJitInfo checkValidity_methodinfo = {
353 : { (JSJitGetterOp)checkValidity },
354 : { prototypes::id::HTMLFieldSetElement },
355 : { PrototypeTraits<prototypes::id::HTMLFieldSetElement>::Depth },
356 : JSJitInfo::Method,
357 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
358 : JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
359 : true, /* isInfallible. False in setters. */
360 : false, /* isMovable. Not relevant for setters. */
361 : false, /* isEliminatable. Not relevant for setters. */
362 : false, /* isAlwaysInSlot. Only relevant for getters. */
363 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
364 : false, /* isTypedMethod. Only relevant for methods. */
365 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
366 : };
367 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
368 : static_assert(0 < 1, "There is no slot for us");
369 :
370 : static bool
371 0 : reportValidity(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLFieldSetElement* self, const JSJitMethodCallArgs& args)
372 : {
373 0 : bool result(self->ReportValidity());
374 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
375 0 : args.rval().setBoolean(result);
376 0 : return true;
377 : }
378 :
379 : static const JSJitInfo reportValidity_methodinfo = {
380 : { (JSJitGetterOp)reportValidity },
381 : { prototypes::id::HTMLFieldSetElement },
382 : { PrototypeTraits<prototypes::id::HTMLFieldSetElement>::Depth },
383 : JSJitInfo::Method,
384 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
385 : JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
386 : true, /* isInfallible. False in setters. */
387 : false, /* isMovable. Not relevant for setters. */
388 : false, /* isEliminatable. Not relevant for setters. */
389 : false, /* isAlwaysInSlot. Only relevant for getters. */
390 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
391 : false, /* isTypedMethod. Only relevant for methods. */
392 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
393 : };
394 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
395 : static_assert(0 < 1, "There is no slot for us");
396 :
397 : static bool
398 0 : setCustomValidity(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::HTMLFieldSetElement* self, const JSJitMethodCallArgs& args)
399 : {
400 0 : if (MOZ_UNLIKELY(args.length() < 1)) {
401 0 : return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "HTMLFieldSetElement.setCustomValidity");
402 : }
403 0 : binding_detail::FakeString arg0;
404 0 : if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
405 0 : return false;
406 : }
407 0 : self->SetCustomValidity(NonNullHelper(Constify(arg0)));
408 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
409 0 : args.rval().setUndefined();
410 0 : return true;
411 : }
412 :
413 : static const JSJitInfo setCustomValidity_methodinfo = {
414 : { (JSJitGetterOp)setCustomValidity },
415 : { prototypes::id::HTMLFieldSetElement },
416 : { PrototypeTraits<prototypes::id::HTMLFieldSetElement>::Depth },
417 : JSJitInfo::Method,
418 : JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
419 : JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
420 : false, /* isInfallible. False in setters. */
421 : false, /* isMovable. Not relevant for setters. */
422 : false, /* isEliminatable. Not relevant for setters. */
423 : false, /* isAlwaysInSlot. Only relevant for getters. */
424 : false, /* isLazilyCachedInSlot. Only relevant for getters. */
425 : false, /* isTypedMethod. Only relevant for methods. */
426 : 0 /* Reserved slot index, if we're stored in a slot, else 0. */
427 : };
428 : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
429 : static_assert(0 < 1, "There is no slot for us");
430 :
431 : static bool
432 0 : _addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
433 : {
434 0 : mozilla::dom::HTMLFieldSetElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLFieldSetElement>(obj);
435 : // We don't want to preserve if we don't have a wrapper, and we
436 : // obviously can't preserve if we're not initialized.
437 0 : if (self && self->GetWrapperPreserveColor()) {
438 0 : PreserveWrapper(self);
439 : }
440 0 : return true;
441 : }
442 :
443 : static void
444 0 : _finalize(js::FreeOp* fop, JSObject* obj)
445 : {
446 0 : mozilla::dom::HTMLFieldSetElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLFieldSetElement>(obj);
447 0 : if (self) {
448 0 : ClearWrapper(self, self, obj);
449 0 : AddForDeferredFinalization<mozilla::dom::HTMLFieldSetElement>(self);
450 : }
451 0 : }
452 :
453 : static void
454 0 : _objectMoved(JSObject* obj, const JSObject* old)
455 : {
456 0 : mozilla::dom::HTMLFieldSetElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::HTMLFieldSetElement>(obj);
457 0 : if (self) {
458 0 : UpdateWrapper(self, self, obj, old);
459 : }
460 0 : }
461 :
462 : // We deliberately use brace-elision to make Visual Studio produce better initalization code.
463 : #if defined(__clang__)
464 : #pragma clang diagnostic push
465 : #pragma clang diagnostic ignored "-Wmissing-braces"
466 : #endif
467 : static const JSFunctionSpec sMethods_specs[] = {
468 : JS_FNSPEC("checkValidity", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&checkValidity_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
469 : JS_FNSPEC("reportValidity", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&reportValidity_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
470 : JS_FNSPEC("setCustomValidity", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&setCustomValidity_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
471 : JS_FS_END
472 : };
473 : #if defined(__clang__)
474 : #pragma clang diagnostic pop
475 : #endif
476 :
477 :
478 : // Can't be const because the pref-enabled boolean needs to be writable
479 : static Prefable<const JSFunctionSpec> sMethods[] = {
480 : { nullptr, &sMethods_specs[0] },
481 : { nullptr, nullptr }
482 : };
483 :
484 : static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
485 : "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
486 : static_assert(3 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
487 : "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
488 :
489 : // We deliberately use brace-elision to make Visual Studio produce better initalization code.
490 : #if defined(__clang__)
491 : #pragma clang diagnostic push
492 : #pragma clang diagnostic ignored "-Wmissing-braces"
493 : #endif
494 : static const JSPropertySpec sAttributes_specs[] = {
495 : { "disabled", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &disabled_getterinfo, GenericBindingSetter, &disabled_setterinfo },
496 : { "form", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &form_getterinfo, nullptr, nullptr },
497 : { "name", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &name_getterinfo, GenericBindingSetter, &name_setterinfo },
498 : { "type", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &type_getterinfo, nullptr, nullptr },
499 : { "elements", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &elements_getterinfo, nullptr, nullptr },
500 : { "willValidate", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &willValidate_getterinfo, nullptr, nullptr },
501 : { "validity", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &validity_getterinfo, nullptr, nullptr },
502 : { "validationMessage", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &validationMessage_getterinfo, nullptr, nullptr },
503 : { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
504 : };
505 : #if defined(__clang__)
506 : #pragma clang diagnostic pop
507 : #endif
508 :
509 :
510 : // Can't be const because the pref-enabled boolean needs to be writable
511 : static Prefable<const JSPropertySpec> sAttributes[] = {
512 : { nullptr, &sAttributes_specs[0] },
513 : { nullptr, nullptr }
514 : };
515 :
516 : static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
517 : "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
518 : static_assert(8 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
519 : "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
520 :
521 :
522 : static uint16_t sNativeProperties_sortedPropertyIndices[11];
523 : static PropertyInfo sNativeProperties_propertyInfos[11];
524 :
525 : static const NativePropertiesN<2> sNativeProperties = {
526 : false, 0,
527 : false, 0,
528 : true, 0 /* sMethods */,
529 : true, 1 /* sAttributes */,
530 : false, 0,
531 : false, 0,
532 : false, 0,
533 : -1,
534 : 11,
535 : sNativeProperties_sortedPropertyIndices,
536 : {
537 : { sMethods, &sNativeProperties_propertyInfos[0] },
538 : { sAttributes, &sNativeProperties_propertyInfos[3] }
539 : }
540 : };
541 : static_assert(11 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
542 : "We have a property info count that is oversized");
543 :
544 : static bool
545 0 : _constructor(JSContext* cx, unsigned argc, JS::Value* vp)
546 : {
547 0 : JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
548 0 : JS::Rooted<JSObject*> obj(cx, &args.callee());
549 0 : if (!args.isConstructing()) {
550 : // XXXbz wish I could get the name from the callee instead of
551 : // Adding more relocations
552 0 : return ThrowConstructorWithoutNew(cx, "HTMLFieldSetElement");
553 : }
554 :
555 0 : GlobalObject global(cx, obj);
556 0 : if (global.Failed()) {
557 0 : return false;
558 : }
559 :
560 : // The newTarget might be a cross-compartment wrapper. Get the underlying object
561 : // so we can do the spec's object-identity checks.
562 0 : JS::Rooted<JSObject*> newTarget(cx, js::CheckedUnwrap(&args.newTarget().toObject()));
563 0 : if (!newTarget) {
564 0 : return ThrowErrorMessage(cx, MSG_ILLEGAL_CONSTRUCTOR);
565 : }
566 :
567 : // Step 2 of https://html.spec.whatwg.org/multipage/dom.html#htmlconstructor.
568 : // Enter the compartment of our underlying newTarget object, so we end
569 : // up comparing to the constructor object for our interface from that global.
570 : {
571 0 : JSAutoCompartment ac(cx, newTarget);
572 0 : JS::Handle<JSObject*> constructor(GetConstructorObjectHandle(cx));
573 0 : if (!constructor) {
574 0 : return false;
575 : }
576 0 : if (newTarget == constructor) {
577 0 : return ThrowErrorMessage(cx, MSG_ILLEGAL_CONSTRUCTOR);
578 : }
579 : }
580 :
581 0 : JS::Rooted<JSObject*> desiredProto(cx);
582 0 : if (!GetDesiredProto(cx, args, &desiredProto)) {
583 0 : return false;
584 : }
585 0 : if (!desiredProto) {
586 : // Step 7 of https://html.spec.whatwg.org/multipage/dom.html#htmlconstructor.
587 : // This fallback behavior is designed to match analogous behavior for the
588 : // JavaScript built-ins. So we enter the compartment of our underlying
589 : // newTarget object and fall back to the prototype object from that global.
590 : // XXX The spec says to use GetFunctionRealm(), which is not actually
591 : // the same thing as what we have here (e.g. in the case of scripted callable proxies
592 : // whose target is not same-compartment with the proxy, or bound functions, etc).
593 : // https://bugzilla.mozilla.org/show_bug.cgi?id=1317658
594 : {
595 0 : JSAutoCompartment ac(cx, newTarget);
596 0 : desiredProto = GetProtoObjectHandle(cx);
597 0 : if (!desiredProto) {
598 0 : return false;
599 : }
600 : }
601 :
602 : // desiredProto is in the compartment of the underlying newTarget object.
603 : // Wrap it into the context compartment.
604 0 : if (!JS_WrapObject(cx, &desiredProto)) {
605 0 : return false;
606 : }
607 : }
608 :
609 0 : bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
610 0 : Maybe<JSAutoCompartment> ac;
611 0 : if (objIsXray) {
612 0 : obj = js::CheckedUnwrap(obj);
613 0 : if (!obj) {
614 0 : return false;
615 : }
616 0 : ac.emplace(cx, obj);
617 0 : if (!JS_WrapObject(cx, &desiredProto)) {
618 0 : return false;
619 : }
620 : }
621 0 : binding_detail::FastErrorResult rv;
622 0 : auto result(StrongOrRawPtr<mozilla::dom::HTMLFieldSetElement>(CreateHTMLElement(global, args, rv)));
623 0 : if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
624 0 : return false;
625 : }
626 0 : MOZ_ASSERT(!JS_IsExceptionPending(cx));
627 : static_assert(!IsPointer<decltype(result)>::value,
628 : "NewObject implies that we need to keep the object alive with a strong reference.");
629 0 : if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) {
630 0 : MOZ_ASSERT(true || JS_IsExceptionPending(cx));
631 0 : return false;
632 : }
633 0 : return true;
634 : }
635 :
636 : static const js::ClassOps sInterfaceObjectClassOps = {
637 : nullptr, /* addProperty */
638 : nullptr, /* delProperty */
639 : nullptr, /* getProperty */
640 : nullptr, /* setProperty */
641 : nullptr, /* enumerate */
642 : nullptr, /* newEnumerate */
643 : nullptr, /* resolve */
644 : nullptr, /* mayResolve */
645 : nullptr, /* finalize */
646 : _constructor, /* call */
647 : nullptr, /* hasInstance */
648 : _constructor, /* construct */
649 : nullptr, /* trace */
650 : };
651 :
652 : static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
653 : {
654 : "Function",
655 : JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE),
656 : &sInterfaceObjectClassOps,
657 : JS_NULL_CLASS_SPEC,
658 : JS_NULL_CLASS_EXT,
659 : &sInterfaceObjectClassObjectOps
660 : },
661 : eInterface,
662 : true,
663 : prototypes::id::HTMLFieldSetElement,
664 : PrototypeTraits<prototypes::id::HTMLFieldSetElement>::Depth,
665 : sNativePropertyHooks,
666 : "function HTMLFieldSetElement() {\n [native code]\n}",
667 : HTMLElementBinding::GetConstructorObject
668 : };
669 :
670 : static const DOMIfaceAndProtoJSClass sPrototypeClass = {
671 : {
672 : "HTMLFieldSetElementPrototype",
673 : JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE),
674 : JS_NULL_CLASS_OPS,
675 : JS_NULL_CLASS_SPEC,
676 : JS_NULL_CLASS_EXT,
677 : JS_NULL_OBJECT_OPS
678 : },
679 : eInterfacePrototype,
680 : false,
681 : prototypes::id::HTMLFieldSetElement,
682 : PrototypeTraits<prototypes::id::HTMLFieldSetElement>::Depth,
683 : sNativePropertyHooks,
684 : "[object HTMLFieldSetElementPrototype]",
685 : HTMLElementBinding::GetProtoObject
686 : };
687 :
688 : JSObject*
689 0 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal)
690 : {
691 0 : return GetConstructorObjectHandle(aCx, aDefineOnGlobal);
692 : }
693 :
694 : static const js::ClassOps sClassOps = {
695 : _addProperty, /* addProperty */
696 : nullptr, /* delProperty */
697 : nullptr, /* getProperty */
698 : nullptr, /* setProperty */
699 : nullptr, /* enumerate */
700 : nullptr, /* newEnumerate */
701 : nullptr, /* resolve */
702 : nullptr, /* mayResolve */
703 : _finalize, /* finalize */
704 : nullptr, /* call */
705 : nullptr, /* hasInstance */
706 : nullptr, /* construct */
707 : nullptr, /* trace */
708 : };
709 :
710 : static const js::ClassExtension sClassExtension = {
711 : nullptr, /* weakmapKeyDelegateOp */
712 : _objectMoved /* objectMovedOp */
713 : };
714 :
715 : static const DOMJSClass sClass = {
716 : { "HTMLFieldSetElement",
717 : JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
718 : &sClassOps,
719 : JS_NULL_CLASS_SPEC,
720 : &sClassExtension,
721 : JS_NULL_OBJECT_OPS
722 : },
723 : { prototypes::id::EventTarget, prototypes::id::Node, prototypes::id::Element, prototypes::id::HTMLElement, prototypes::id::HTMLFieldSetElement, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
724 : IsBaseOf<nsISupports, mozilla::dom::HTMLFieldSetElement >::value,
725 : sNativePropertyHooks,
726 : FindAssociatedGlobalForNative<mozilla::dom::HTMLFieldSetElement>::Get,
727 : GetProtoObjectHandle,
728 : GetCCParticipant<mozilla::dom::HTMLFieldSetElement>::Get()
729 : };
730 : static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
731 : "Must have the right minimal number of reserved slots.");
732 : static_assert(1 >= 1,
733 : "Must have enough reserved slots.");
734 :
735 : const JSClass*
736 0 : GetJSClass()
737 : {
738 0 : return sClass.ToJSClass();
739 : }
740 :
741 : bool
742 0 : Wrap(JSContext* aCx, mozilla::dom::HTMLFieldSetElement* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
743 : {
744 : MOZ_ASSERT(static_cast<mozilla::dom::HTMLFieldSetElement*>(aObject) ==
745 : reinterpret_cast<mozilla::dom::HTMLFieldSetElement*>(aObject),
746 : "Multiple inheritance for mozilla::dom::HTMLFieldSetElement is broken.");
747 : MOZ_ASSERT(static_cast<nsGenericHTMLElement*>(aObject) ==
748 : reinterpret_cast<nsGenericHTMLElement*>(aObject),
749 : "Multiple inheritance for nsGenericHTMLElement is broken.");
750 : MOZ_ASSERT(static_cast<mozilla::dom::Element*>(aObject) ==
751 : reinterpret_cast<mozilla::dom::Element*>(aObject),
752 : "Multiple inheritance for mozilla::dom::Element is broken.");
753 : MOZ_ASSERT(static_cast<nsINode*>(aObject) ==
754 : reinterpret_cast<nsINode*>(aObject),
755 : "Multiple inheritance for nsINode is broken.");
756 : MOZ_ASSERT(static_cast<mozilla::dom::EventTarget*>(aObject) ==
757 : reinterpret_cast<mozilla::dom::EventTarget*>(aObject),
758 : "Multiple inheritance for mozilla::dom::EventTarget is broken.");
759 0 : MOZ_ASSERT(ToSupportsIsCorrect(aObject));
760 0 : MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
761 0 : MOZ_ASSERT(!aCache->GetWrapper(),
762 : "You should probably not be using Wrap() directly; use "
763 : "GetOrCreateDOMReflector instead");
764 :
765 0 : MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
766 : "nsISupports must be on our primary inheritance chain");
767 :
768 0 : JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
769 0 : if (!global) {
770 0 : return false;
771 : }
772 0 : MOZ_ASSERT(JS_IsGlobalObject(global));
773 0 : MOZ_ASSERT(JS::ObjectIsNotGray(global));
774 :
775 : // That might have ended up wrapping us already, due to the wonders
776 : // of XBL. Check for that, and bail out as needed.
777 0 : aReflector.set(aCache->GetWrapper());
778 0 : if (aReflector) {
779 : #ifdef DEBUG
780 0 : binding_detail::AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
781 : #endif // DEBUG
782 0 : return true;
783 : }
784 :
785 0 : JSAutoCompartment ac(aCx, global);
786 0 : JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
787 0 : if (!canonicalProto) {
788 0 : return false;
789 : }
790 0 : JS::Rooted<JSObject*> proto(aCx);
791 0 : if (aGivenProto) {
792 0 : proto = aGivenProto;
793 : // Unfortunately, while aGivenProto was in the compartment of aCx
794 : // coming in, we changed compartments to that of "parent" so may need
795 : // to wrap the proto here.
796 0 : if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) {
797 0 : if (!JS_WrapObject(aCx, &proto)) {
798 0 : return false;
799 : }
800 : }
801 : } else {
802 0 : proto = canonicalProto;
803 : }
804 :
805 0 : BindingJSObjectCreator<mozilla::dom::HTMLFieldSetElement> creator(aCx);
806 0 : creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
807 0 : if (!aReflector) {
808 0 : return false;
809 : }
810 :
811 0 : aCache->SetWrapper(aReflector);
812 0 : creator.InitializationSucceeded();
813 :
814 0 : MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&
815 : aCache->GetWrapperPreserveColor() == aReflector);
816 : // If proto != canonicalProto, we have to preserve our wrapper;
817 : // otherwise we won't be able to properly recreate it later, since
818 : // we won't know what proto to use. Note that we don't check
819 : // aGivenProto here, since it's entirely possible (and even
820 : // somewhat common) to have a non-null aGivenProto which is the
821 : // same as canonicalProto.
822 0 : if (proto != canonicalProto) {
823 0 : PreserveWrapper(aObject);
824 : }
825 :
826 0 : return true;
827 : }
828 :
829 : const NativePropertyHooks sNativePropertyHooks[] = { {
830 : nullptr,
831 : nullptr,
832 : nullptr,
833 : { sNativeProperties.Upcast(), nullptr },
834 : prototypes::id::HTMLFieldSetElement,
835 : constructors::id::HTMLFieldSetElement,
836 : HTMLElementBinding::sNativePropertyHooks,
837 : &DefaultXrayExpandoObjectClass
838 : } };
839 :
840 : void
841 0 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
842 : {
843 0 : JS::Handle<JSObject*> parentProto(HTMLElementBinding::GetProtoObjectHandle(aCx));
844 0 : if (!parentProto) {
845 0 : return;
846 : }
847 :
848 0 : JS::Handle<JSObject*> constructorProto(HTMLElementBinding::GetConstructorObjectHandle(aCx));
849 0 : if (!constructorProto) {
850 0 : return;
851 : }
852 :
853 : static bool sIdsInited = false;
854 0 : if (!sIdsInited && NS_IsMainThread()) {
855 0 : if (!InitIds(aCx, sNativeProperties.Upcast())) {
856 0 : return;
857 : }
858 0 : sIdsInited = true;
859 : }
860 :
861 0 : JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::HTMLFieldSetElement);
862 0 : JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::HTMLFieldSetElement);
863 0 : dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
864 : &sPrototypeClass.mBase, protoCache,
865 : constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr,
866 : interfaceCache,
867 : sNativeProperties.Upcast(),
868 : nullptr,
869 : "HTMLFieldSetElement", aDefineOnGlobal,
870 : nullptr,
871 0 : false);
872 : }
873 :
874 : JS::Handle<JSObject*>
875 0 : GetProtoObjectHandle(JSContext* aCx)
876 : {
877 : /* Get the interface prototype object for this class. This will create the
878 : object as needed. */
879 0 : bool aDefineOnGlobal = true;
880 :
881 : /* Make sure our global is sane. Hopefully we can remove this sometime */
882 0 : JSObject* global = JS::CurrentGlobalOrNull(aCx);
883 0 : if (!(js::GetObjectClass(global)->flags & JSCLASS_DOM_GLOBAL)) {
884 0 : return nullptr;
885 : }
886 :
887 : /* Check to see whether the interface objects are already installed */
888 0 : ProtoAndIfaceCache& protoAndIfaceCache = *GetProtoAndIfaceCache(global);
889 0 : if (!protoAndIfaceCache.HasEntryInSlot(prototypes::id::HTMLFieldSetElement)) {
890 0 : JS::Rooted<JSObject*> rootedGlobal(aCx, global);
891 0 : CreateInterfaceObjects(aCx, rootedGlobal, protoAndIfaceCache, aDefineOnGlobal);
892 : }
893 :
894 : /*
895 : * The object might _still_ be null, but that's OK.
896 : *
897 : * Calling fromMarkedLocation() is safe because protoAndIfaceCache is
898 : * traced by TraceProtoAndIfaceCache() and its contents are never
899 : * changed after they have been set.
900 : *
901 : * Calling address() avoids the read read barrier that does gray
902 : * unmarking, but it's not possible for the object to be gray here.
903 : */
904 :
905 0 : const JS::Heap<JSObject*>& entrySlot = protoAndIfaceCache.EntrySlotMustExist(prototypes::id::HTMLFieldSetElement);
906 0 : MOZ_ASSERT(JS::ObjectIsNotGray(entrySlot));
907 0 : return JS::Handle<JSObject*>::fromMarkedLocation(entrySlot.address());
908 : }
909 :
910 : JS::Handle<JSObject*>
911 0 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal)
912 : {
913 : /* Get the interface object for this class. This will create the object as
914 : needed. */
915 :
916 : /* Make sure our global is sane. Hopefully we can remove this sometime */
917 0 : JSObject* global = JS::CurrentGlobalOrNull(aCx);
918 0 : if (!(js::GetObjectClass(global)->flags & JSCLASS_DOM_GLOBAL)) {
919 0 : return nullptr;
920 : }
921 :
922 : /* Check to see whether the interface objects are already installed */
923 0 : ProtoAndIfaceCache& protoAndIfaceCache = *GetProtoAndIfaceCache(global);
924 0 : if (!protoAndIfaceCache.HasEntryInSlot(constructors::id::HTMLFieldSetElement)) {
925 0 : JS::Rooted<JSObject*> rootedGlobal(aCx, global);
926 0 : CreateInterfaceObjects(aCx, rootedGlobal, protoAndIfaceCache, aDefineOnGlobal);
927 : }
928 :
929 : /*
930 : * The object might _still_ be null, but that's OK.
931 : *
932 : * Calling fromMarkedLocation() is safe because protoAndIfaceCache is
933 : * traced by TraceProtoAndIfaceCache() and its contents are never
934 : * changed after they have been set.
935 : *
936 : * Calling address() avoids the read read barrier that does gray
937 : * unmarking, but it's not possible for the object to be gray here.
938 : */
939 :
940 0 : const JS::Heap<JSObject*>& entrySlot = protoAndIfaceCache.EntrySlotMustExist(constructors::id::HTMLFieldSetElement);
941 0 : MOZ_ASSERT(JS::ObjectIsNotGray(entrySlot));
942 0 : return JS::Handle<JSObject*>::fromMarkedLocation(entrySlot.address());
943 : }
944 :
945 : JSObject*
946 0 : GetConstructorObject(JSContext* aCx)
947 : {
948 0 : return GetConstructorObjectHandle(aCx);
949 : }
950 :
951 : } // namespace HTMLFieldSetElementBinding
952 :
953 :
954 :
955 : } // namespace dom
956 : } // namespace mozilla
|