/work/obj-fuzz/dom/bindings/SVGFESpotLightElementBinding.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM SVGFESpotLightElement.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #include "SVGElementBinding.h" |
4 | | #include "SVGFESpotLightElementBinding.h" |
5 | | #include "WrapperFactory.h" |
6 | | #include "mozilla/OwningNonNull.h" |
7 | | #include "mozilla/dom/BindingUtils.h" |
8 | | #include "mozilla/dom/DOMJSClass.h" |
9 | | #include "mozilla/dom/NonRefcountedDOMObject.h" |
10 | | #include "mozilla/dom/SVGAnimatedNumber.h" |
11 | | #include "mozilla/dom/SVGFESpotLightElement.h" |
12 | | #include "mozilla/dom/XrayExpandoClass.h" |
13 | | |
14 | | namespace mozilla { |
15 | | namespace dom { |
16 | | |
17 | | namespace binding_detail {}; // Just to make sure it's known as a namespace |
18 | | using namespace mozilla::dom::binding_detail; |
19 | | |
20 | | |
21 | | namespace SVGFESpotLightElement_Binding { |
22 | | |
23 | | static_assert(IsRefcounted<NativeType>::value == IsRefcounted<SVGElement_Binding::NativeType>::value, |
24 | | "Can't inherit from an interface with a different ownership model."); |
25 | | |
26 | | MOZ_CAN_RUN_SCRIPT static bool |
27 | | get_x(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFESpotLightElement* self, JSJitGetterCallArgs args) |
28 | 0 | { |
29 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGFESpotLightElement.x", DOM, cx); |
30 | 0 |
|
31 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->X())); |
32 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
33 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
34 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
35 | 0 | return false; |
36 | 0 | } |
37 | 0 | return true; |
38 | 0 | } |
39 | | |
40 | | static const JSJitInfo x_getterinfo = { |
41 | | { (JSJitGetterOp)get_x }, |
42 | | { prototypes::id::SVGFESpotLightElement }, |
43 | | { PrototypeTraits<prototypes::id::SVGFESpotLightElement>::Depth }, |
44 | | JSJitInfo::Getter, |
45 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
46 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
47 | | false, /* isInfallible. False in setters. */ |
48 | | true, /* isMovable. Not relevant for setters. */ |
49 | | true, /* isEliminatable. Not relevant for setters. */ |
50 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
51 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
52 | | false, /* isTypedMethod. Only relevant for methods. */ |
53 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
54 | | }; |
55 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
56 | | static_assert(0 < 1, "There is no slot for us"); |
57 | | |
58 | | MOZ_CAN_RUN_SCRIPT static bool |
59 | | get_y(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFESpotLightElement* self, JSJitGetterCallArgs args) |
60 | 0 | { |
61 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGFESpotLightElement.y", DOM, cx); |
62 | 0 |
|
63 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->Y())); |
64 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
65 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
66 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
67 | 0 | return false; |
68 | 0 | } |
69 | 0 | return true; |
70 | 0 | } |
71 | | |
72 | | static const JSJitInfo y_getterinfo = { |
73 | | { (JSJitGetterOp)get_y }, |
74 | | { prototypes::id::SVGFESpotLightElement }, |
75 | | { PrototypeTraits<prototypes::id::SVGFESpotLightElement>::Depth }, |
76 | | JSJitInfo::Getter, |
77 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
78 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
79 | | false, /* isInfallible. False in setters. */ |
80 | | true, /* isMovable. Not relevant for setters. */ |
81 | | true, /* isEliminatable. Not relevant for setters. */ |
82 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
83 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
84 | | false, /* isTypedMethod. Only relevant for methods. */ |
85 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
86 | | }; |
87 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
88 | | static_assert(0 < 1, "There is no slot for us"); |
89 | | |
90 | | MOZ_CAN_RUN_SCRIPT static bool |
91 | | get_z(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFESpotLightElement* self, JSJitGetterCallArgs args) |
92 | 0 | { |
93 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGFESpotLightElement.z", DOM, cx); |
94 | 0 |
|
95 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->Z())); |
96 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
97 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
98 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
99 | 0 | return false; |
100 | 0 | } |
101 | 0 | return true; |
102 | 0 | } |
103 | | |
104 | | static const JSJitInfo z_getterinfo = { |
105 | | { (JSJitGetterOp)get_z }, |
106 | | { prototypes::id::SVGFESpotLightElement }, |
107 | | { PrototypeTraits<prototypes::id::SVGFESpotLightElement>::Depth }, |
108 | | JSJitInfo::Getter, |
109 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
110 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
111 | | false, /* isInfallible. False in setters. */ |
112 | | true, /* isMovable. Not relevant for setters. */ |
113 | | true, /* isEliminatable. Not relevant for setters. */ |
114 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
115 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
116 | | false, /* isTypedMethod. Only relevant for methods. */ |
117 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
118 | | }; |
119 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
120 | | static_assert(0 < 1, "There is no slot for us"); |
121 | | |
122 | | MOZ_CAN_RUN_SCRIPT static bool |
123 | | get_pointsAtX(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFESpotLightElement* self, JSJitGetterCallArgs args) |
124 | 0 | { |
125 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGFESpotLightElement.pointsAtX", DOM, cx); |
126 | 0 |
|
127 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->PointsAtX())); |
128 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
129 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
130 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
131 | 0 | return false; |
132 | 0 | } |
133 | 0 | return true; |
134 | 0 | } |
135 | | |
136 | | static const JSJitInfo pointsAtX_getterinfo = { |
137 | | { (JSJitGetterOp)get_pointsAtX }, |
138 | | { prototypes::id::SVGFESpotLightElement }, |
139 | | { PrototypeTraits<prototypes::id::SVGFESpotLightElement>::Depth }, |
140 | | JSJitInfo::Getter, |
141 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
142 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
143 | | false, /* isInfallible. False in setters. */ |
144 | | true, /* isMovable. Not relevant for setters. */ |
145 | | true, /* isEliminatable. Not relevant for setters. */ |
146 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
147 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
148 | | false, /* isTypedMethod. Only relevant for methods. */ |
149 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
150 | | }; |
151 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
152 | | static_assert(0 < 1, "There is no slot for us"); |
153 | | |
154 | | MOZ_CAN_RUN_SCRIPT static bool |
155 | | get_pointsAtY(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFESpotLightElement* self, JSJitGetterCallArgs args) |
156 | 0 | { |
157 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGFESpotLightElement.pointsAtY", DOM, cx); |
158 | 0 |
|
159 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->PointsAtY())); |
160 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
161 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
162 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
163 | 0 | return false; |
164 | 0 | } |
165 | 0 | return true; |
166 | 0 | } |
167 | | |
168 | | static const JSJitInfo pointsAtY_getterinfo = { |
169 | | { (JSJitGetterOp)get_pointsAtY }, |
170 | | { prototypes::id::SVGFESpotLightElement }, |
171 | | { PrototypeTraits<prototypes::id::SVGFESpotLightElement>::Depth }, |
172 | | JSJitInfo::Getter, |
173 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
174 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
175 | | false, /* isInfallible. False in setters. */ |
176 | | true, /* isMovable. Not relevant for setters. */ |
177 | | true, /* isEliminatable. Not relevant for setters. */ |
178 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
179 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
180 | | false, /* isTypedMethod. Only relevant for methods. */ |
181 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
182 | | }; |
183 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
184 | | static_assert(0 < 1, "There is no slot for us"); |
185 | | |
186 | | MOZ_CAN_RUN_SCRIPT static bool |
187 | | get_pointsAtZ(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFESpotLightElement* self, JSJitGetterCallArgs args) |
188 | 0 | { |
189 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGFESpotLightElement.pointsAtZ", DOM, cx); |
190 | 0 |
|
191 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->PointsAtZ())); |
192 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
193 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
194 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
195 | 0 | return false; |
196 | 0 | } |
197 | 0 | return true; |
198 | 0 | } |
199 | | |
200 | | static const JSJitInfo pointsAtZ_getterinfo = { |
201 | | { (JSJitGetterOp)get_pointsAtZ }, |
202 | | { prototypes::id::SVGFESpotLightElement }, |
203 | | { PrototypeTraits<prototypes::id::SVGFESpotLightElement>::Depth }, |
204 | | JSJitInfo::Getter, |
205 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
206 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
207 | | false, /* isInfallible. False in setters. */ |
208 | | true, /* isMovable. Not relevant for setters. */ |
209 | | true, /* isEliminatable. Not relevant for setters. */ |
210 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
211 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
212 | | false, /* isTypedMethod. Only relevant for methods. */ |
213 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
214 | | }; |
215 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
216 | | static_assert(0 < 1, "There is no slot for us"); |
217 | | |
218 | | MOZ_CAN_RUN_SCRIPT static bool |
219 | | get_specularExponent(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFESpotLightElement* self, JSJitGetterCallArgs args) |
220 | 0 | { |
221 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGFESpotLightElement.specularExponent", DOM, cx); |
222 | 0 |
|
223 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->SpecularExponent())); |
224 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
225 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
226 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
227 | 0 | return false; |
228 | 0 | } |
229 | 0 | return true; |
230 | 0 | } |
231 | | |
232 | | static const JSJitInfo specularExponent_getterinfo = { |
233 | | { (JSJitGetterOp)get_specularExponent }, |
234 | | { prototypes::id::SVGFESpotLightElement }, |
235 | | { PrototypeTraits<prototypes::id::SVGFESpotLightElement>::Depth }, |
236 | | JSJitInfo::Getter, |
237 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
238 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
239 | | false, /* isInfallible. False in setters. */ |
240 | | true, /* isMovable. Not relevant for setters. */ |
241 | | true, /* isEliminatable. Not relevant for setters. */ |
242 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
243 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
244 | | false, /* isTypedMethod. Only relevant for methods. */ |
245 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
246 | | }; |
247 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
248 | | static_assert(0 < 1, "There is no slot for us"); |
249 | | |
250 | | MOZ_CAN_RUN_SCRIPT static bool |
251 | | get_limitingConeAngle(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFESpotLightElement* self, JSJitGetterCallArgs args) |
252 | 0 | { |
253 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGFESpotLightElement.limitingConeAngle", DOM, cx); |
254 | 0 |
|
255 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->LimitingConeAngle())); |
256 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
257 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
258 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
259 | 0 | return false; |
260 | 0 | } |
261 | 0 | return true; |
262 | 0 | } |
263 | | |
264 | | static const JSJitInfo limitingConeAngle_getterinfo = { |
265 | | { (JSJitGetterOp)get_limitingConeAngle }, |
266 | | { prototypes::id::SVGFESpotLightElement }, |
267 | | { PrototypeTraits<prototypes::id::SVGFESpotLightElement>::Depth }, |
268 | | JSJitInfo::Getter, |
269 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
270 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
271 | | false, /* isInfallible. False in setters. */ |
272 | | true, /* isMovable. Not relevant for setters. */ |
273 | | true, /* isEliminatable. Not relevant for setters. */ |
274 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
275 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
276 | | false, /* isTypedMethod. Only relevant for methods. */ |
277 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
278 | | }; |
279 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
280 | | static_assert(0 < 1, "There is no slot for us"); |
281 | | |
282 | | static bool |
283 | | _addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val) |
284 | 0 | { |
285 | 0 | mozilla::dom::SVGFESpotLightElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGFESpotLightElement>(obj); |
286 | 0 | // We don't want to preserve if we don't have a wrapper, and we |
287 | 0 | // obviously can't preserve if we're not initialized. |
288 | 0 | if (self && self->GetWrapperPreserveColor()) { |
289 | 0 | PreserveWrapper(self); |
290 | 0 | } |
291 | 0 | return true; |
292 | 0 | } |
293 | | |
294 | | static void |
295 | | _finalize(js::FreeOp* fop, JSObject* obj) |
296 | 0 | { |
297 | 0 | mozilla::dom::SVGFESpotLightElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGFESpotLightElement>(obj); |
298 | 0 | if (self) { |
299 | 0 | ClearWrapper(self, self, obj); |
300 | 0 | AddForDeferredFinalization<mozilla::dom::SVGFESpotLightElement>(self); |
301 | 0 | } |
302 | 0 | } |
303 | | |
304 | | static size_t |
305 | | _objectMoved(JSObject* obj, JSObject* old) |
306 | 0 | { |
307 | 0 | mozilla::dom::SVGFESpotLightElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGFESpotLightElement>(obj); |
308 | 0 | if (self) { |
309 | 0 | UpdateWrapper(self, self, obj, old); |
310 | 0 | } |
311 | 0 |
|
312 | 0 | return 0; |
313 | 0 | } |
314 | | |
315 | | // We deliberately use brace-elision to make Visual Studio produce better initalization code. |
316 | | #if defined(__clang__) |
317 | | #pragma clang diagnostic push |
318 | | #pragma clang diagnostic ignored "-Wmissing-braces" |
319 | | #endif |
320 | | static const JSPropertySpec sAttributes_specs[] = { |
321 | | { "x", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &x_getterinfo, nullptr, nullptr }, |
322 | | { "y", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &y_getterinfo, nullptr, nullptr }, |
323 | | { "z", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &z_getterinfo, nullptr, nullptr }, |
324 | | { "pointsAtX", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &pointsAtX_getterinfo, nullptr, nullptr }, |
325 | | { "pointsAtY", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &pointsAtY_getterinfo, nullptr, nullptr }, |
326 | | { "pointsAtZ", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &pointsAtZ_getterinfo, nullptr, nullptr }, |
327 | | { "specularExponent", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &specularExponent_getterinfo, nullptr, nullptr }, |
328 | | { "limitingConeAngle", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &limitingConeAngle_getterinfo, nullptr, nullptr }, |
329 | | { nullptr, 0, nullptr, nullptr, nullptr, nullptr } |
330 | | }; |
331 | | #if defined(__clang__) |
332 | | #pragma clang diagnostic pop |
333 | | #endif |
334 | | |
335 | | |
336 | | static const Prefable<const JSPropertySpec> sAttributes[] = { |
337 | | { nullptr, &sAttributes_specs[0] }, |
338 | | { nullptr, nullptr } |
339 | | }; |
340 | | |
341 | | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX, |
342 | | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); |
343 | | static_assert(8 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX, |
344 | | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); |
345 | | |
346 | | |
347 | | static uint16_t sNativeProperties_sortedPropertyIndices[8]; |
348 | | static PropertyInfo sNativeProperties_propertyInfos[8]; |
349 | | |
350 | | static const NativePropertiesN<1> sNativeProperties = { |
351 | | false, 0, |
352 | | false, 0, |
353 | | false, 0, |
354 | | true, 0 /* sAttributes */, |
355 | | false, 0, |
356 | | false, 0, |
357 | | false, 0, |
358 | | -1, |
359 | | 8, |
360 | | sNativeProperties_sortedPropertyIndices, |
361 | | { |
362 | | { sAttributes, &sNativeProperties_propertyInfos[0] } |
363 | | } |
364 | | }; |
365 | | static_assert(8 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount), |
366 | | "We have a property info count that is oversized"); |
367 | | |
368 | | static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = { |
369 | | { |
370 | | "Function", |
371 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE), |
372 | | &sBoringInterfaceObjectClassClassOps, |
373 | | JS_NULL_CLASS_SPEC, |
374 | | JS_NULL_CLASS_EXT, |
375 | | &sInterfaceObjectClassObjectOps |
376 | | }, |
377 | | eInterface, |
378 | | true, |
379 | | prototypes::id::SVGFESpotLightElement, |
380 | | PrototypeTraits<prototypes::id::SVGFESpotLightElement>::Depth, |
381 | | sNativePropertyHooks, |
382 | | "function SVGFESpotLightElement() {\n [native code]\n}", |
383 | | SVGElement_Binding::GetConstructorObject |
384 | | }; |
385 | | |
386 | | static const DOMIfaceAndProtoJSClass sPrototypeClass = { |
387 | | { |
388 | | "SVGFESpotLightElementPrototype", |
389 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE), |
390 | | JS_NULL_CLASS_OPS, |
391 | | JS_NULL_CLASS_SPEC, |
392 | | JS_NULL_CLASS_EXT, |
393 | | JS_NULL_OBJECT_OPS |
394 | | }, |
395 | | eInterfacePrototype, |
396 | | false, |
397 | | prototypes::id::SVGFESpotLightElement, |
398 | | PrototypeTraits<prototypes::id::SVGFESpotLightElement>::Depth, |
399 | | sNativePropertyHooks, |
400 | | "[object SVGFESpotLightElementPrototype]", |
401 | | SVGElement_Binding::GetProtoObject |
402 | | }; |
403 | | |
404 | | static const js::ClassOps sClassOps = { |
405 | | _addProperty, /* addProperty */ |
406 | | nullptr, /* delProperty */ |
407 | | nullptr, /* enumerate */ |
408 | | nullptr, /* newEnumerate */ |
409 | | nullptr, /* resolve */ |
410 | | nullptr, /* mayResolve */ |
411 | | _finalize, /* finalize */ |
412 | | nullptr, /* call */ |
413 | | nullptr, /* hasInstance */ |
414 | | nullptr, /* construct */ |
415 | | nullptr, /* trace */ |
416 | | }; |
417 | | |
418 | | static const js::ClassExtension sClassExtension = { |
419 | | nullptr, /* weakmapKeyDelegateOp */ |
420 | | _objectMoved /* objectMovedOp */ |
421 | | }; |
422 | | |
423 | | static const DOMJSClass sClass = { |
424 | | { "SVGFESpotLightElement", |
425 | | JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1), |
426 | | &sClassOps, |
427 | | JS_NULL_CLASS_SPEC, |
428 | | &sClassExtension, |
429 | | JS_NULL_OBJECT_OPS |
430 | | }, |
431 | | { prototypes::id::EventTarget, prototypes::id::Node, prototypes::id::Element, prototypes::id::SVGElement, prototypes::id::SVGFESpotLightElement, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count }, |
432 | | IsBaseOf<nsISupports, mozilla::dom::SVGFESpotLightElement >::value, |
433 | | sNativePropertyHooks, |
434 | | FindAssociatedGlobalForNative<mozilla::dom::SVGFESpotLightElement>::Get, |
435 | | GetProtoObjectHandle, |
436 | | GetCCParticipant<mozilla::dom::SVGFESpotLightElement>::Get() |
437 | | }; |
438 | | static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS, |
439 | | "Must have the right minimal number of reserved slots."); |
440 | | static_assert(1 >= 1, |
441 | | "Must have enough reserved slots."); |
442 | | |
443 | | const JSClass* |
444 | | GetJSClass() |
445 | 0 | { |
446 | 0 | return sClass.ToJSClass(); |
447 | 0 | } |
448 | | |
449 | | bool |
450 | | Wrap(JSContext* aCx, mozilla::dom::SVGFESpotLightElement* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector) |
451 | 0 | { |
452 | 0 | static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::dom::SVGFESpotLightElement>::value, |
453 | 0 | "Shouldn't have wrappercached things that are not refcounted."); |
454 | 0 | MOZ_ASSERT(static_cast<mozilla::dom::SVGFESpotLightElement*>(aObject) == |
455 | 0 | reinterpret_cast<mozilla::dom::SVGFESpotLightElement*>(aObject), |
456 | 0 | "Multiple inheritance for mozilla::dom::SVGFESpotLightElement is broken."); |
457 | 0 | MOZ_ASSERT(static_cast<nsSVGElement*>(aObject) == |
458 | 0 | reinterpret_cast<nsSVGElement*>(aObject), |
459 | 0 | "Multiple inheritance for nsSVGElement is broken."); |
460 | 0 | MOZ_ASSERT(static_cast<mozilla::dom::Element*>(aObject) == |
461 | 0 | reinterpret_cast<mozilla::dom::Element*>(aObject), |
462 | 0 | "Multiple inheritance for mozilla::dom::Element is broken."); |
463 | 0 | MOZ_ASSERT(static_cast<nsINode*>(aObject) == |
464 | 0 | reinterpret_cast<nsINode*>(aObject), |
465 | 0 | "Multiple inheritance for nsINode is broken."); |
466 | 0 | MOZ_ASSERT(static_cast<mozilla::dom::EventTarget*>(aObject) == |
467 | 0 | reinterpret_cast<mozilla::dom::EventTarget*>(aObject), |
468 | 0 | "Multiple inheritance for mozilla::dom::EventTarget is broken."); |
469 | 0 | MOZ_ASSERT(ToSupportsIsCorrect(aObject)); |
470 | 0 | MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx)); |
471 | 0 | MOZ_ASSERT(!aCache->GetWrapper(), |
472 | 0 | "You should probably not be using Wrap() directly; use " |
473 | 0 | "GetOrCreateDOMReflector instead"); |
474 | 0 |
|
475 | 0 | MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache), |
476 | 0 | "nsISupports must be on our primary inheritance chain"); |
477 | 0 |
|
478 | 0 | JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject())); |
479 | 0 | if (!global) { |
480 | 0 | return false; |
481 | 0 | } |
482 | 0 | MOZ_ASSERT(JS_IsGlobalObject(global)); |
483 | 0 | MOZ_ASSERT(JS::ObjectIsNotGray(global)); |
484 | 0 |
|
485 | 0 | // That might have ended up wrapping us already, due to the wonders |
486 | 0 | // of XBL. Check for that, and bail out as needed. |
487 | 0 | aReflector.set(aCache->GetWrapper()); |
488 | 0 | if (aReflector) { |
489 | | #ifdef DEBUG |
490 | | AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto); |
491 | | #endif // DEBUG |
492 | | return true; |
493 | 0 | } |
494 | 0 |
|
495 | 0 | JSAutoRealm ar(aCx, global); |
496 | 0 | JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx); |
497 | 0 | if (!canonicalProto) { |
498 | 0 | return false; |
499 | 0 | } |
500 | 0 | JS::Rooted<JSObject*> proto(aCx); |
501 | 0 | if (aGivenProto) { |
502 | 0 | proto = aGivenProto; |
503 | 0 | // Unfortunately, while aGivenProto was in the compartment of aCx |
504 | 0 | // coming in, we changed compartments to that of "parent" so may need |
505 | 0 | // to wrap the proto here. |
506 | 0 | if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) { |
507 | 0 | if (!JS_WrapObject(aCx, &proto)) { |
508 | 0 | return false; |
509 | 0 | } |
510 | 0 | } |
511 | 0 | } else { |
512 | 0 | proto = canonicalProto; |
513 | 0 | } |
514 | 0 |
|
515 | 0 | BindingJSObjectCreator<mozilla::dom::SVGFESpotLightElement> creator(aCx); |
516 | 0 | creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector); |
517 | 0 | if (!aReflector) { |
518 | 0 | return false; |
519 | 0 | } |
520 | 0 | |
521 | 0 | aCache->SetWrapper(aReflector); |
522 | 0 | creator.InitializationSucceeded(); |
523 | 0 |
|
524 | 0 | MOZ_ASSERT(aCache->GetWrapperPreserveColor() && |
525 | 0 | aCache->GetWrapperPreserveColor() == aReflector); |
526 | 0 | // If proto != canonicalProto, we have to preserve our wrapper; |
527 | 0 | // otherwise we won't be able to properly recreate it later, since |
528 | 0 | // we won't know what proto to use. Note that we don't check |
529 | 0 | // aGivenProto here, since it's entirely possible (and even |
530 | 0 | // somewhat common) to have a non-null aGivenProto which is the |
531 | 0 | // same as canonicalProto. |
532 | 0 | if (proto != canonicalProto) { |
533 | 0 | PreserveWrapper(aObject); |
534 | 0 | } |
535 | 0 |
|
536 | 0 | return true; |
537 | 0 | } |
538 | | |
539 | | const NativePropertyHooks sNativePropertyHooks[] = { { |
540 | | nullptr, |
541 | | nullptr, |
542 | | nullptr, |
543 | | { sNativeProperties.Upcast(), nullptr }, |
544 | | prototypes::id::SVGFESpotLightElement, |
545 | | constructors::id::SVGFESpotLightElement, |
546 | | SVGElement_Binding::sNativePropertyHooks, |
547 | | &DefaultXrayExpandoObjectClass |
548 | | } }; |
549 | | |
550 | | void |
551 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal) |
552 | 0 | { |
553 | 0 | JS::Handle<JSObject*> parentProto(SVGElement_Binding::GetProtoObjectHandle(aCx)); |
554 | 0 | if (!parentProto) { |
555 | 0 | return; |
556 | 0 | } |
557 | 0 | |
558 | 0 | JS::Handle<JSObject*> constructorProto(SVGElement_Binding::GetConstructorObjectHandle(aCx)); |
559 | 0 | if (!constructorProto) { |
560 | 0 | return; |
561 | 0 | } |
562 | 0 | |
563 | 0 | static bool sIdsInited = false; |
564 | 0 | if (!sIdsInited && NS_IsMainThread()) { |
565 | 0 | if (!InitIds(aCx, sNativeProperties.Upcast())) { |
566 | 0 | return; |
567 | 0 | } |
568 | 0 | sIdsInited = true; |
569 | 0 | } |
570 | 0 |
|
571 | 0 | JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::SVGFESpotLightElement); |
572 | 0 | JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::SVGFESpotLightElement); |
573 | 0 | dom::CreateInterfaceObjects(aCx, aGlobal, parentProto, |
574 | 0 | &sPrototypeClass.mBase, protoCache, |
575 | 0 | nullptr, |
576 | 0 | constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr, |
577 | 0 | interfaceCache, |
578 | 0 | sNativeProperties.Upcast(), |
579 | 0 | nullptr, |
580 | 0 | "SVGFESpotLightElement", aDefineOnGlobal, |
581 | 0 | nullptr, |
582 | 0 | false); |
583 | 0 | } |
584 | | |
585 | | JSObject* |
586 | | GetConstructorObject(JSContext* aCx) |
587 | 0 | { |
588 | 0 | return GetConstructorObjectHandle(aCx); |
589 | 0 | } |
590 | | |
591 | | } // namespace SVGFESpotLightElement_Binding |
592 | | |
593 | | |
594 | | |
595 | | } // namespace dom |
596 | | } // namespace mozilla |