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