/work/obj-fuzz/dom/bindings/SVGAnimationElementBinding.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM SVGAnimationElement.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #include "DOMSVGStringList.h" |
4 | | #include "SVGAnimationElementBinding.h" |
5 | | #include "SVGElementBinding.h" |
6 | | #include "WrapperFactory.h" |
7 | | #include "mozilla/FloatingPoint.h" |
8 | | #include "mozilla/OwningNonNull.h" |
9 | | #include "mozilla/dom/BindingUtils.h" |
10 | | #include "mozilla/dom/DOMJSClass.h" |
11 | | #include "mozilla/dom/NonRefcountedDOMObject.h" |
12 | | #include "mozilla/dom/Nullable.h" |
13 | | #include "mozilla/dom/PrimitiveConversions.h" |
14 | | #include "mozilla/dom/SVGAnimationElement.h" |
15 | | #include "mozilla/dom/XrayExpandoClass.h" |
16 | | #include "nsSVGElement.h" |
17 | | |
18 | | namespace mozilla { |
19 | | namespace dom { |
20 | | |
21 | | namespace binding_detail {}; // Just to make sure it's known as a namespace |
22 | | using namespace mozilla::dom::binding_detail; |
23 | | |
24 | | |
25 | | namespace SVGAnimationElement_Binding { |
26 | | |
27 | | static_assert(IsRefcounted<NativeType>::value == IsRefcounted<SVGElement_Binding::NativeType>::value, |
28 | | "Can't inherit from an interface with a different ownership model."); |
29 | | |
30 | | MOZ_CAN_RUN_SCRIPT static bool |
31 | | get_targetElement(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGAnimationElement* self, JSJitGetterCallArgs args) |
32 | 0 | { |
33 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGAnimationElement.targetElement", DOM, cx); |
34 | 0 |
|
35 | 0 | auto result(StrongOrRawPtr<nsSVGElement>(self->GetTargetElement())); |
36 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
37 | 0 | if (!result) { |
38 | 0 | args.rval().setNull(); |
39 | 0 | return true; |
40 | 0 | } |
41 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
42 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
43 | 0 | return false; |
44 | 0 | } |
45 | 0 | return true; |
46 | 0 | } |
47 | | |
48 | | static const JSJitInfo targetElement_getterinfo = { |
49 | | { (JSJitGetterOp)get_targetElement }, |
50 | | { prototypes::id::SVGAnimationElement }, |
51 | | { PrototypeTraits<prototypes::id::SVGAnimationElement>::Depth }, |
52 | | JSJitInfo::Getter, |
53 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
54 | | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ |
55 | | false, /* isInfallible. False in setters. */ |
56 | | false, /* isMovable. Not relevant for setters. */ |
57 | | false, /* isEliminatable. Not relevant for setters. */ |
58 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
59 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
60 | | false, /* isTypedMethod. Only relevant for methods. */ |
61 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
62 | | }; |
63 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
64 | | static_assert(0 < 1, "There is no slot for us"); |
65 | | |
66 | | MOZ_CAN_RUN_SCRIPT static bool |
67 | | getStartTime(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGAnimationElement* self, const JSJitMethodCallArgs& args) |
68 | 0 | { |
69 | 0 | AUTO_PROFILER_LABEL_FAST("SVGAnimationElement.getStartTime", DOM, cx); |
70 | 0 |
|
71 | 0 | FastErrorResult rv; |
72 | 0 | float result(self->GetStartTime(rv)); |
73 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
74 | 0 | return false; |
75 | 0 | } |
76 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
77 | 0 | args.rval().set(JS_NumberValue(double(result))); |
78 | 0 | return true; |
79 | 0 | } |
80 | | |
81 | | static const JSJitInfo getStartTime_methodinfo = { |
82 | | { (JSJitGetterOp)getStartTime }, |
83 | | { prototypes::id::SVGAnimationElement }, |
84 | | { PrototypeTraits<prototypes::id::SVGAnimationElement>::Depth }, |
85 | | JSJitInfo::Method, |
86 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
87 | | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ |
88 | | false, /* isInfallible. False in setters. */ |
89 | | false, /* isMovable. Not relevant for setters. */ |
90 | | false, /* isEliminatable. Not relevant for setters. */ |
91 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
92 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
93 | | false, /* isTypedMethod. Only relevant for methods. */ |
94 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
95 | | }; |
96 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
97 | | static_assert(0 < 1, "There is no slot for us"); |
98 | | |
99 | | MOZ_CAN_RUN_SCRIPT static bool |
100 | | getCurrentTime(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGAnimationElement* self, const JSJitMethodCallArgs& args) |
101 | 0 | { |
102 | 0 | AUTO_PROFILER_LABEL_FAST("SVGAnimationElement.getCurrentTime", DOM, cx); |
103 | 0 |
|
104 | 0 | float result(self->GetCurrentTime()); |
105 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
106 | 0 | args.rval().set(JS_NumberValue(double(result))); |
107 | 0 | return true; |
108 | 0 | } |
109 | | |
110 | | static const JSJitInfo getCurrentTime_methodinfo = { |
111 | | { (JSJitGetterOp)getCurrentTime }, |
112 | | { prototypes::id::SVGAnimationElement }, |
113 | | { PrototypeTraits<prototypes::id::SVGAnimationElement>::Depth }, |
114 | | JSJitInfo::Method, |
115 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
116 | | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ |
117 | | true, /* isInfallible. False in setters. */ |
118 | | false, /* isMovable. Not relevant for setters. */ |
119 | | false, /* isEliminatable. Not relevant for setters. */ |
120 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
121 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
122 | | false, /* isTypedMethod. Only relevant for methods. */ |
123 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
124 | | }; |
125 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
126 | | static_assert(0 < 1, "There is no slot for us"); |
127 | | |
128 | | MOZ_CAN_RUN_SCRIPT static bool |
129 | | getSimpleDuration(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGAnimationElement* self, const JSJitMethodCallArgs& args) |
130 | 0 | { |
131 | 0 | AUTO_PROFILER_LABEL_FAST("SVGAnimationElement.getSimpleDuration", DOM, cx); |
132 | 0 |
|
133 | 0 | FastErrorResult rv; |
134 | 0 | float result(self->GetSimpleDuration(rv)); |
135 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
136 | 0 | return false; |
137 | 0 | } |
138 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
139 | 0 | args.rval().set(JS_NumberValue(double(result))); |
140 | 0 | return true; |
141 | 0 | } |
142 | | |
143 | | static const JSJitInfo getSimpleDuration_methodinfo = { |
144 | | { (JSJitGetterOp)getSimpleDuration }, |
145 | | { prototypes::id::SVGAnimationElement }, |
146 | | { PrototypeTraits<prototypes::id::SVGAnimationElement>::Depth }, |
147 | | JSJitInfo::Method, |
148 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
149 | | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ |
150 | | false, /* isInfallible. False in setters. */ |
151 | | false, /* isMovable. Not relevant for setters. */ |
152 | | false, /* isEliminatable. Not relevant for setters. */ |
153 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
154 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
155 | | false, /* isTypedMethod. Only relevant for methods. */ |
156 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
157 | | }; |
158 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
159 | | static_assert(0 < 1, "There is no slot for us"); |
160 | | |
161 | | MOZ_CAN_RUN_SCRIPT static bool |
162 | | beginElement(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGAnimationElement* self, const JSJitMethodCallArgs& args) |
163 | 0 | { |
164 | 0 | AUTO_PROFILER_LABEL_FAST("SVGAnimationElement.beginElement", DOM, cx); |
165 | 0 |
|
166 | 0 | FastErrorResult rv; |
167 | 0 | self->BeginElement(rv); |
168 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
169 | 0 | return false; |
170 | 0 | } |
171 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
172 | 0 | args.rval().setUndefined(); |
173 | 0 | return true; |
174 | 0 | } |
175 | | |
176 | | static const JSJitInfo beginElement_methodinfo = { |
177 | | { (JSJitGetterOp)beginElement }, |
178 | | { prototypes::id::SVGAnimationElement }, |
179 | | { PrototypeTraits<prototypes::id::SVGAnimationElement>::Depth }, |
180 | | JSJitInfo::Method, |
181 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
182 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
183 | | false, /* isInfallible. False in setters. */ |
184 | | false, /* isMovable. Not relevant for setters. */ |
185 | | false, /* isEliminatable. Not relevant for setters. */ |
186 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
187 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
188 | | false, /* isTypedMethod. Only relevant for methods. */ |
189 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
190 | | }; |
191 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
192 | | static_assert(0 < 1, "There is no slot for us"); |
193 | | |
194 | | MOZ_CAN_RUN_SCRIPT static bool |
195 | | beginElementAt(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGAnimationElement* self, const JSJitMethodCallArgs& args) |
196 | 0 | { |
197 | 0 | AUTO_PROFILER_LABEL_FAST("SVGAnimationElement.beginElementAt", DOM, cx); |
198 | 0 |
|
199 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
200 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "SVGAnimationElement.beginElementAt"); |
201 | 0 | } |
202 | 0 | float arg0; |
203 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[0], &arg0)) { |
204 | 0 | return false; |
205 | 0 | } else if (!mozilla::IsFinite(arg0)) { |
206 | 0 | ThrowErrorMessage(cx, MSG_NOT_FINITE, "Argument 1 of SVGAnimationElement.beginElementAt"); |
207 | 0 | return false; |
208 | 0 | } |
209 | 0 | FastErrorResult rv; |
210 | 0 | self->BeginElementAt(arg0, rv); |
211 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
212 | 0 | return false; |
213 | 0 | } |
214 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
215 | 0 | args.rval().setUndefined(); |
216 | 0 | return true; |
217 | 0 | } |
218 | | |
219 | | static const JSJitInfo beginElementAt_methodinfo = { |
220 | | { (JSJitGetterOp)beginElementAt }, |
221 | | { prototypes::id::SVGAnimationElement }, |
222 | | { PrototypeTraits<prototypes::id::SVGAnimationElement>::Depth }, |
223 | | JSJitInfo::Method, |
224 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
225 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
226 | | false, /* isInfallible. False in setters. */ |
227 | | false, /* isMovable. Not relevant for setters. */ |
228 | | false, /* isEliminatable. Not relevant for setters. */ |
229 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
230 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
231 | | false, /* isTypedMethod. Only relevant for methods. */ |
232 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
233 | | }; |
234 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
235 | | static_assert(0 < 1, "There is no slot for us"); |
236 | | |
237 | | MOZ_CAN_RUN_SCRIPT static bool |
238 | | endElement(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGAnimationElement* self, const JSJitMethodCallArgs& args) |
239 | 0 | { |
240 | 0 | AUTO_PROFILER_LABEL_FAST("SVGAnimationElement.endElement", DOM, cx); |
241 | 0 |
|
242 | 0 | FastErrorResult rv; |
243 | 0 | self->EndElement(rv); |
244 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
245 | 0 | return false; |
246 | 0 | } |
247 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
248 | 0 | args.rval().setUndefined(); |
249 | 0 | return true; |
250 | 0 | } |
251 | | |
252 | | static const JSJitInfo endElement_methodinfo = { |
253 | | { (JSJitGetterOp)endElement }, |
254 | | { prototypes::id::SVGAnimationElement }, |
255 | | { PrototypeTraits<prototypes::id::SVGAnimationElement>::Depth }, |
256 | | JSJitInfo::Method, |
257 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
258 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
259 | | false, /* isInfallible. False in setters. */ |
260 | | false, /* isMovable. Not relevant for setters. */ |
261 | | false, /* isEliminatable. Not relevant for setters. */ |
262 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
263 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
264 | | false, /* isTypedMethod. Only relevant for methods. */ |
265 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
266 | | }; |
267 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
268 | | static_assert(0 < 1, "There is no slot for us"); |
269 | | |
270 | | MOZ_CAN_RUN_SCRIPT static bool |
271 | | endElementAt(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGAnimationElement* self, const JSJitMethodCallArgs& args) |
272 | 0 | { |
273 | 0 | AUTO_PROFILER_LABEL_FAST("SVGAnimationElement.endElementAt", DOM, cx); |
274 | 0 |
|
275 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
276 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "SVGAnimationElement.endElementAt"); |
277 | 0 | } |
278 | 0 | float arg0; |
279 | 0 | if (!ValueToPrimitive<float, eDefault>(cx, args[0], &arg0)) { |
280 | 0 | return false; |
281 | 0 | } else if (!mozilla::IsFinite(arg0)) { |
282 | 0 | ThrowErrorMessage(cx, MSG_NOT_FINITE, "Argument 1 of SVGAnimationElement.endElementAt"); |
283 | 0 | return false; |
284 | 0 | } |
285 | 0 | FastErrorResult rv; |
286 | 0 | self->EndElementAt(arg0, rv); |
287 | 0 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) { |
288 | 0 | return false; |
289 | 0 | } |
290 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
291 | 0 | args.rval().setUndefined(); |
292 | 0 | return true; |
293 | 0 | } |
294 | | |
295 | | static const JSJitInfo endElementAt_methodinfo = { |
296 | | { (JSJitGetterOp)endElementAt }, |
297 | | { prototypes::id::SVGAnimationElement }, |
298 | | { PrototypeTraits<prototypes::id::SVGAnimationElement>::Depth }, |
299 | | JSJitInfo::Method, |
300 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
301 | | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ |
302 | | false, /* isInfallible. False in setters. */ |
303 | | false, /* isMovable. Not relevant for setters. */ |
304 | | false, /* isEliminatable. Not relevant for setters. */ |
305 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
306 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
307 | | false, /* isTypedMethod. Only relevant for methods. */ |
308 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
309 | | }; |
310 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
311 | | static_assert(0 < 1, "There is no slot for us"); |
312 | | |
313 | | MOZ_CAN_RUN_SCRIPT static bool |
314 | | get_requiredFeatures(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGAnimationElement* self, JSJitGetterCallArgs args) |
315 | 0 | { |
316 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGAnimationElement.requiredFeatures", DOM, cx); |
317 | 0 |
|
318 | 0 | auto result(StrongOrRawPtr<mozilla::DOMSVGStringList>(self->RequiredFeatures())); |
319 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
320 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
321 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
322 | 0 | return false; |
323 | 0 | } |
324 | 0 | return true; |
325 | 0 | } |
326 | | |
327 | | static const JSJitInfo requiredFeatures_getterinfo = { |
328 | | { (JSJitGetterOp)get_requiredFeatures }, |
329 | | { prototypes::id::SVGAnimationElement }, |
330 | | { PrototypeTraits<prototypes::id::SVGAnimationElement>::Depth }, |
331 | | JSJitInfo::Getter, |
332 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
333 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
334 | | false, /* isInfallible. False in setters. */ |
335 | | false, /* isMovable. Not relevant for setters. */ |
336 | | false, /* isEliminatable. Not relevant for setters. */ |
337 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
338 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
339 | | false, /* isTypedMethod. Only relevant for methods. */ |
340 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
341 | | }; |
342 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
343 | | static_assert(0 < 1, "There is no slot for us"); |
344 | | |
345 | | MOZ_CAN_RUN_SCRIPT static bool |
346 | | get_requiredExtensions(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGAnimationElement* self, JSJitGetterCallArgs args) |
347 | 0 | { |
348 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGAnimationElement.requiredExtensions", DOM, cx); |
349 | 0 |
|
350 | 0 | auto result(StrongOrRawPtr<mozilla::DOMSVGStringList>(self->RequiredExtensions())); |
351 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
352 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
353 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
354 | 0 | return false; |
355 | 0 | } |
356 | 0 | return true; |
357 | 0 | } |
358 | | |
359 | | static const JSJitInfo requiredExtensions_getterinfo = { |
360 | | { (JSJitGetterOp)get_requiredExtensions }, |
361 | | { prototypes::id::SVGAnimationElement }, |
362 | | { PrototypeTraits<prototypes::id::SVGAnimationElement>::Depth }, |
363 | | JSJitInfo::Getter, |
364 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
365 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
366 | | false, /* isInfallible. False in setters. */ |
367 | | false, /* isMovable. Not relevant for setters. */ |
368 | | false, /* isEliminatable. Not relevant for setters. */ |
369 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
370 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
371 | | false, /* isTypedMethod. Only relevant for methods. */ |
372 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
373 | | }; |
374 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
375 | | static_assert(0 < 1, "There is no slot for us"); |
376 | | |
377 | | MOZ_CAN_RUN_SCRIPT static bool |
378 | | get_systemLanguage(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGAnimationElement* self, JSJitGetterCallArgs args) |
379 | 0 | { |
380 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGAnimationElement.systemLanguage", DOM, cx); |
381 | 0 |
|
382 | 0 | auto result(StrongOrRawPtr<mozilla::DOMSVGStringList>(self->SystemLanguage())); |
383 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
384 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
385 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
386 | 0 | return false; |
387 | 0 | } |
388 | 0 | return true; |
389 | 0 | } |
390 | | |
391 | | static const JSJitInfo systemLanguage_getterinfo = { |
392 | | { (JSJitGetterOp)get_systemLanguage }, |
393 | | { prototypes::id::SVGAnimationElement }, |
394 | | { PrototypeTraits<prototypes::id::SVGAnimationElement>::Depth }, |
395 | | JSJitInfo::Getter, |
396 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
397 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
398 | | false, /* isInfallible. False in setters. */ |
399 | | false, /* isMovable. Not relevant for setters. */ |
400 | | false, /* isEliminatable. Not relevant for setters. */ |
401 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
402 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
403 | | false, /* isTypedMethod. Only relevant for methods. */ |
404 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
405 | | }; |
406 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
407 | | static_assert(0 < 1, "There is no slot for us"); |
408 | | |
409 | | MOZ_CAN_RUN_SCRIPT static bool |
410 | | hasExtension(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGAnimationElement* self, const JSJitMethodCallArgs& args) |
411 | 0 | { |
412 | 0 | AUTO_PROFILER_LABEL_FAST("SVGAnimationElement.hasExtension", DOM, cx); |
413 | 0 |
|
414 | 0 | if (MOZ_UNLIKELY(args.length() < 1)) { |
415 | 0 | return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "SVGAnimationElement.hasExtension"); |
416 | 0 | } |
417 | 0 | binding_detail::FakeString arg0; |
418 | 0 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { |
419 | 0 | return false; |
420 | 0 | } |
421 | 0 | bool result(self->HasExtension(NonNullHelper(Constify(arg0)))); |
422 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
423 | 0 | args.rval().setBoolean(result); |
424 | 0 | return true; |
425 | 0 | } |
426 | | |
427 | | static const JSJitInfo hasExtension_methodinfo = { |
428 | | { (JSJitGetterOp)hasExtension }, |
429 | | { prototypes::id::SVGAnimationElement }, |
430 | | { PrototypeTraits<prototypes::id::SVGAnimationElement>::Depth }, |
431 | | JSJitInfo::Method, |
432 | | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ |
433 | | JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */ |
434 | | false, /* isInfallible. False in setters. */ |
435 | | false, /* isMovable. Not relevant for setters. */ |
436 | | false, /* isEliminatable. Not relevant for setters. */ |
437 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
438 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
439 | | false, /* isTypedMethod. Only relevant for methods. */ |
440 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
441 | | }; |
442 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
443 | | static_assert(0 < 1, "There is no slot for us"); |
444 | | |
445 | | // We deliberately use brace-elision to make Visual Studio produce better initalization code. |
446 | | #if defined(__clang__) |
447 | | #pragma clang diagnostic push |
448 | | #pragma clang diagnostic ignored "-Wmissing-braces" |
449 | | #endif |
450 | | static const JSFunctionSpec sMethods_specs[] = { |
451 | | JS_FNSPEC("getStartTime", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getStartTime_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
452 | | JS_FNSPEC("getCurrentTime", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getCurrentTime_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
453 | | JS_FNSPEC("getSimpleDuration", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&getSimpleDuration_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
454 | | JS_FNSPEC("beginElement", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&beginElement_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
455 | | JS_FNSPEC("beginElementAt", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&beginElementAt_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
456 | | JS_FNSPEC("endElement", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&endElement_methodinfo), 0, JSPROP_ENUMERATE, nullptr), |
457 | | JS_FNSPEC("endElementAt", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&endElementAt_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
458 | | JS_FNSPEC("hasExtension", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&hasExtension_methodinfo), 1, JSPROP_ENUMERATE, nullptr), |
459 | | JS_FS_END |
460 | | }; |
461 | | #if defined(__clang__) |
462 | | #pragma clang diagnostic pop |
463 | | #endif |
464 | | |
465 | | |
466 | | static const Prefable<const JSFunctionSpec> sMethods[] = { |
467 | | { nullptr, &sMethods_specs[0] }, |
468 | | { nullptr, nullptr } |
469 | | }; |
470 | | |
471 | | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX, |
472 | | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); |
473 | | static_assert(8 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX, |
474 | | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); |
475 | | |
476 | | // We deliberately use brace-elision to make Visual Studio produce better initalization code. |
477 | | #if defined(__clang__) |
478 | | #pragma clang diagnostic push |
479 | | #pragma clang diagnostic ignored "-Wmissing-braces" |
480 | | #endif |
481 | | static const JSPropertySpec sAttributes_specs[] = { |
482 | | { "targetElement", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &targetElement_getterinfo, nullptr, nullptr }, |
483 | | { "requiredFeatures", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &requiredFeatures_getterinfo, nullptr, nullptr }, |
484 | | { "requiredExtensions", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &requiredExtensions_getterinfo, nullptr, nullptr }, |
485 | | { "systemLanguage", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &systemLanguage_getterinfo, nullptr, nullptr }, |
486 | | { nullptr, 0, nullptr, nullptr, nullptr, nullptr } |
487 | | }; |
488 | | #if defined(__clang__) |
489 | | #pragma clang diagnostic pop |
490 | | #endif |
491 | | |
492 | | |
493 | | static const Prefable<const JSPropertySpec> sAttributes[] = { |
494 | | { nullptr, &sAttributes_specs[0] }, |
495 | | { nullptr, nullptr } |
496 | | }; |
497 | | |
498 | | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX, |
499 | | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); |
500 | | static_assert(4 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX, |
501 | | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); |
502 | | |
503 | | |
504 | | static uint16_t sNativeProperties_sortedPropertyIndices[12]; |
505 | | static PropertyInfo sNativeProperties_propertyInfos[12]; |
506 | | |
507 | | static const NativePropertiesN<2> sNativeProperties = { |
508 | | false, 0, |
509 | | false, 0, |
510 | | true, 0 /* sMethods */, |
511 | | true, 1 /* sAttributes */, |
512 | | false, 0, |
513 | | false, 0, |
514 | | false, 0, |
515 | | -1, |
516 | | 12, |
517 | | sNativeProperties_sortedPropertyIndices, |
518 | | { |
519 | | { sMethods, &sNativeProperties_propertyInfos[0] }, |
520 | | { sAttributes, &sNativeProperties_propertyInfos[8] } |
521 | | } |
522 | | }; |
523 | | static_assert(12 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount), |
524 | | "We have a property info count that is oversized"); |
525 | | |
526 | | static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = { |
527 | | { |
528 | | "Function", |
529 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE), |
530 | | &sBoringInterfaceObjectClassClassOps, |
531 | | JS_NULL_CLASS_SPEC, |
532 | | JS_NULL_CLASS_EXT, |
533 | | &sInterfaceObjectClassObjectOps |
534 | | }, |
535 | | eInterface, |
536 | | true, |
537 | | prototypes::id::SVGAnimationElement, |
538 | | PrototypeTraits<prototypes::id::SVGAnimationElement>::Depth, |
539 | | sNativePropertyHooks, |
540 | | "function SVGAnimationElement() {\n [native code]\n}", |
541 | | SVGElement_Binding::GetConstructorObject |
542 | | }; |
543 | | |
544 | | static const DOMIfaceAndProtoJSClass sPrototypeClass = { |
545 | | { |
546 | | "SVGAnimationElementPrototype", |
547 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE), |
548 | | JS_NULL_CLASS_OPS, |
549 | | JS_NULL_CLASS_SPEC, |
550 | | JS_NULL_CLASS_EXT, |
551 | | JS_NULL_OBJECT_OPS |
552 | | }, |
553 | | eInterfacePrototype, |
554 | | false, |
555 | | prototypes::id::SVGAnimationElement, |
556 | | PrototypeTraits<prototypes::id::SVGAnimationElement>::Depth, |
557 | | sNativePropertyHooks, |
558 | | "[object SVGAnimationElementPrototype]", |
559 | | SVGElement_Binding::GetProtoObject |
560 | | }; |
561 | | |
562 | | const NativePropertyHooks sNativePropertyHooks[] = { { |
563 | | nullptr, |
564 | | nullptr, |
565 | | nullptr, |
566 | | { sNativeProperties.Upcast(), nullptr }, |
567 | | prototypes::id::SVGAnimationElement, |
568 | | constructors::id::SVGAnimationElement, |
569 | | SVGElement_Binding::sNativePropertyHooks, |
570 | | &DefaultXrayExpandoObjectClass |
571 | | } }; |
572 | | |
573 | | void |
574 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal) |
575 | 0 | { |
576 | 0 | JS::Handle<JSObject*> parentProto(SVGElement_Binding::GetProtoObjectHandle(aCx)); |
577 | 0 | if (!parentProto) { |
578 | 0 | return; |
579 | 0 | } |
580 | 0 | |
581 | 0 | JS::Handle<JSObject*> constructorProto(SVGElement_Binding::GetConstructorObjectHandle(aCx)); |
582 | 0 | if (!constructorProto) { |
583 | 0 | return; |
584 | 0 | } |
585 | 0 | |
586 | 0 | static bool sIdsInited = false; |
587 | 0 | if (!sIdsInited && NS_IsMainThread()) { |
588 | 0 | if (!InitIds(aCx, sNativeProperties.Upcast())) { |
589 | 0 | return; |
590 | 0 | } |
591 | 0 | sIdsInited = true; |
592 | 0 | } |
593 | 0 |
|
594 | 0 | JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::SVGAnimationElement); |
595 | 0 | JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::SVGAnimationElement); |
596 | 0 | dom::CreateInterfaceObjects(aCx, aGlobal, parentProto, |
597 | 0 | &sPrototypeClass.mBase, protoCache, |
598 | 0 | nullptr, |
599 | 0 | constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr, |
600 | 0 | interfaceCache, |
601 | 0 | sNativeProperties.Upcast(), |
602 | 0 | nullptr, |
603 | 0 | "SVGAnimationElement", aDefineOnGlobal, |
604 | 0 | nullptr, |
605 | 0 | false); |
606 | 0 | } |
607 | | |
608 | | JSObject* |
609 | | GetProtoObject(JSContext* aCx) |
610 | 0 | { |
611 | 0 | return GetProtoObjectHandle(aCx); |
612 | 0 | } |
613 | | |
614 | | JSObject* |
615 | | GetConstructorObject(JSContext* aCx) |
616 | 0 | { |
617 | 0 | return GetConstructorObjectHandle(aCx); |
618 | 0 | } |
619 | | |
620 | | } // namespace SVGAnimationElement_Binding |
621 | | |
622 | | |
623 | | |
624 | | } // namespace dom |
625 | | } // namespace mozilla |