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