/work/obj-fuzz/dom/bindings/SVGSVGElementBinding.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM SVGSVGElement.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #include "DOMSVGLength.h" |
4 | | #include "DOMSVGNumber.h" |
5 | | #include "SVGAnimatedPreserveAspectRatio.h" |
6 | | #include "SVGGraphicsElementBinding.h" |
7 | | #include "SVGSVGElementBinding.h" |
8 | | #include "WrapperFactory.h" |
9 | | #include "mozilla/FloatingPoint.h" |
10 | | #include "mozilla/OwningNonNull.h" |
11 | | #include "mozilla/UseCounter.h" |
12 | | #include "mozilla/dom/BindingUtils.h" |
13 | | #include "mozilla/dom/DOMJSClass.h" |
14 | | #include "mozilla/dom/Element.h" |
15 | | #include "mozilla/dom/NonRefcountedDOMObject.h" |
16 | | #include "mozilla/dom/Nullable.h" |
17 | | #include "mozilla/dom/PrimitiveConversions.h" |
18 | | #include "mozilla/dom/SVGAngle.h" |
19 | | #include "mozilla/dom/SVGAnimatedLength.h" |
20 | | #include "mozilla/dom/SVGAnimatedRect.h" |
21 | | #include "mozilla/dom/SVGIRect.h" |
22 | | #include "mozilla/dom/SVGMatrix.h" |
23 | | #include "mozilla/dom/SVGSVGElement.h" |
24 | | #include "mozilla/dom/SVGTransform.h" |
25 | | #include "mozilla/dom/XrayExpandoClass.h" |
26 | | #include "nsISVGPoint.h" |
27 | | |
28 | | namespace mozilla { |
29 | | namespace dom { |
30 | | |
31 | | namespace binding_detail {}; // Just to make sure it's known as a namespace |
32 | | using namespace mozilla::dom::binding_detail; |
33 | | |
34 | | |
35 | | namespace SVGSVGElement_Binding { |
36 | | |
37 | | static_assert(IsRefcounted<NativeType>::value == IsRefcounted<SVGGraphicsElement_Binding::NativeType>::value, |
38 | | "Can't inherit from an interface with a different ownership model."); |
39 | | |
40 | | MOZ_CAN_RUN_SCRIPT static bool |
41 | | get_x(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, JSJitGetterCallArgs args) |
42 | 0 | { |
43 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGSVGElement.x", DOM, cx); |
44 | 0 |
|
45 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->X())); |
46 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
47 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
48 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
49 | 0 | return false; |
50 | 0 | } |
51 | 0 | return true; |
52 | 0 | } |
53 | | |
54 | | static const JSJitInfo x_getterinfo = { |
55 | | { (JSJitGetterOp)get_x }, |
56 | | { prototypes::id::SVGSVGElement }, |
57 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
58 | | JSJitInfo::Getter, |
59 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
60 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
61 | | false, /* isInfallible. False in setters. */ |
62 | | true, /* isMovable. Not relevant for setters. */ |
63 | | true, /* isEliminatable. Not relevant for setters. */ |
64 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
65 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
66 | | false, /* isTypedMethod. Only relevant for methods. */ |
67 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
68 | | }; |
69 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
70 | | static_assert(0 < 1, "There is no slot for us"); |
71 | | |
72 | | MOZ_CAN_RUN_SCRIPT static bool |
73 | | get_y(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, JSJitGetterCallArgs args) |
74 | 0 | { |
75 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGSVGElement.y", DOM, cx); |
76 | 0 |
|
77 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->Y())); |
78 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
79 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
80 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
81 | 0 | return false; |
82 | 0 | } |
83 | 0 | return true; |
84 | 0 | } |
85 | | |
86 | | static const JSJitInfo y_getterinfo = { |
87 | | { (JSJitGetterOp)get_y }, |
88 | | { prototypes::id::SVGSVGElement }, |
89 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
90 | | JSJitInfo::Getter, |
91 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
92 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
93 | | false, /* isInfallible. False in setters. */ |
94 | | true, /* isMovable. Not relevant for setters. */ |
95 | | true, /* isEliminatable. Not relevant for setters. */ |
96 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
97 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
98 | | false, /* isTypedMethod. Only relevant for methods. */ |
99 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
100 | | }; |
101 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
102 | | static_assert(0 < 1, "There is no slot for us"); |
103 | | |
104 | | MOZ_CAN_RUN_SCRIPT static bool |
105 | | get_width(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, JSJitGetterCallArgs args) |
106 | 0 | { |
107 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGSVGElement.width", DOM, cx); |
108 | 0 |
|
109 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->Width())); |
110 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
111 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
112 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
113 | 0 | return false; |
114 | 0 | } |
115 | 0 | return true; |
116 | 0 | } |
117 | | |
118 | | static const JSJitInfo width_getterinfo = { |
119 | | { (JSJitGetterOp)get_width }, |
120 | | { prototypes::id::SVGSVGElement }, |
121 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
122 | | JSJitInfo::Getter, |
123 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
124 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
125 | | false, /* isInfallible. False in setters. */ |
126 | | true, /* isMovable. Not relevant for setters. */ |
127 | | true, /* isEliminatable. Not relevant for setters. */ |
128 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
129 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
130 | | false, /* isTypedMethod. Only relevant for methods. */ |
131 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
132 | | }; |
133 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
134 | | static_assert(0 < 1, "There is no slot for us"); |
135 | | |
136 | | MOZ_CAN_RUN_SCRIPT static bool |
137 | | get_height(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, JSJitGetterCallArgs args) |
138 | 0 | { |
139 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGSVGElement.height", DOM, cx); |
140 | 0 |
|
141 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->Height())); |
142 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
143 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
144 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
145 | 0 | return false; |
146 | 0 | } |
147 | 0 | return true; |
148 | 0 | } |
149 | | |
150 | | static const JSJitInfo height_getterinfo = { |
151 | | { (JSJitGetterOp)get_height }, |
152 | | { prototypes::id::SVGSVGElement }, |
153 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
154 | | JSJitInfo::Getter, |
155 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
156 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
157 | | false, /* isInfallible. False in setters. */ |
158 | | true, /* isMovable. Not relevant for setters. */ |
159 | | true, /* isEliminatable. Not relevant for setters. */ |
160 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
161 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
162 | | false, /* isTypedMethod. Only relevant for methods. */ |
163 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
164 | | }; |
165 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
166 | | static_assert(0 < 1, "There is no slot for us"); |
167 | | |
168 | | MOZ_CAN_RUN_SCRIPT static bool |
169 | | get_useCurrentView(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, JSJitGetterCallArgs args) |
170 | 0 | { |
171 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGSVGElement.useCurrentView", DOM, cx); |
172 | 0 |
|
173 | 0 | bool result(self->UseCurrentView()); |
174 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
175 | 0 | args.rval().setBoolean(result); |
176 | 0 | return true; |
177 | 0 | } |
178 | | |
179 | | static const JSJitInfo useCurrentView_getterinfo = { |
180 | | { (JSJitGetterOp)get_useCurrentView }, |
181 | | { prototypes::id::SVGSVGElement }, |
182 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
183 | | JSJitInfo::Getter, |
184 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
185 | | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ |
186 | | true, /* isInfallible. False in setters. */ |
187 | | false, /* isMovable. Not relevant for setters. */ |
188 | | false, /* isEliminatable. Not relevant for setters. */ |
189 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
190 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
191 | | false, /* isTypedMethod. Only relevant for methods. */ |
192 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
193 | | }; |
194 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
195 | | static_assert(0 < 1, "There is no slot for us"); |
196 | | |
197 | | MOZ_CAN_RUN_SCRIPT static bool |
198 | | get_currentScale(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, JSJitGetterCallArgs args) |
199 | 0 | { |
200 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGSVGElement.currentScale", DOM, cx); |
201 | 0 |
|
202 | 0 | float result(self->CurrentScale()); |
203 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
204 | 0 | SetDocumentAndPageUseCounter(obj, eUseCounter_SVGSVGElement_currentScale_getter); |
205 | 0 | args.rval().set(JS_NumberValue(double(result))); |
206 | 0 | return true; |
207 | 0 | } |
208 | | |
209 | | MOZ_CAN_RUN_SCRIPT static bool |
210 | | set_currentScale(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, JSJitSetterCallArgs args) |
211 | 0 | { |
212 | 0 | AUTO_PROFILER_LABEL_FAST("set SVGSVGElement.currentScale", DOM, cx); |
213 | 0 |
|
214 | 0 | float arg0; |
215 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[0], &arg0)) { |
216 | 0 | return false; |
217 | 0 | } else if (!mozilla::IsFinite(arg0)) { |
218 | 0 | ThrowErrorMessage(cx, MSG_NOT_FINITE, "Value being assigned to SVGSVGElement.currentScale"); |
219 | 0 | return false; |
220 | 0 | } |
221 | 0 | self->SetCurrentScale(arg0); |
222 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
223 | 0 | SetDocumentAndPageUseCounter(obj, eUseCounter_SVGSVGElement_currentScale_setter); |
224 | 0 |
|
225 | 0 | return true; |
226 | 0 | } |
227 | | |
228 | | static const JSJitInfo currentScale_getterinfo = { |
229 | | { (JSJitGetterOp)get_currentScale }, |
230 | | { prototypes::id::SVGSVGElement }, |
231 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
232 | | JSJitInfo::Getter, |
233 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
234 | | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ |
235 | | true, /* isInfallible. False in setters. */ |
236 | | false, /* isMovable. Not relevant for setters. */ |
237 | | false, /* isEliminatable. Not relevant for setters. */ |
238 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
239 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
240 | | false, /* isTypedMethod. Only relevant for methods. */ |
241 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
242 | | }; |
243 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
244 | | static_assert(0 < 1, "There is no slot for us"); |
245 | | static const JSJitInfo currentScale_setterinfo = { |
246 | | { (JSJitGetterOp)set_currentScale }, |
247 | | { prototypes::id::SVGSVGElement }, |
248 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
249 | | JSJitInfo::Setter, |
250 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
251 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
252 | | false, /* isInfallible. False in setters. */ |
253 | | false, /* isMovable. Not relevant for setters. */ |
254 | | false, /* isEliminatable. Not relevant for setters. */ |
255 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
256 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
257 | | false, /* isTypedMethod. Only relevant for methods. */ |
258 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
259 | | }; |
260 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
261 | | static_assert(0 < 1, "There is no slot for us"); |
262 | | |
263 | | MOZ_CAN_RUN_SCRIPT static bool |
264 | | get_currentTranslate(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, JSJitGetterCallArgs args) |
265 | 0 | { |
266 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGSVGElement.currentTranslate", DOM, cx); |
267 | 0 |
|
268 | 0 | auto result(StrongOrRawPtr<mozilla::nsISVGPoint>(self->CurrentTranslate())); |
269 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
270 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
271 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
272 | 0 | return false; |
273 | 0 | } |
274 | 0 | return true; |
275 | 0 | } |
276 | | |
277 | | static const JSJitInfo currentTranslate_getterinfo = { |
278 | | { (JSJitGetterOp)get_currentTranslate }, |
279 | | { prototypes::id::SVGSVGElement }, |
280 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
281 | | JSJitInfo::Getter, |
282 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
283 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
284 | | false, /* isInfallible. False in setters. */ |
285 | | false, /* isMovable. Not relevant for setters. */ |
286 | | false, /* isEliminatable. Not relevant for setters. */ |
287 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
288 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
289 | | false, /* isTypedMethod. Only relevant for methods. */ |
290 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
291 | | }; |
292 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
293 | | static_assert(0 < 1, "There is no slot for us"); |
294 | | |
295 | | MOZ_CAN_RUN_SCRIPT static bool |
296 | | suspendRedraw(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
297 | 0 | { |
298 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.suspendRedraw", DOM, cx); |
299 | 0 |
|
300 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
301 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "SVGSVGElement.suspendRedraw"); |
302 | 0 | } |
303 | 0 | uint32_t arg0; |
304 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
305 | 0 | return false; |
306 | 0 | } |
307 | 0 | uint32_t result(self->SuspendRedraw(arg0)); |
308 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
309 | 0 | args.rval().setNumber(result); |
310 | 0 | return true; |
311 | 0 | } |
312 | | |
313 | | static const JSJitInfo::ArgType suspendRedraw_methodinfo_argTypes[] = { JSJitInfo::Double, JSJitInfo::ArgTypeListEnd }; |
314 | | static const JSTypedMethodJitInfo suspendRedraw_methodinfo = { |
315 | | { |
316 | | { (JSJitGetterOp)suspendRedraw }, |
317 | | { prototypes::id::SVGSVGElement }, |
318 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
319 | | JSJitInfo::Method, |
320 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
321 | | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ |
322 | | false, /* isInfallible. False in setters. */ |
323 | | true, /* isMovable. Not relevant for setters. */ |
324 | | true, /* isEliminatable. Not relevant for setters. */ |
325 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
326 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
327 | | true, /* isTypedMethod. Only relevant for methods. */ |
328 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
329 | | }, |
330 | | suspendRedraw_methodinfo_argTypes |
331 | | }; |
332 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
333 | | static_assert(0 < 1, "There is no slot for us"); |
334 | | |
335 | | MOZ_CAN_RUN_SCRIPT static bool |
336 | | unsuspendRedraw(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
337 | 0 | { |
338 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.unsuspendRedraw", DOM, cx); |
339 | 0 |
|
340 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
341 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "SVGSVGElement.unsuspendRedraw"); |
342 | 0 | } |
343 | 0 | uint32_t arg0; |
344 | 0 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) { |
345 | 0 | return false; |
346 | 0 | } |
347 | 0 | self->UnsuspendRedraw(arg0); |
348 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
349 | 0 | args.rval().setUndefined(); |
350 | 0 | return true; |
351 | 0 | } |
352 | | |
353 | | static const JSJitInfo::ArgType unsuspendRedraw_methodinfo_argTypes[] = { JSJitInfo::Double, JSJitInfo::ArgTypeListEnd }; |
354 | | static const JSTypedMethodJitInfo unsuspendRedraw_methodinfo = { |
355 | | { |
356 | | { (JSJitGetterOp)unsuspendRedraw }, |
357 | | { prototypes::id::SVGSVGElement }, |
358 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
359 | | JSJitInfo::Method, |
360 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
361 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
362 | | false, /* isInfallible. False in setters. */ |
363 | | true, /* isMovable. Not relevant for setters. */ |
364 | | true, /* isEliminatable. Not relevant for setters. */ |
365 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
366 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
367 | | true, /* isTypedMethod. Only relevant for methods. */ |
368 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
369 | | }, |
370 | | unsuspendRedraw_methodinfo_argTypes |
371 | | }; |
372 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
373 | | static_assert(0 < 1, "There is no slot for us"); |
374 | | |
375 | | MOZ_CAN_RUN_SCRIPT static bool |
376 | | unsuspendRedrawAll(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
377 | 0 | { |
378 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.unsuspendRedrawAll", DOM, cx); |
379 | 0 |
|
380 | 0 | self->UnsuspendRedrawAll(); |
381 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
382 | 0 | args.rval().setUndefined(); |
383 | 0 | return true; |
384 | 0 | } |
385 | | |
386 | | static const JSJitInfo::ArgType unsuspendRedrawAll_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd }; |
387 | | static const JSTypedMethodJitInfo unsuspendRedrawAll_methodinfo = { |
388 | | { |
389 | | { (JSJitGetterOp)unsuspendRedrawAll }, |
390 | | { prototypes::id::SVGSVGElement }, |
391 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
392 | | JSJitInfo::Method, |
393 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
394 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
395 | | true, /* isInfallible. False in setters. */ |
396 | | true, /* isMovable. Not relevant for setters. */ |
397 | | true, /* isEliminatable. Not relevant for setters. */ |
398 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
399 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
400 | | true, /* isTypedMethod. Only relevant for methods. */ |
401 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
402 | | }, |
403 | | unsuspendRedrawAll_methodinfo_argTypes |
404 | | }; |
405 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
406 | | static_assert(0 < 1, "There is no slot for us"); |
407 | | |
408 | | MOZ_CAN_RUN_SCRIPT static bool |
409 | | forceRedraw(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
410 | 0 | { |
411 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.forceRedraw", DOM, cx); |
412 | 0 |
|
413 | 0 | self->ForceRedraw(); |
414 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
415 | 0 | args.rval().setUndefined(); |
416 | 0 | return true; |
417 | 0 | } |
418 | | |
419 | | static const JSJitInfo::ArgType forceRedraw_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd }; |
420 | | static const JSTypedMethodJitInfo forceRedraw_methodinfo = { |
421 | | { |
422 | | { (JSJitGetterOp)forceRedraw }, |
423 | | { prototypes::id::SVGSVGElement }, |
424 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
425 | | JSJitInfo::Method, |
426 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
427 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
428 | | true, /* isInfallible. False in setters. */ |
429 | | true, /* isMovable. Not relevant for setters. */ |
430 | | true, /* isEliminatable. Not relevant for setters. */ |
431 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
432 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
433 | | true, /* isTypedMethod. Only relevant for methods. */ |
434 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
435 | | }, |
436 | | forceRedraw_methodinfo_argTypes |
437 | | }; |
438 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
439 | | static_assert(0 < 1, "There is no slot for us"); |
440 | | |
441 | | MOZ_CAN_RUN_SCRIPT static bool |
442 | | pauseAnimations(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
443 | 0 | { |
444 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.pauseAnimations", DOM, cx); |
445 | 0 |
|
446 | 0 | self->PauseAnimations(); |
447 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
448 | 0 | args.rval().setUndefined(); |
449 | 0 | return true; |
450 | 0 | } |
451 | | |
452 | | static const JSJitInfo pauseAnimations_methodinfo = { |
453 | | { (JSJitGetterOp)pauseAnimations }, |
454 | | { prototypes::id::SVGSVGElement }, |
455 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
456 | | JSJitInfo::Method, |
457 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
458 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
459 | | true, /* isInfallible. False in setters. */ |
460 | | false, /* isMovable. Not relevant for setters. */ |
461 | | false, /* isEliminatable. Not relevant for setters. */ |
462 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
463 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
464 | | false, /* isTypedMethod. Only relevant for methods. */ |
465 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
466 | | }; |
467 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
468 | | static_assert(0 < 1, "There is no slot for us"); |
469 | | |
470 | | MOZ_CAN_RUN_SCRIPT static bool |
471 | | unpauseAnimations(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
472 | 0 | { |
473 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.unpauseAnimations", DOM, cx); |
474 | 0 |
|
475 | 0 | self->UnpauseAnimations(); |
476 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
477 | 0 | args.rval().setUndefined(); |
478 | 0 | return true; |
479 | 0 | } |
480 | | |
481 | | static const JSJitInfo unpauseAnimations_methodinfo = { |
482 | | { (JSJitGetterOp)unpauseAnimations }, |
483 | | { prototypes::id::SVGSVGElement }, |
484 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
485 | | JSJitInfo::Method, |
486 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
487 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
488 | | true, /* isInfallible. False in setters. */ |
489 | | false, /* isMovable. Not relevant for setters. */ |
490 | | false, /* isEliminatable. Not relevant for setters. */ |
491 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
492 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
493 | | false, /* isTypedMethod. Only relevant for methods. */ |
494 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
495 | | }; |
496 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
497 | | static_assert(0 < 1, "There is no slot for us"); |
498 | | |
499 | | MOZ_CAN_RUN_SCRIPT static bool |
500 | | animationsPaused(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
501 | 0 | { |
502 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.animationsPaused", DOM, cx); |
503 | 0 |
|
504 | 0 | bool result(self->AnimationsPaused()); |
505 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
506 | 0 | args.rval().setBoolean(result); |
507 | 0 | return true; |
508 | 0 | } |
509 | | |
510 | | static const JSJitInfo animationsPaused_methodinfo = { |
511 | | { (JSJitGetterOp)animationsPaused }, |
512 | | { prototypes::id::SVGSVGElement }, |
513 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
514 | | JSJitInfo::Method, |
515 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
516 | | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ |
517 | | true, /* isInfallible. False in setters. */ |
518 | | false, /* isMovable. Not relevant for setters. */ |
519 | | false, /* isEliminatable. Not relevant for setters. */ |
520 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
521 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
522 | | false, /* isTypedMethod. Only relevant for methods. */ |
523 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
524 | | }; |
525 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
526 | | static_assert(0 < 1, "There is no slot for us"); |
527 | | |
528 | | MOZ_CAN_RUN_SCRIPT static bool |
529 | | getCurrentTime(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
530 | 0 | { |
531 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.getCurrentTime", DOM, cx); |
532 | 0 |
|
533 | 0 | float result(self->GetCurrentTime()); |
534 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
535 | 0 | args.rval().set(JS_NumberValue(double(result))); |
536 | 0 | return true; |
537 | 0 | } |
538 | | |
539 | | static const JSJitInfo getCurrentTime_methodinfo = { |
540 | | { (JSJitGetterOp)getCurrentTime }, |
541 | | { prototypes::id::SVGSVGElement }, |
542 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
543 | | JSJitInfo::Method, |
544 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
545 | | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ |
546 | | true, /* isInfallible. False in setters. */ |
547 | | false, /* isMovable. Not relevant for setters. */ |
548 | | false, /* isEliminatable. Not relevant for setters. */ |
549 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
550 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
551 | | false, /* isTypedMethod. Only relevant for methods. */ |
552 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
553 | | }; |
554 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
555 | | static_assert(0 < 1, "There is no slot for us"); |
556 | | |
557 | | MOZ_CAN_RUN_SCRIPT static bool |
558 | | setCurrentTime(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
559 | 0 | { |
560 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.setCurrentTime", DOM, cx); |
561 | 0 |
|
562 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
563 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "SVGSVGElement.setCurrentTime"); |
564 | 0 | } |
565 | 0 | float arg0; |
566 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[0], &arg0)) { |
567 | 0 | return false; |
568 | 0 | } else if (!mozilla::IsFinite(arg0)) { |
569 | 0 | ThrowErrorMessage(cx, MSG_NOT_FINITE, "Argument 1 of SVGSVGElement.setCurrentTime"); |
570 | 0 | return false; |
571 | 0 | } |
572 | 0 | self->SetCurrentTime(arg0); |
573 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
574 | 0 | args.rval().setUndefined(); |
575 | 0 | return true; |
576 | 0 | } |
577 | | |
578 | | static const JSJitInfo setCurrentTime_methodinfo = { |
579 | | { (JSJitGetterOp)setCurrentTime }, |
580 | | { prototypes::id::SVGSVGElement }, |
581 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
582 | | JSJitInfo::Method, |
583 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
584 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
585 | | false, /* isInfallible. False in setters. */ |
586 | | false, /* isMovable. Not relevant for setters. */ |
587 | | false, /* isEliminatable. Not relevant for setters. */ |
588 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
589 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
590 | | false, /* isTypedMethod. Only relevant for methods. */ |
591 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
592 | | }; |
593 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
594 | | static_assert(0 < 1, "There is no slot for us"); |
595 | | |
596 | | MOZ_CAN_RUN_SCRIPT static bool |
597 | | deselectAll(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
598 | 0 | { |
599 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.deselectAll", DOM, cx); |
600 | 0 |
|
601 | 0 | self->DeselectAll(); |
602 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
603 | 0 | args.rval().setUndefined(); |
604 | 0 | return true; |
605 | 0 | } |
606 | | |
607 | | static const JSJitInfo deselectAll_methodinfo = { |
608 | | { (JSJitGetterOp)deselectAll }, |
609 | | { prototypes::id::SVGSVGElement }, |
610 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
611 | | JSJitInfo::Method, |
612 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
613 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
614 | | true, /* isInfallible. False in setters. */ |
615 | | false, /* isMovable. Not relevant for setters. */ |
616 | | false, /* isEliminatable. Not relevant for setters. */ |
617 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
618 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
619 | | false, /* isTypedMethod. Only relevant for methods. */ |
620 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
621 | | }; |
622 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
623 | | static_assert(0 < 1, "There is no slot for us"); |
624 | | |
625 | | MOZ_CAN_RUN_SCRIPT static bool |
626 | | createSVGNumber(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
627 | 0 | { |
628 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.createSVGNumber", DOM, cx); |
629 | 0 |
|
630 | 0 | auto result(StrongOrRawPtr<mozilla::DOMSVGNumber>(self->CreateSVGNumber())); |
631 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
632 | 0 | static_assert(!IsPointer<decltype(result)>::value, |
633 | 0 | "NewObject implies that we need to keep the object alive with a strong reference."); |
634 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
635 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
636 | 0 | return false; |
637 | 0 | } |
638 | 0 | return true; |
639 | 0 | } |
640 | | |
641 | | static const JSJitInfo createSVGNumber_methodinfo = { |
642 | | { (JSJitGetterOp)createSVGNumber }, |
643 | | { prototypes::id::SVGSVGElement }, |
644 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
645 | | JSJitInfo::Method, |
646 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
647 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
648 | | false, /* isInfallible. False in setters. */ |
649 | | false, /* isMovable. Not relevant for setters. */ |
650 | | false, /* isEliminatable. Not relevant for setters. */ |
651 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
652 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
653 | | false, /* isTypedMethod. Only relevant for methods. */ |
654 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
655 | | }; |
656 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
657 | | static_assert(0 < 1, "There is no slot for us"); |
658 | | |
659 | | MOZ_CAN_RUN_SCRIPT static bool |
660 | | createSVGLength(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
661 | 0 | { |
662 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.createSVGLength", DOM, cx); |
663 | 0 |
|
664 | 0 | auto result(StrongOrRawPtr<mozilla::DOMSVGLength>(self->CreateSVGLength())); |
665 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
666 | 0 | static_assert(!IsPointer<decltype(result)>::value, |
667 | 0 | "NewObject implies that we need to keep the object alive with a strong reference."); |
668 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
669 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
670 | 0 | return false; |
671 | 0 | } |
672 | 0 | return true; |
673 | 0 | } |
674 | | |
675 | | static const JSJitInfo createSVGLength_methodinfo = { |
676 | | { (JSJitGetterOp)createSVGLength }, |
677 | | { prototypes::id::SVGSVGElement }, |
678 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
679 | | JSJitInfo::Method, |
680 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
681 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
682 | | false, /* isInfallible. False in setters. */ |
683 | | false, /* isMovable. Not relevant for setters. */ |
684 | | false, /* isEliminatable. Not relevant for setters. */ |
685 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
686 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
687 | | false, /* isTypedMethod. Only relevant for methods. */ |
688 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
689 | | }; |
690 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
691 | | static_assert(0 < 1, "There is no slot for us"); |
692 | | |
693 | | MOZ_CAN_RUN_SCRIPT static bool |
694 | | createSVGAngle(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
695 | 0 | { |
696 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.createSVGAngle", DOM, cx); |
697 | 0 |
|
698 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAngle>(self->CreateSVGAngle())); |
699 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
700 | 0 | static_assert(!IsPointer<decltype(result)>::value, |
701 | 0 | "NewObject implies that we need to keep the object alive with a strong reference."); |
702 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
703 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
704 | 0 | return false; |
705 | 0 | } |
706 | 0 | return true; |
707 | 0 | } |
708 | | |
709 | | static const JSJitInfo createSVGAngle_methodinfo = { |
710 | | { (JSJitGetterOp)createSVGAngle }, |
711 | | { prototypes::id::SVGSVGElement }, |
712 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
713 | | JSJitInfo::Method, |
714 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
715 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
716 | | false, /* isInfallible. False in setters. */ |
717 | | false, /* isMovable. Not relevant for setters. */ |
718 | | false, /* isEliminatable. Not relevant for setters. */ |
719 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
720 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
721 | | false, /* isTypedMethod. Only relevant for methods. */ |
722 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
723 | | }; |
724 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
725 | | static_assert(0 < 1, "There is no slot for us"); |
726 | | |
727 | | MOZ_CAN_RUN_SCRIPT static bool |
728 | | createSVGPoint(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
729 | 0 | { |
730 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.createSVGPoint", DOM, cx); |
731 | 0 |
|
732 | 0 | auto result(StrongOrRawPtr<mozilla::nsISVGPoint>(self->CreateSVGPoint())); |
733 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
734 | 0 | static_assert(!IsPointer<decltype(result)>::value, |
735 | 0 | "NewObject implies that we need to keep the object alive with a strong reference."); |
736 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
737 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
738 | 0 | return false; |
739 | 0 | } |
740 | 0 | return true; |
741 | 0 | } |
742 | | |
743 | | static const JSJitInfo createSVGPoint_methodinfo = { |
744 | | { (JSJitGetterOp)createSVGPoint }, |
745 | | { prototypes::id::SVGSVGElement }, |
746 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
747 | | JSJitInfo::Method, |
748 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
749 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
750 | | false, /* isInfallible. False in setters. */ |
751 | | false, /* isMovable. Not relevant for setters. */ |
752 | | false, /* isEliminatable. Not relevant for setters. */ |
753 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
754 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
755 | | false, /* isTypedMethod. Only relevant for methods. */ |
756 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
757 | | }; |
758 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
759 | | static_assert(0 < 1, "There is no slot for us"); |
760 | | |
761 | | MOZ_CAN_RUN_SCRIPT static bool |
762 | | createSVGMatrix(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
763 | 0 | { |
764 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.createSVGMatrix", DOM, cx); |
765 | 0 |
|
766 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGMatrix>(self->CreateSVGMatrix())); |
767 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
768 | 0 | static_assert(!IsPointer<decltype(result)>::value, |
769 | 0 | "NewObject implies that we need to keep the object alive with a strong reference."); |
770 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
771 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
772 | 0 | return false; |
773 | 0 | } |
774 | 0 | return true; |
775 | 0 | } |
776 | | |
777 | | static const JSJitInfo createSVGMatrix_methodinfo = { |
778 | | { (JSJitGetterOp)createSVGMatrix }, |
779 | | { prototypes::id::SVGSVGElement }, |
780 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
781 | | JSJitInfo::Method, |
782 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
783 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
784 | | false, /* isInfallible. False in setters. */ |
785 | | false, /* isMovable. Not relevant for setters. */ |
786 | | false, /* isEliminatable. Not relevant for setters. */ |
787 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
788 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
789 | | false, /* isTypedMethod. Only relevant for methods. */ |
790 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
791 | | }; |
792 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
793 | | static_assert(0 < 1, "There is no slot for us"); |
794 | | |
795 | | MOZ_CAN_RUN_SCRIPT static bool |
796 | | createSVGRect(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
797 | 0 | { |
798 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.createSVGRect", DOM, cx); |
799 | 0 |
|
800 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGIRect>(self->CreateSVGRect())); |
801 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
802 | 0 | static_assert(!IsPointer<decltype(result)>::value, |
803 | 0 | "NewObject implies that we need to keep the object alive with a strong reference."); |
804 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
805 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
806 | 0 | return false; |
807 | 0 | } |
808 | 0 | return true; |
809 | 0 | } |
810 | | |
811 | | static const JSJitInfo createSVGRect_methodinfo = { |
812 | | { (JSJitGetterOp)createSVGRect }, |
813 | | { prototypes::id::SVGSVGElement }, |
814 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
815 | | JSJitInfo::Method, |
816 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
817 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
818 | | false, /* isInfallible. False in setters. */ |
819 | | false, /* isMovable. Not relevant for setters. */ |
820 | | false, /* isEliminatable. Not relevant for setters. */ |
821 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
822 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
823 | | false, /* isTypedMethod. Only relevant for methods. */ |
824 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
825 | | }; |
826 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
827 | | static_assert(0 < 1, "There is no slot for us"); |
828 | | |
829 | | MOZ_CAN_RUN_SCRIPT static bool |
830 | | createSVGTransform(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
831 | 0 | { |
832 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.createSVGTransform", DOM, cx); |
833 | 0 |
|
834 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGTransform>(self->CreateSVGTransform())); |
835 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
836 | 0 | static_assert(!IsPointer<decltype(result)>::value, |
837 | 0 | "NewObject implies that we need to keep the object alive with a strong reference."); |
838 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
839 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
840 | 0 | return false; |
841 | 0 | } |
842 | 0 | return true; |
843 | 0 | } |
844 | | |
845 | | static const JSJitInfo createSVGTransform_methodinfo = { |
846 | | { (JSJitGetterOp)createSVGTransform }, |
847 | | { prototypes::id::SVGSVGElement }, |
848 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
849 | | JSJitInfo::Method, |
850 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
851 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
852 | | false, /* isInfallible. False in setters. */ |
853 | | false, /* isMovable. Not relevant for setters. */ |
854 | | false, /* isEliminatable. Not relevant for setters. */ |
855 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
856 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
857 | | false, /* isTypedMethod. Only relevant for methods. */ |
858 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
859 | | }; |
860 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
861 | | static_assert(0 < 1, "There is no slot for us"); |
862 | | |
863 | | MOZ_CAN_RUN_SCRIPT static bool |
864 | | createSVGTransformFromMatrix(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
865 | 0 | { |
866 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.createSVGTransformFromMatrix", DOM, cx); |
867 | 0 |
|
868 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
869 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "SVGSVGElement.createSVGTransformFromMatrix"); |
870 | 0 | } |
871 | 0 | NonNull<mozilla::dom::SVGMatrix> arg0; |
872 | 0 | if (args[0].isObject()) { |
873 | 0 | { |
874 | 0 | nsresult rv = UnwrapObject<prototypes::id::SVGMatrix, mozilla::dom::SVGMatrix>(args[0], arg0); |
875 | 0 | if (NS_FAILED(rv)) { |
876 | 0 | ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of SVGSVGElement.createSVGTransformFromMatrix", "SVGMatrix"); |
877 | 0 | return false; |
878 | 0 | } |
879 | 0 | } |
880 | 0 | } else { |
881 | 0 | ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of SVGSVGElement.createSVGTransformFromMatrix"); |
882 | 0 | return false; |
883 | 0 | } |
884 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGTransform>(self->CreateSVGTransformFromMatrix(MOZ_KnownLive(NonNullHelper(arg0))))); |
885 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
886 | 0 | static_assert(!IsPointer<decltype(result)>::value, |
887 | 0 | "NewObject implies that we need to keep the object alive with a strong reference."); |
888 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
889 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
890 | 0 | return false; |
891 | 0 | } |
892 | 0 | return true; |
893 | 0 | } |
894 | | |
895 | | static const JSJitInfo createSVGTransformFromMatrix_methodinfo = { |
896 | | { (JSJitGetterOp)createSVGTransformFromMatrix }, |
897 | | { prototypes::id::SVGSVGElement }, |
898 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
899 | | JSJitInfo::Method, |
900 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
901 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
902 | | false, /* isInfallible. False in setters. */ |
903 | | false, /* isMovable. Not relevant for setters. */ |
904 | | false, /* isEliminatable. Not relevant for setters. */ |
905 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
906 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
907 | | false, /* isTypedMethod. Only relevant for methods. */ |
908 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
909 | | }; |
910 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
911 | | static_assert(0 < 1, "There is no slot for us"); |
912 | | |
913 | | MOZ_CAN_RUN_SCRIPT static bool |
914 | | getElementById(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, const JSJitMethodCallArgs& args) |
915 | 0 | { |
916 | 0 | AUTO_PROFILER_LABEL_FAST("SVGSVGElement.getElementById", DOM, cx); |
917 | 0 |
|
918 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
919 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "SVGSVGElement.getElementById"); |
920 | 0 | } |
921 | 0 | binding_detail::FakeString arg0; |
922 | 0 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { |
923 | 0 | return false; |
924 | 0 | } |
925 | 0 | auto result(StrongOrRawPtr<mozilla::dom::Element>(self->GetElementById(NonNullHelper(Constify(arg0))))); |
926 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
927 | 0 | SetDocumentAndPageUseCounter(obj, eUseCounter_SVGSVGElement_getElementById); |
928 | 0 | if (!result) { |
929 | 0 | args.rval().setNull(); |
930 | 0 | return true; |
931 | 0 | } |
932 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
933 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
934 | 0 | return false; |
935 | 0 | } |
936 | 0 | return true; |
937 | 0 | } |
938 | | |
939 | | static const JSJitInfo getElementById_methodinfo = { |
940 | | { (JSJitGetterOp)getElementById }, |
941 | | { prototypes::id::SVGSVGElement }, |
942 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
943 | | JSJitInfo::Method, |
944 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
945 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
946 | | false, /* isInfallible. False in setters. */ |
947 | | false, /* isMovable. Not relevant for setters. */ |
948 | | false, /* isEliminatable. Not relevant for setters. */ |
949 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
950 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
951 | | false, /* isTypedMethod. Only relevant for methods. */ |
952 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
953 | | }; |
954 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
955 | | static_assert(0 < 1, "There is no slot for us"); |
956 | | |
957 | | MOZ_CAN_RUN_SCRIPT static bool |
958 | | get_viewBox(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, JSJitGetterCallArgs args) |
959 | 0 | { |
960 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGSVGElement.viewBox", DOM, cx); |
961 | 0 |
|
962 | 0 | auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedRect>(self->ViewBox())); |
963 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
964 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
965 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
966 | 0 | return false; |
967 | 0 | } |
968 | 0 | return true; |
969 | 0 | } |
970 | | |
971 | | static const JSJitInfo viewBox_getterinfo = { |
972 | | { (JSJitGetterOp)get_viewBox }, |
973 | | { prototypes::id::SVGSVGElement }, |
974 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
975 | | JSJitInfo::Getter, |
976 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
977 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
978 | | false, /* isInfallible. False in setters. */ |
979 | | true, /* isMovable. Not relevant for setters. */ |
980 | | true, /* isEliminatable. Not relevant for setters. */ |
981 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
982 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
983 | | false, /* isTypedMethod. Only relevant for methods. */ |
984 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
985 | | }; |
986 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
987 | | static_assert(0 < 1, "There is no slot for us"); |
988 | | |
989 | | MOZ_CAN_RUN_SCRIPT static bool |
990 | | get_preserveAspectRatio(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, JSJitGetterCallArgs args) |
991 | 0 | { |
992 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGSVGElement.preserveAspectRatio", DOM, cx); |
993 | 0 |
|
994 | 0 | auto result(StrongOrRawPtr<mozilla::dom::DOMSVGAnimatedPreserveAspectRatio>(self->PreserveAspectRatio())); |
995 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
996 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
997 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
998 | 0 | return false; |
999 | 0 | } |
1000 | 0 | return true; |
1001 | 0 | } |
1002 | | |
1003 | | static const JSJitInfo preserveAspectRatio_getterinfo = { |
1004 | | { (JSJitGetterOp)get_preserveAspectRatio }, |
1005 | | { prototypes::id::SVGSVGElement }, |
1006 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
1007 | | JSJitInfo::Getter, |
1008 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
1009 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
1010 | | false, /* isInfallible. False in setters. */ |
1011 | | true, /* isMovable. Not relevant for setters. */ |
1012 | | true, /* isEliminatable. Not relevant for setters. */ |
1013 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
1014 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
1015 | | false, /* isTypedMethod. Only relevant for methods. */ |
1016 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
1017 | | }; |
1018 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
1019 | | static_assert(0 < 1, "There is no slot for us"); |
1020 | | |
1021 | | MOZ_CAN_RUN_SCRIPT static bool |
1022 | | get_zoomAndPan(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, JSJitGetterCallArgs args) |
1023 | 0 | { |
1024 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGSVGElement.zoomAndPan", DOM, cx); |
1025 | 0 |
|
1026 | 0 | uint16_t result(self->ZoomAndPan()); |
1027 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1028 | 0 | args.rval().setInt32(int32_t(result)); |
1029 | 0 | return true; |
1030 | 0 | } |
1031 | | |
1032 | | MOZ_CAN_RUN_SCRIPT static bool |
1033 | | set_zoomAndPan(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGSVGElement* self, JSJitSetterCallArgs args) |
1034 | 0 | { |
1035 | 0 | AUTO_PROFILER_LABEL_FAST("set SVGSVGElement.zoomAndPan", DOM, cx); |
1036 | 0 |
|
1037 | 0 | uint16_t arg0; |
1038 | 0 | if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[0], &arg0)) { |
1039 | 0 | return false; |
1040 | 0 | } |
1041 | 0 | FastErrorResult rv; |
1042 | 0 | self->SetZoomAndPan(arg0, rv); |
1043 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
1044 | 0 | return false; |
1045 | 0 | } |
1046 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
1047 | 0 |
|
1048 | 0 | return true; |
1049 | 0 | } |
1050 | | |
1051 | | static const JSJitInfo zoomAndPan_getterinfo = { |
1052 | | { (JSJitGetterOp)get_zoomAndPan }, |
1053 | | { prototypes::id::SVGSVGElement }, |
1054 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
1055 | | JSJitInfo::Getter, |
1056 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
1057 | | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ |
1058 | | true, /* isInfallible. False in setters. */ |
1059 | | false, /* isMovable. Not relevant for setters. */ |
1060 | | false, /* isEliminatable. Not relevant for setters. */ |
1061 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
1062 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
1063 | | false, /* isTypedMethod. Only relevant for methods. */ |
1064 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
1065 | | }; |
1066 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
1067 | | static_assert(0 < 1, "There is no slot for us"); |
1068 | | static const JSJitInfo zoomAndPan_setterinfo = { |
1069 | | { (JSJitGetterOp)set_zoomAndPan }, |
1070 | | { prototypes::id::SVGSVGElement }, |
1071 | | { PrototypeTraits<prototypes::id::SVGSVGElement>::Depth }, |
1072 | | JSJitInfo::Setter, |
1073 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
1074 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
1075 | | false, /* isInfallible. False in setters. */ |
1076 | | false, /* isMovable. Not relevant for setters. */ |
1077 | | false, /* isEliminatable. Not relevant for setters. */ |
1078 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
1079 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
1080 | | false, /* isTypedMethod. Only relevant for methods. */ |
1081 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
1082 | | }; |
1083 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
1084 | | static_assert(0 < 1, "There is no slot for us"); |
1085 | | |
1086 | | static bool |
1087 | | _addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val) |
1088 | 0 | { |
1089 | 0 | mozilla::dom::SVGSVGElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGSVGElement>(obj); |
1090 | 0 | // We don't want to preserve if we don't have a wrapper, and we |
1091 | 0 | // obviously can't preserve if we're not initialized. |
1092 | 0 | if (self && self->GetWrapperPreserveColor()) { |
1093 | 0 | PreserveWrapper(self); |
1094 | 0 | } |
1095 | 0 | return true; |
1096 | 0 | } |
1097 | | |
1098 | | static void |
1099 | | _finalize(js::FreeOp* fop, JSObject* obj) |
1100 | 0 | { |
1101 | 0 | mozilla::dom::SVGSVGElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGSVGElement>(obj); |
1102 | 0 | if (self) { |
1103 | 0 | ClearWrapper(self, self, obj); |
1104 | 0 | AddForDeferredFinalization<mozilla::dom::SVGSVGElement>(self); |
1105 | 0 | } |
1106 | 0 | } |
1107 | | |
1108 | | static size_t |
1109 | | _objectMoved(JSObject* obj, JSObject* old) |
1110 | 0 | { |
1111 | 0 | mozilla::dom::SVGSVGElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGSVGElement>(obj); |
1112 | 0 | if (self) { |
1113 | 0 | UpdateWrapper(self, self, obj, old); |
1114 | 0 | } |
1115 | 0 |
|
1116 | 0 | return 0; |
1117 | 0 | } |
1118 | | |
1119 | | // We deliberately use brace-elision to make Visual Studio produce better initalization code. |
1120 | | #if defined(__clang__) |
1121 | | #pragma clang diagnostic push |
1122 | | #pragma clang diagnostic ignored "-Wmissing-braces" |
1123 | | #endif |
1124 | | static const JSFunctionSpec sMethods_specs[] = { |
1125 | | JS_FNSPEC("suspendRedraw", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&suspendRedraw_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
1126 | | JS_FNSPEC("unsuspendRedraw", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&unsuspendRedraw_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
1127 | | JS_FNSPEC("unsuspendRedrawAll", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&unsuspendRedrawAll_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
1128 | | JS_FNSPEC("forceRedraw", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&forceRedraw_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
1129 | | JS_FNSPEC("pauseAnimations", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&pauseAnimations_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
1130 | | JS_FNSPEC("unpauseAnimations", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&unpauseAnimations_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
1131 | | JS_FNSPEC("animationsPaused", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&animationsPaused_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
1132 | | JS_FNSPEC("getCurrentTime", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getCurrentTime_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
1133 | | JS_FNSPEC("setCurrentTime", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&setCurrentTime_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
1134 | | JS_FNSPEC("deselectAll", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&deselectAll_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
1135 | | JS_FNSPEC("createSVGNumber", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createSVGNumber_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
1136 | | JS_FNSPEC("createSVGLength", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createSVGLength_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
1137 | | JS_FNSPEC("createSVGAngle", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createSVGAngle_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
1138 | | JS_FNSPEC("createSVGPoint", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createSVGPoint_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
1139 | | JS_FNSPEC("createSVGMatrix", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createSVGMatrix_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
1140 | | JS_FNSPEC("createSVGRect", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createSVGRect_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
1141 | | JS_FNSPEC("createSVGTransform", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createSVGTransform_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
1142 | | JS_FNSPEC("createSVGTransformFromMatrix", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&createSVGTransformFromMatrix_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
1143 | | JS_FNSPEC("getElementById", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getElementById_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
1144 | | JS_FS_END |
1145 | | }; |
1146 | | #if defined(__clang__) |
1147 | | #pragma clang diagnostic pop |
1148 | | #endif |
1149 | | |
1150 | | |
1151 | | static const Prefable<const JSFunctionSpec> sMethods[] = { |
1152 | | { nullptr, &sMethods_specs[0] }, |
1153 | | { nullptr, nullptr } |
1154 | | }; |
1155 | | |
1156 | | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX, |
1157 | | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); |
1158 | | static_assert(19 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX, |
1159 | | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); |
1160 | | |
1161 | | // We deliberately use brace-elision to make Visual Studio produce better initalization code. |
1162 | | #if defined(__clang__) |
1163 | | #pragma clang diagnostic push |
1164 | | #pragma clang diagnostic ignored "-Wmissing-braces" |
1165 | | #endif |
1166 | | static const JSPropertySpec sAttributes_specs[] = { |
1167 | | { "x", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &x_getterinfo, nullptr, nullptr }, |
1168 | | { "y", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &y_getterinfo, nullptr, nullptr }, |
1169 | | { "width", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &width_getterinfo, nullptr, nullptr }, |
1170 | | { "height", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &height_getterinfo, nullptr, nullptr }, |
1171 | | { "useCurrentView", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &useCurrentView_getterinfo, nullptr, nullptr }, |
1172 | | { "currentScale", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, ¤tScale_getterinfo, GenericSetter<NormalThisPolicy>, ¤tScale_setterinfo }, |
1173 | | { "currentTranslate", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, ¤tTranslate_getterinfo, nullptr, nullptr }, |
1174 | | { "viewBox", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &viewBox_getterinfo, nullptr, nullptr }, |
1175 | | { "preserveAspectRatio", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &preserveAspectRatio_getterinfo, nullptr, nullptr }, |
1176 | | { "zoomAndPan", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &zoomAndPan_getterinfo, GenericSetter<NormalThisPolicy>, &zoomAndPan_setterinfo }, |
1177 | | { nullptr, 0, nullptr, nullptr, nullptr, nullptr } |
1178 | | }; |
1179 | | #if defined(__clang__) |
1180 | | #pragma clang diagnostic pop |
1181 | | #endif |
1182 | | |
1183 | | |
1184 | | static const Prefable<const JSPropertySpec> sAttributes[] = { |
1185 | | { nullptr, &sAttributes_specs[0] }, |
1186 | | { nullptr, nullptr } |
1187 | | }; |
1188 | | |
1189 | | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX, |
1190 | | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); |
1191 | | static_assert(10 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX, |
1192 | | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); |
1193 | | |
1194 | | // We deliberately use brace-elision to make Visual Studio produce better initalization code. |
1195 | | #if defined(__clang__) |
1196 | | #pragma clang diagnostic push |
1197 | | #pragma clang diagnostic ignored "-Wmissing-braces" |
1198 | | #endif |
1199 | | static const ConstantSpec sConstants_specs[] = { |
1200 | | { "SVG_ZOOMANDPAN_UNKNOWN", JS::Int32Value(0) }, |
1201 | | { "SVG_ZOOMANDPAN_DISABLE", JS::Int32Value(1) }, |
1202 | | { "SVG_ZOOMANDPAN_MAGNIFY", JS::Int32Value(2) }, |
1203 | | { 0, JS::UndefinedValue() } |
1204 | | }; |
1205 | | #if defined(__clang__) |
1206 | | #pragma clang diagnostic pop |
1207 | | #endif |
1208 | | |
1209 | | |
1210 | | static const Prefable<const ConstantSpec> sConstants[] = { |
1211 | | { nullptr, &sConstants_specs[0] }, |
1212 | | { nullptr, nullptr } |
1213 | | }; |
1214 | | |
1215 | | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX, |
1216 | | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); |
1217 | | static_assert(3 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX, |
1218 | | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); |
1219 | | |
1220 | | |
1221 | | static uint16_t sNativeProperties_sortedPropertyIndices[32]; |
1222 | | static PropertyInfo sNativeProperties_propertyInfos[32]; |
1223 | | |
1224 | | static const NativePropertiesN<3> sNativeProperties = { |
1225 | | false, 0, |
1226 | | false, 0, |
1227 | | true, 0 /* sMethods */, |
1228 | | true, 1 /* sAttributes */, |
1229 | | false, 0, |
1230 | | false, 0, |
1231 | | true, 2 /* sConstants */, |
1232 | | -1, |
1233 | | 32, |
1234 | | sNativeProperties_sortedPropertyIndices, |
1235 | | { |
1236 | | { sMethods, &sNativeProperties_propertyInfos[0] }, |
1237 | | { sAttributes, &sNativeProperties_propertyInfos[19] }, |
1238 | | { sConstants, &sNativeProperties_propertyInfos[29] } |
1239 | | } |
1240 | | }; |
1241 | | static_assert(32 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount), |
1242 | | "We have a property info count that is oversized"); |
1243 | | |
1244 | | static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = { |
1245 | | { |
1246 | | "Function", |
1247 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE), |
1248 | | &sBoringInterfaceObjectClassClassOps, |
1249 | | JS_NULL_CLASS_SPEC, |
1250 | | JS_NULL_CLASS_EXT, |
1251 | | &sInterfaceObjectClassObjectOps |
1252 | | }, |
1253 | | eInterface, |
1254 | | true, |
1255 | | prototypes::id::SVGSVGElement, |
1256 | | PrototypeTraits<prototypes::id::SVGSVGElement>::Depth, |
1257 | | sNativePropertyHooks, |
1258 | | "function SVGSVGElement() {\n [native code]\n}", |
1259 | | SVGGraphicsElement_Binding::GetConstructorObject |
1260 | | }; |
1261 | | |
1262 | | static const DOMIfaceAndProtoJSClass sPrototypeClass = { |
1263 | | { |
1264 | | "SVGSVGElementPrototype", |
1265 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE), |
1266 | | JS_NULL_CLASS_OPS, |
1267 | | JS_NULL_CLASS_SPEC, |
1268 | | JS_NULL_CLASS_EXT, |
1269 | | JS_NULL_OBJECT_OPS |
1270 | | }, |
1271 | | eInterfacePrototype, |
1272 | | false, |
1273 | | prototypes::id::SVGSVGElement, |
1274 | | PrototypeTraits<prototypes::id::SVGSVGElement>::Depth, |
1275 | | sNativePropertyHooks, |
1276 | | "[object SVGSVGElementPrototype]", |
1277 | | SVGGraphicsElement_Binding::GetProtoObject |
1278 | | }; |
1279 | | |
1280 | | static const js::ClassOps sClassOps = { |
1281 | | _addProperty, /* addProperty */ |
1282 | | nullptr, /* delProperty */ |
1283 | | nullptr, /* enumerate */ |
1284 | | nullptr, /* newEnumerate */ |
1285 | | nullptr, /* resolve */ |
1286 | | nullptr, /* mayResolve */ |
1287 | | _finalize, /* finalize */ |
1288 | | nullptr, /* call */ |
1289 | | nullptr, /* hasInstance */ |
1290 | | nullptr, /* construct */ |
1291 | | nullptr, /* trace */ |
1292 | | }; |
1293 | | |
1294 | | static const js::ClassExtension sClassExtension = { |
1295 | | nullptr, /* weakmapKeyDelegateOp */ |
1296 | | _objectMoved /* objectMovedOp */ |
1297 | | }; |
1298 | | |
1299 | | static const DOMJSClass sClass = { |
1300 | | { "SVGSVGElement", |
1301 | | JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1), |
1302 | | &sClassOps, |
1303 | | JS_NULL_CLASS_SPEC, |
1304 | | &sClassExtension, |
1305 | | JS_NULL_OBJECT_OPS |
1306 | | }, |
1307 | | { prototypes::id::EventTarget, prototypes::id::Node, prototypes::id::Element, prototypes::id::SVGElement, prototypes::id::SVGGraphicsElement, prototypes::id::SVGSVGElement, prototypes::id::_ID_Count, prototypes::id::_ID_Count }, |
1308 | | IsBaseOf<nsISupports, mozilla::dom::SVGSVGElement >::value, |
1309 | | sNativePropertyHooks, |
1310 | | FindAssociatedGlobalForNative<mozilla::dom::SVGSVGElement>::Get, |
1311 | | GetProtoObjectHandle, |
1312 | | GetCCParticipant<mozilla::dom::SVGSVGElement>::Get() |
1313 | | }; |
1314 | | static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS, |
1315 | | "Must have the right minimal number of reserved slots."); |
1316 | | static_assert(1 >= 1, |
1317 | | "Must have enough reserved slots."); |
1318 | | |
1319 | | const JSClass* |
1320 | | GetJSClass() |
1321 | 0 | { |
1322 | 0 | return sClass.ToJSClass(); |
1323 | 0 | } |
1324 | | |
1325 | | bool |
1326 | | Wrap(JSContext* aCx, mozilla::dom::SVGSVGElement* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector) |
1327 | 0 | { |
1328 | 0 | static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::dom::SVGSVGElement>::value, |
1329 | 0 | "Shouldn't have wrappercached things that are not refcounted."); |
1330 | 0 | MOZ_ASSERT(static_cast<mozilla::dom::SVGSVGElement*>(aObject) == |
1331 | 0 | reinterpret_cast<mozilla::dom::SVGSVGElement*>(aObject), |
1332 | 0 | "Multiple inheritance for mozilla::dom::SVGSVGElement is broken."); |
1333 | 0 | MOZ_ASSERT(static_cast<mozilla::dom::SVGGraphicsElement*>(aObject) == |
1334 | 0 | reinterpret_cast<mozilla::dom::SVGGraphicsElement*>(aObject), |
1335 | 0 | "Multiple inheritance for mozilla::dom::SVGGraphicsElement is broken."); |
1336 | 0 | MOZ_ASSERT(static_cast<nsSVGElement*>(aObject) == |
1337 | 0 | reinterpret_cast<nsSVGElement*>(aObject), |
1338 | 0 | "Multiple inheritance for nsSVGElement is broken."); |
1339 | 0 | MOZ_ASSERT(static_cast<mozilla::dom::Element*>(aObject) == |
1340 | 0 | reinterpret_cast<mozilla::dom::Element*>(aObject), |
1341 | 0 | "Multiple inheritance for mozilla::dom::Element is broken."); |
1342 | 0 | MOZ_ASSERT(static_cast<nsINode*>(aObject) == |
1343 | 0 | reinterpret_cast<nsINode*>(aObject), |
1344 | 0 | "Multiple inheritance for nsINode is broken."); |
1345 | 0 | MOZ_ASSERT(static_cast<mozilla::dom::EventTarget*>(aObject) == |
1346 | 0 | reinterpret_cast<mozilla::dom::EventTarget*>(aObject), |
1347 | 0 | "Multiple inheritance for mozilla::dom::EventTarget is broken."); |
1348 | 0 | MOZ_ASSERT(ToSupportsIsCorrect(aObject)); |
1349 | 0 | MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx)); |
1350 | 0 | MOZ_ASSERT(!aCache->GetWrapper(), |
1351 | 0 | "You should probably not be using Wrap() directly; use " |
1352 | 0 | "GetOrCreateDOMReflector instead"); |
1353 | 0 |
|
1354 | 0 | MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache), |
1355 | 0 | "nsISupports must be on our primary inheritance chain"); |
1356 | 0 |
|
1357 | 0 | JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject())); |
1358 | 0 | if (!global) { |
1359 | 0 | return false; |
1360 | 0 | } |
1361 | 0 | MOZ_ASSERT(JS_IsGlobalObject(global)); |
1362 | 0 | MOZ_ASSERT(JS::ObjectIsNotGray(global)); |
1363 | 0 |
|
1364 | 0 | // That might have ended up wrapping us already, due to the wonders |
1365 | 0 | // of XBL. Check for that, and bail out as needed. |
1366 | 0 | aReflector.set(aCache->GetWrapper()); |
1367 | 0 | if (aReflector) { |
1368 | | #ifdef DEBUG |
1369 | | AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto); |
1370 | | #endif // DEBUG |
1371 | | return true; |
1372 | 0 | } |
1373 | 0 |
|
1374 | 0 | JSAutoRealm ar(aCx, global); |
1375 | 0 | JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx); |
1376 | 0 | if (!canonicalProto) { |
1377 | 0 | return false; |
1378 | 0 | } |
1379 | 0 | JS::Rooted<JSObject*> proto(aCx); |
1380 | 0 | if (aGivenProto) { |
1381 | 0 | proto = aGivenProto; |
1382 | 0 | // Unfortunately, while aGivenProto was in the compartment of aCx |
1383 | 0 | // coming in, we changed compartments to that of "parent" so may need |
1384 | 0 | // to wrap the proto here. |
1385 | 0 | if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) { |
1386 | 0 | if (!JS_WrapObject(aCx, &proto)) { |
1387 | 0 | return false; |
1388 | 0 | } |
1389 | 0 | } |
1390 | 0 | } else { |
1391 | 0 | proto = canonicalProto; |
1392 | 0 | } |
1393 | 0 |
|
1394 | 0 | BindingJSObjectCreator<mozilla::dom::SVGSVGElement> creator(aCx); |
1395 | 0 | creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector); |
1396 | 0 | if (!aReflector) { |
1397 | 0 | return false; |
1398 | 0 | } |
1399 | 0 | |
1400 | 0 | aCache->SetWrapper(aReflector); |
1401 | 0 | creator.InitializationSucceeded(); |
1402 | 0 |
|
1403 | 0 | MOZ_ASSERT(aCache->GetWrapperPreserveColor() && |
1404 | 0 | aCache->GetWrapperPreserveColor() == aReflector); |
1405 | 0 | // If proto != canonicalProto, we have to preserve our wrapper; |
1406 | 0 | // otherwise we won't be able to properly recreate it later, since |
1407 | 0 | // we won't know what proto to use. Note that we don't check |
1408 | 0 | // aGivenProto here, since it's entirely possible (and even |
1409 | 0 | // somewhat common) to have a non-null aGivenProto which is the |
1410 | 0 | // same as canonicalProto. |
1411 | 0 | if (proto != canonicalProto) { |
1412 | 0 | PreserveWrapper(aObject); |
1413 | 0 | } |
1414 | 0 |
|
1415 | 0 | return true; |
1416 | 0 | } |
1417 | | |
1418 | | const NativePropertyHooks sNativePropertyHooks[] = { { |
1419 | | nullptr, |
1420 | | nullptr, |
1421 | | nullptr, |
1422 | | { sNativeProperties.Upcast(), nullptr }, |
1423 | | prototypes::id::SVGSVGElement, |
1424 | | constructors::id::SVGSVGElement, |
1425 | | SVGGraphicsElement_Binding::sNativePropertyHooks, |
1426 | | &DefaultXrayExpandoObjectClass |
1427 | | } }; |
1428 | | |
1429 | | void |
1430 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal) |
1431 | 0 | { |
1432 | 0 | JS::Handle<JSObject*> parentProto(SVGGraphicsElement_Binding::GetProtoObjectHandle(aCx)); |
1433 | 0 | if (!parentProto) { |
1434 | 0 | return; |
1435 | 0 | } |
1436 | 0 | |
1437 | 0 | JS::Handle<JSObject*> constructorProto(SVGGraphicsElement_Binding::GetConstructorObjectHandle(aCx)); |
1438 | 0 | if (!constructorProto) { |
1439 | 0 | return; |
1440 | 0 | } |
1441 | 0 | |
1442 | 0 | static bool sIdsInited = false; |
1443 | 0 | if (!sIdsInited && NS_IsMainThread()) { |
1444 | 0 | if (!InitIds(aCx, sNativeProperties.Upcast())) { |
1445 | 0 | return; |
1446 | 0 | } |
1447 | 0 | sIdsInited = true; |
1448 | 0 | } |
1449 | 0 |
|
1450 | 0 | JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::SVGSVGElement); |
1451 | 0 | JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::SVGSVGElement); |
1452 | 0 | dom::CreateInterfaceObjects(aCx, aGlobal, parentProto, |
1453 | 0 | &sPrototypeClass.mBase, protoCache, |
1454 | 0 | nullptr, |
1455 | 0 | constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr, |
1456 | 0 | interfaceCache, |
1457 | 0 | sNativeProperties.Upcast(), |
1458 | 0 | nullptr, |
1459 | 0 | "SVGSVGElement", aDefineOnGlobal, |
1460 | 0 | nullptr, |
1461 | 0 | false); |
1462 | 0 | } |
1463 | | |
1464 | | JSObject* |
1465 | | GetConstructorObject(JSContext* aCx) |
1466 | 0 | { |
1467 | 0 | return GetConstructorObjectHandle(aCx); |
1468 | 0 | } |
1469 | | |
1470 | | } // namespace SVGSVGElement_Binding |
1471 | | |
1472 | | |
1473 | | |
1474 | | } // namespace dom |
1475 | | } // namespace mozilla |