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