/work/obj-fuzz/dom/bindings/SVGFEBlendElementBinding.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM SVGFEBlendElement.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #include "SVGElementBinding.h" |
4 | | #include "SVGFEBlendElementBinding.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/SVGAnimatedString.h" |
13 | | #include "mozilla/dom/SVGFEBlendElement.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 SVGFEBlendElement_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::SVGFEBlendElement* self, JSJitGetterCallArgs args) |
30 | 0 | { |
31 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGFEBlendElement.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::SVGFEBlendElement }, |
45 | | { PrototypeTraits<prototypes::id::SVGFEBlendElement>::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_in2(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEBlendElement* self, JSJitGetterCallArgs args) |
62 | 0 | { |
63 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGFEBlendElement.in2", DOM, cx); |
64 | 0 |
|
65 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedString>(self->In2())); |
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 in2_getterinfo = { |
75 | | { (JSJitGetterOp)get_in2 }, |
76 | | { prototypes::id::SVGFEBlendElement }, |
77 | | { PrototypeTraits<prototypes::id::SVGFEBlendElement>::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_mode(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEBlendElement* self, JSJitGetterCallArgs args) |
94 | 0 | { |
95 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGFEBlendElement.mode", DOM, cx); |
96 | 0 |
|
97 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedEnumeration>(self->Mode())); |
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 mode_getterinfo = { |
107 | | { (JSJitGetterOp)get_mode }, |
108 | | { prototypes::id::SVGFEBlendElement }, |
109 | | { PrototypeTraits<prototypes::id::SVGFEBlendElement>::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_x(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEBlendElement* self, JSJitGetterCallArgs args) |
126 | 0 | { |
127 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGFEBlendElement.x", DOM, cx); |
128 | 0 |
|
129 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->X())); |
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 x_getterinfo = { |
139 | | { (JSJitGetterOp)get_x }, |
140 | | { prototypes::id::SVGFEBlendElement }, |
141 | | { PrototypeTraits<prototypes::id::SVGFEBlendElement>::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_y(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEBlendElement* self, JSJitGetterCallArgs args) |
158 | 0 | { |
159 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGFEBlendElement.y", DOM, cx); |
160 | 0 |
|
161 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->Y())); |
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 y_getterinfo = { |
171 | | { (JSJitGetterOp)get_y }, |
172 | | { prototypes::id::SVGFEBlendElement }, |
173 | | { PrototypeTraits<prototypes::id::SVGFEBlendElement>::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_width(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEBlendElement* self, JSJitGetterCallArgs args) |
190 | 0 | { |
191 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGFEBlendElement.width", DOM, cx); |
192 | 0 |
|
193 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->Width())); |
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 width_getterinfo = { |
203 | | { (JSJitGetterOp)get_width }, |
204 | | { prototypes::id::SVGFEBlendElement }, |
205 | | { PrototypeTraits<prototypes::id::SVGFEBlendElement>::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_height(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEBlendElement* self, JSJitGetterCallArgs args) |
222 | 0 | { |
223 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGFEBlendElement.height", DOM, cx); |
224 | 0 |
|
225 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->Height())); |
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 height_getterinfo = { |
235 | | { (JSJitGetterOp)get_height }, |
236 | | { prototypes::id::SVGFEBlendElement }, |
237 | | { PrototypeTraits<prototypes::id::SVGFEBlendElement>::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_result(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEBlendElement* self, JSJitGetterCallArgs args) |
254 | 0 | { |
255 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGFEBlendElement.result", DOM, cx); |
256 | 0 |
|
257 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedString>(self->Result())); |
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 result_getterinfo = { |
267 | | { (JSJitGetterOp)get_result }, |
268 | | { prototypes::id::SVGFEBlendElement }, |
269 | | { PrototypeTraits<prototypes::id::SVGFEBlendElement>::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 | | static bool |
285 | | _addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val) |
286 | 0 | { |
287 | 0 | mozilla::dom::SVGFEBlendElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGFEBlendElement>(obj); |
288 | 0 | // We don't want to preserve if we don't have a wrapper, and we |
289 | 0 | // obviously can't preserve if we're not initialized. |
290 | 0 | if (self && self->GetWrapperPreserveColor()) { |
291 | 0 | PreserveWrapper(self); |
292 | 0 | } |
293 | 0 | return true; |
294 | 0 | } |
295 | | |
296 | | static void |
297 | | _finalize(js::FreeOp* fop, JSObject* obj) |
298 | 0 | { |
299 | 0 | mozilla::dom::SVGFEBlendElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGFEBlendElement>(obj); |
300 | 0 | if (self) { |
301 | 0 | ClearWrapper(self, self, obj); |
302 | 0 | AddForDeferredFinalization<mozilla::dom::SVGFEBlendElement>(self); |
303 | 0 | } |
304 | 0 | } |
305 | | |
306 | | static size_t |
307 | | _objectMoved(JSObject* obj, JSObject* old) |
308 | 0 | { |
309 | 0 | mozilla::dom::SVGFEBlendElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGFEBlendElement>(obj); |
310 | 0 | if (self) { |
311 | 0 | UpdateWrapper(self, self, obj, old); |
312 | 0 | } |
313 | 0 |
|
314 | 0 | return 0; |
315 | 0 | } |
316 | | |
317 | | // We deliberately use brace-elision to make Visual Studio produce better initalization code. |
318 | | #if defined(__clang__) |
319 | | #pragma clang diagnostic push |
320 | | #pragma clang diagnostic ignored "-Wmissing-braces" |
321 | | #endif |
322 | | static const JSPropertySpec sAttributes_specs[] = { |
323 | | { "in1", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &in1_getterinfo, nullptr, nullptr }, |
324 | | { "in2", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &in2_getterinfo, nullptr, nullptr }, |
325 | | { "mode", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &mode_getterinfo, nullptr, nullptr }, |
326 | | { "x", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &x_getterinfo, nullptr, nullptr }, |
327 | | { "y", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &y_getterinfo, nullptr, nullptr }, |
328 | | { "width", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &width_getterinfo, nullptr, nullptr }, |
329 | | { "height", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &height_getterinfo, nullptr, nullptr }, |
330 | | { "result", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &result_getterinfo, nullptr, nullptr }, |
331 | | { nullptr, 0, nullptr, nullptr, nullptr, nullptr } |
332 | | }; |
333 | | #if defined(__clang__) |
334 | | #pragma clang diagnostic pop |
335 | | #endif |
336 | | |
337 | | |
338 | | static const Prefable<const JSPropertySpec> sAttributes[] = { |
339 | | { nullptr, &sAttributes_specs[0] }, |
340 | | { nullptr, nullptr } |
341 | | }; |
342 | | |
343 | | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX, |
344 | | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); |
345 | | static_assert(8 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX, |
346 | | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); |
347 | | |
348 | | // We deliberately use brace-elision to make Visual Studio produce better initalization code. |
349 | | #if defined(__clang__) |
350 | | #pragma clang diagnostic push |
351 | | #pragma clang diagnostic ignored "-Wmissing-braces" |
352 | | #endif |
353 | | static const ConstantSpec sConstants_specs[] = { |
354 | | { "SVG_FEBLEND_MODE_UNKNOWN", JS::Int32Value(0) }, |
355 | | { "SVG_FEBLEND_MODE_NORMAL", JS::Int32Value(1) }, |
356 | | { "SVG_FEBLEND_MODE_MULTIPLY", JS::Int32Value(2) }, |
357 | | { "SVG_FEBLEND_MODE_SCREEN", JS::Int32Value(3) }, |
358 | | { "SVG_FEBLEND_MODE_DARKEN", JS::Int32Value(4) }, |
359 | | { "SVG_FEBLEND_MODE_LIGHTEN", JS::Int32Value(5) }, |
360 | | { "SVG_FEBLEND_MODE_OVERLAY", JS::Int32Value(6) }, |
361 | | { "SVG_FEBLEND_MODE_COLOR_DODGE", JS::Int32Value(7) }, |
362 | | { "SVG_FEBLEND_MODE_COLOR_BURN", JS::Int32Value(8) }, |
363 | | { "SVG_FEBLEND_MODE_HARD_LIGHT", JS::Int32Value(9) }, |
364 | | { "SVG_FEBLEND_MODE_SOFT_LIGHT", JS::Int32Value(10) }, |
365 | | { "SVG_FEBLEND_MODE_DIFFERENCE", JS::Int32Value(11) }, |
366 | | { "SVG_FEBLEND_MODE_EXCLUSION", JS::Int32Value(12) }, |
367 | | { "SVG_FEBLEND_MODE_HUE", JS::Int32Value(13) }, |
368 | | { "SVG_FEBLEND_MODE_SATURATION", JS::Int32Value(14) }, |
369 | | { "SVG_FEBLEND_MODE_COLOR", JS::Int32Value(15) }, |
370 | | { "SVG_FEBLEND_MODE_LUMINOSITY", JS::Int32Value(16) }, |
371 | | { 0, JS::UndefinedValue() } |
372 | | }; |
373 | | #if defined(__clang__) |
374 | | #pragma clang diagnostic pop |
375 | | #endif |
376 | | |
377 | | |
378 | | static const Prefable<const ConstantSpec> sConstants[] = { |
379 | | { nullptr, &sConstants_specs[0] }, |
380 | | { nullptr, nullptr } |
381 | | }; |
382 | | |
383 | | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX, |
384 | | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); |
385 | | static_assert(17 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX, |
386 | | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); |
387 | | |
388 | | |
389 | | static uint16_t sNativeProperties_sortedPropertyIndices[25]; |
390 | | static PropertyInfo sNativeProperties_propertyInfos[25]; |
391 | | |
392 | | static const NativePropertiesN<2> sNativeProperties = { |
393 | | false, 0, |
394 | | false, 0, |
395 | | false, 0, |
396 | | true, 0 /* sAttributes */, |
397 | | false, 0, |
398 | | false, 0, |
399 | | true, 1 /* sConstants */, |
400 | | -1, |
401 | | 25, |
402 | | sNativeProperties_sortedPropertyIndices, |
403 | | { |
404 | | { sAttributes, &sNativeProperties_propertyInfos[0] }, |
405 | | { sConstants, &sNativeProperties_propertyInfos[8] } |
406 | | } |
407 | | }; |
408 | | static_assert(25 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount), |
409 | | "We have a property info count that is oversized"); |
410 | | |
411 | | static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = { |
412 | | { |
413 | | "Function", |
414 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE), |
415 | | &sBoringInterfaceObjectClassClassOps, |
416 | | JS_NULL_CLASS_SPEC, |
417 | | JS_NULL_CLASS_EXT, |
418 | | &sInterfaceObjectClassObjectOps |
419 | | }, |
420 | | eInterface, |
421 | | true, |
422 | | prototypes::id::SVGFEBlendElement, |
423 | | PrototypeTraits<prototypes::id::SVGFEBlendElement>::Depth, |
424 | | sNativePropertyHooks, |
425 | | "function SVGFEBlendElement() {\n [native code]\n}", |
426 | | SVGElement_Binding::GetConstructorObject |
427 | | }; |
428 | | |
429 | | static const DOMIfaceAndProtoJSClass sPrototypeClass = { |
430 | | { |
431 | | "SVGFEBlendElementPrototype", |
432 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE), |
433 | | JS_NULL_CLASS_OPS, |
434 | | JS_NULL_CLASS_SPEC, |
435 | | JS_NULL_CLASS_EXT, |
436 | | JS_NULL_OBJECT_OPS |
437 | | }, |
438 | | eInterfacePrototype, |
439 | | false, |
440 | | prototypes::id::SVGFEBlendElement, |
441 | | PrototypeTraits<prototypes::id::SVGFEBlendElement>::Depth, |
442 | | sNativePropertyHooks, |
443 | | "[object SVGFEBlendElementPrototype]", |
444 | | SVGElement_Binding::GetProtoObject |
445 | | }; |
446 | | |
447 | | static const js::ClassOps sClassOps = { |
448 | | _addProperty, /* addProperty */ |
449 | | nullptr, /* delProperty */ |
450 | | nullptr, /* enumerate */ |
451 | | nullptr, /* newEnumerate */ |
452 | | nullptr, /* resolve */ |
453 | | nullptr, /* mayResolve */ |
454 | | _finalize, /* finalize */ |
455 | | nullptr, /* call */ |
456 | | nullptr, /* hasInstance */ |
457 | | nullptr, /* construct */ |
458 | | nullptr, /* trace */ |
459 | | }; |
460 | | |
461 | | static const js::ClassExtension sClassExtension = { |
462 | | nullptr, /* weakmapKeyDelegateOp */ |
463 | | _objectMoved /* objectMovedOp */ |
464 | | }; |
465 | | |
466 | | static const DOMJSClass sClass = { |
467 | | { "SVGFEBlendElement", |
468 | | JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1), |
469 | | &sClassOps, |
470 | | JS_NULL_CLASS_SPEC, |
471 | | &sClassExtension, |
472 | | JS_NULL_OBJECT_OPS |
473 | | }, |
474 | | { prototypes::id::EventTarget, prototypes::id::Node, prototypes::id::Element, prototypes::id::SVGElement, prototypes::id::SVGFEBlendElement, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count }, |
475 | | IsBaseOf<nsISupports, mozilla::dom::SVGFEBlendElement >::value, |
476 | | sNativePropertyHooks, |
477 | | FindAssociatedGlobalForNative<mozilla::dom::SVGFEBlendElement>::Get, |
478 | | GetProtoObjectHandle, |
479 | | GetCCParticipant<mozilla::dom::SVGFEBlendElement>::Get() |
480 | | }; |
481 | | static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS, |
482 | | "Must have the right minimal number of reserved slots."); |
483 | | static_assert(1 >= 1, |
484 | | "Must have enough reserved slots."); |
485 | | |
486 | | const JSClass* |
487 | | GetJSClass() |
488 | 0 | { |
489 | 0 | return sClass.ToJSClass(); |
490 | 0 | } |
491 | | |
492 | | bool |
493 | | Wrap(JSContext* aCx, mozilla::dom::SVGFEBlendElement* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector) |
494 | 0 | { |
495 | 0 | static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::dom::SVGFEBlendElement>::value, |
496 | 0 | "Shouldn't have wrappercached things that are not refcounted."); |
497 | 0 | MOZ_ASSERT(static_cast<mozilla::dom::SVGFEBlendElement*>(aObject) == |
498 | 0 | reinterpret_cast<mozilla::dom::SVGFEBlendElement*>(aObject), |
499 | 0 | "Multiple inheritance for mozilla::dom::SVGFEBlendElement is broken."); |
500 | 0 | MOZ_ASSERT(static_cast<nsSVGElement*>(aObject) == |
501 | 0 | reinterpret_cast<nsSVGElement*>(aObject), |
502 | 0 | "Multiple inheritance for nsSVGElement is broken."); |
503 | 0 | MOZ_ASSERT(static_cast<mozilla::dom::Element*>(aObject) == |
504 | 0 | reinterpret_cast<mozilla::dom::Element*>(aObject), |
505 | 0 | "Multiple inheritance for mozilla::dom::Element is broken."); |
506 | 0 | MOZ_ASSERT(static_cast<nsINode*>(aObject) == |
507 | 0 | reinterpret_cast<nsINode*>(aObject), |
508 | 0 | "Multiple inheritance for nsINode is broken."); |
509 | 0 | MOZ_ASSERT(static_cast<mozilla::dom::EventTarget*>(aObject) == |
510 | 0 | reinterpret_cast<mozilla::dom::EventTarget*>(aObject), |
511 | 0 | "Multiple inheritance for mozilla::dom::EventTarget is broken."); |
512 | 0 | MOZ_ASSERT(ToSupportsIsCorrect(aObject)); |
513 | 0 | MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx)); |
514 | 0 | MOZ_ASSERT(!aCache->GetWrapper(), |
515 | 0 | "You should probably not be using Wrap() directly; use " |
516 | 0 | "GetOrCreateDOMReflector instead"); |
517 | 0 |
|
518 | 0 | MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache), |
519 | 0 | "nsISupports must be on our primary inheritance chain"); |
520 | 0 |
|
521 | 0 | JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject())); |
522 | 0 | if (!global) { |
523 | 0 | return false; |
524 | 0 | } |
525 | 0 | MOZ_ASSERT(JS_IsGlobalObject(global)); |
526 | 0 | MOZ_ASSERT(JS::ObjectIsNotGray(global)); |
527 | 0 |
|
528 | 0 | // That might have ended up wrapping us already, due to the wonders |
529 | 0 | // of XBL. Check for that, and bail out as needed. |
530 | 0 | aReflector.set(aCache->GetWrapper()); |
531 | 0 | if (aReflector) { |
532 | | #ifdef DEBUG |
533 | | AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto); |
534 | | #endif // DEBUG |
535 | | return true; |
536 | 0 | } |
537 | 0 |
|
538 | 0 | JSAutoRealm ar(aCx, global); |
539 | 0 | JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx); |
540 | 0 | if (!canonicalProto) { |
541 | 0 | return false; |
542 | 0 | } |
543 | 0 | JS::Rooted<JSObject*> proto(aCx); |
544 | 0 | if (aGivenProto) { |
545 | 0 | proto = aGivenProto; |
546 | 0 | // Unfortunately, while aGivenProto was in the compartment of aCx |
547 | 0 | // coming in, we changed compartments to that of "parent" so may need |
548 | 0 | // to wrap the proto here. |
549 | 0 | if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) { |
550 | 0 | if (!JS_WrapObject(aCx, &proto)) { |
551 | 0 | return false; |
552 | 0 | } |
553 | 0 | } |
554 | 0 | } else { |
555 | 0 | proto = canonicalProto; |
556 | 0 | } |
557 | 0 |
|
558 | 0 | BindingJSObjectCreator<mozilla::dom::SVGFEBlendElement> creator(aCx); |
559 | 0 | creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector); |
560 | 0 | if (!aReflector) { |
561 | 0 | return false; |
562 | 0 | } |
563 | 0 | |
564 | 0 | aCache->SetWrapper(aReflector); |
565 | 0 | creator.InitializationSucceeded(); |
566 | 0 |
|
567 | 0 | MOZ_ASSERT(aCache->GetWrapperPreserveColor() && |
568 | 0 | aCache->GetWrapperPreserveColor() == aReflector); |
569 | 0 | // If proto != canonicalProto, we have to preserve our wrapper; |
570 | 0 | // otherwise we won't be able to properly recreate it later, since |
571 | 0 | // we won't know what proto to use. Note that we don't check |
572 | 0 | // aGivenProto here, since it's entirely possible (and even |
573 | 0 | // somewhat common) to have a non-null aGivenProto which is the |
574 | 0 | // same as canonicalProto. |
575 | 0 | if (proto != canonicalProto) { |
576 | 0 | PreserveWrapper(aObject); |
577 | 0 | } |
578 | 0 |
|
579 | 0 | return true; |
580 | 0 | } |
581 | | |
582 | | const NativePropertyHooks sNativePropertyHooks[] = { { |
583 | | nullptr, |
584 | | nullptr, |
585 | | nullptr, |
586 | | { sNativeProperties.Upcast(), nullptr }, |
587 | | prototypes::id::SVGFEBlendElement, |
588 | | constructors::id::SVGFEBlendElement, |
589 | | SVGElement_Binding::sNativePropertyHooks, |
590 | | &DefaultXrayExpandoObjectClass |
591 | | } }; |
592 | | |
593 | | void |
594 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal) |
595 | 0 | { |
596 | 0 | JS::Handle<JSObject*> parentProto(SVGElement_Binding::GetProtoObjectHandle(aCx)); |
597 | 0 | if (!parentProto) { |
598 | 0 | return; |
599 | 0 | } |
600 | 0 | |
601 | 0 | JS::Handle<JSObject*> constructorProto(SVGElement_Binding::GetConstructorObjectHandle(aCx)); |
602 | 0 | if (!constructorProto) { |
603 | 0 | return; |
604 | 0 | } |
605 | 0 | |
606 | 0 | static bool sIdsInited = false; |
607 | 0 | if (!sIdsInited && NS_IsMainThread()) { |
608 | 0 | if (!InitIds(aCx, sNativeProperties.Upcast())) { |
609 | 0 | return; |
610 | 0 | } |
611 | 0 | sIdsInited = true; |
612 | 0 | } |
613 | 0 |
|
614 | 0 | JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::SVGFEBlendElement); |
615 | 0 | JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::SVGFEBlendElement); |
616 | 0 | dom::CreateInterfaceObjects(aCx, aGlobal, parentProto, |
617 | 0 | &sPrototypeClass.mBase, protoCache, |
618 | 0 | nullptr, |
619 | 0 | constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr, |
620 | 0 | interfaceCache, |
621 | 0 | sNativeProperties.Upcast(), |
622 | 0 | nullptr, |
623 | 0 | "SVGFEBlendElement", aDefineOnGlobal, |
624 | 0 | nullptr, |
625 | 0 | false); |
626 | 0 | } |
627 | | |
628 | | JSObject* |
629 | | GetConstructorObject(JSContext* aCx) |
630 | 0 | { |
631 | 0 | return GetConstructorObjectHandle(aCx); |
632 | 0 | } |
633 | | |
634 | | } // namespace SVGFEBlendElement_Binding |
635 | | |
636 | | |
637 | | |
638 | | } // namespace dom |
639 | | } // namespace mozilla |