/work/obj-fuzz/dom/bindings/SVGTextPositioningElementBinding.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM SVGTextPositioningElement.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #include "DOMSVGAnimatedLengthList.h" |
4 | | #include "DOMSVGAnimatedNumberList.h" |
5 | | #include "SVGTextContentElementBinding.h" |
6 | | #include "SVGTextPositioningElementBinding.h" |
7 | | #include "WrapperFactory.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/SVGTextPositioningElement.h" |
13 | | #include "mozilla/dom/XrayExpandoClass.h" |
14 | | |
15 | | namespace mozilla { |
16 | | namespace dom { |
17 | | |
18 | | namespace binding_detail {}; // Just to make sure it's known as a namespace |
19 | | using namespace mozilla::dom::binding_detail; |
20 | | |
21 | | |
22 | | namespace SVGTextPositioningElement_Binding { |
23 | | |
24 | | static_assert(IsRefcounted<NativeType>::value == IsRefcounted<SVGTextContentElement_Binding::NativeType>::value, |
25 | | "Can't inherit from an interface with a different ownership model."); |
26 | | |
27 | | MOZ_CAN_RUN_SCRIPT static bool |
28 | | get_x(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGTextPositioningElement* self, JSJitGetterCallArgs args) |
29 | 0 | { |
30 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGTextPositioningElement.x", DOM, cx); |
31 | 0 |
|
32 | 0 | auto result(StrongOrRawPtr<mozilla::DOMSVGAnimatedLengthList>(self->X())); |
33 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
34 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
35 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
36 | 0 | return false; |
37 | 0 | } |
38 | 0 | return true; |
39 | 0 | } |
40 | | |
41 | | static const JSJitInfo x_getterinfo = { |
42 | | { (JSJitGetterOp)get_x }, |
43 | | { prototypes::id::SVGTextPositioningElement }, |
44 | | { PrototypeTraits<prototypes::id::SVGTextPositioningElement>::Depth }, |
45 | | JSJitInfo::Getter, |
46 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
47 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
48 | | false, /* isInfallible. False in setters. */ |
49 | | true, /* isMovable. Not relevant for setters. */ |
50 | | true, /* isEliminatable. Not relevant for setters. */ |
51 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
52 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
53 | | false, /* isTypedMethod. Only relevant for methods. */ |
54 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
55 | | }; |
56 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
57 | | static_assert(0 < 1, "There is no slot for us"); |
58 | | |
59 | | MOZ_CAN_RUN_SCRIPT static bool |
60 | | get_y(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGTextPositioningElement* self, JSJitGetterCallArgs args) |
61 | 0 | { |
62 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGTextPositioningElement.y", DOM, cx); |
63 | 0 |
|
64 | 0 | auto result(StrongOrRawPtr<mozilla::DOMSVGAnimatedLengthList>(self->Y())); |
65 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
66 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
67 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
68 | 0 | return false; |
69 | 0 | } |
70 | 0 | return true; |
71 | 0 | } |
72 | | |
73 | | static const JSJitInfo y_getterinfo = { |
74 | | { (JSJitGetterOp)get_y }, |
75 | | { prototypes::id::SVGTextPositioningElement }, |
76 | | { PrototypeTraits<prototypes::id::SVGTextPositioningElement>::Depth }, |
77 | | JSJitInfo::Getter, |
78 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
79 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
80 | | false, /* isInfallible. False in setters. */ |
81 | | true, /* isMovable. Not relevant for setters. */ |
82 | | true, /* isEliminatable. Not relevant for setters. */ |
83 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
84 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
85 | | false, /* isTypedMethod. Only relevant for methods. */ |
86 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
87 | | }; |
88 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
89 | | static_assert(0 < 1, "There is no slot for us"); |
90 | | |
91 | | MOZ_CAN_RUN_SCRIPT static bool |
92 | | get_dx(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGTextPositioningElement* self, JSJitGetterCallArgs args) |
93 | 0 | { |
94 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGTextPositioningElement.dx", DOM, cx); |
95 | 0 |
|
96 | 0 | auto result(StrongOrRawPtr<mozilla::DOMSVGAnimatedLengthList>(self->Dx())); |
97 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
98 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
99 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
100 | 0 | return false; |
101 | 0 | } |
102 | 0 | return true; |
103 | 0 | } |
104 | | |
105 | | static const JSJitInfo dx_getterinfo = { |
106 | | { (JSJitGetterOp)get_dx }, |
107 | | { prototypes::id::SVGTextPositioningElement }, |
108 | | { PrototypeTraits<prototypes::id::SVGTextPositioningElement>::Depth }, |
109 | | JSJitInfo::Getter, |
110 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
111 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
112 | | false, /* isInfallible. False in setters. */ |
113 | | true, /* isMovable. Not relevant for setters. */ |
114 | | true, /* isEliminatable. Not relevant for setters. */ |
115 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
116 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
117 | | false, /* isTypedMethod. Only relevant for methods. */ |
118 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
119 | | }; |
120 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
121 | | static_assert(0 < 1, "There is no slot for us"); |
122 | | |
123 | | MOZ_CAN_RUN_SCRIPT static bool |
124 | | get_dy(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGTextPositioningElement* self, JSJitGetterCallArgs args) |
125 | 0 | { |
126 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGTextPositioningElement.dy", DOM, cx); |
127 | 0 |
|
128 | 0 | auto result(StrongOrRawPtr<mozilla::DOMSVGAnimatedLengthList>(self->Dy())); |
129 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
130 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
131 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
132 | 0 | return false; |
133 | 0 | } |
134 | 0 | return true; |
135 | 0 | } |
136 | | |
137 | | static const JSJitInfo dy_getterinfo = { |
138 | | { (JSJitGetterOp)get_dy }, |
139 | | { prototypes::id::SVGTextPositioningElement }, |
140 | | { PrototypeTraits<prototypes::id::SVGTextPositioningElement>::Depth }, |
141 | | JSJitInfo::Getter, |
142 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
143 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
144 | | false, /* isInfallible. False in setters. */ |
145 | | true, /* isMovable. Not relevant for setters. */ |
146 | | true, /* isEliminatable. Not relevant for setters. */ |
147 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
148 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
149 | | false, /* isTypedMethod. Only relevant for methods. */ |
150 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
151 | | }; |
152 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
153 | | static_assert(0 < 1, "There is no slot for us"); |
154 | | |
155 | | MOZ_CAN_RUN_SCRIPT static bool |
156 | | get_rotate(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGTextPositioningElement* self, JSJitGetterCallArgs args) |
157 | 0 | { |
158 | 0 | AUTO_PROFILER_LABEL_FAST("get SVGTextPositioningElement.rotate", DOM, cx); |
159 | 0 |
|
160 | 0 | auto result(StrongOrRawPtr<mozilla::DOMSVGAnimatedNumberList>(self->Rotate())); |
161 | 0 | MOZ_ASSERT(!JS_IsExceptionPending(cx)); |
162 | 0 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { |
163 | 0 | MOZ_ASSERT(JS_IsExceptionPending(cx)); |
164 | 0 | return false; |
165 | 0 | } |
166 | 0 | return true; |
167 | 0 | } |
168 | | |
169 | | static const JSJitInfo rotate_getterinfo = { |
170 | | { (JSJitGetterOp)get_rotate }, |
171 | | { prototypes::id::SVGTextPositioningElement }, |
172 | | { PrototypeTraits<prototypes::id::SVGTextPositioningElement>::Depth }, |
173 | | JSJitInfo::Getter, |
174 | | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ |
175 | | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ |
176 | | false, /* isInfallible. False in setters. */ |
177 | | true, /* isMovable. Not relevant for setters. */ |
178 | | true, /* isEliminatable. Not relevant for setters. */ |
179 | | false, /* isAlwaysInSlot. Only relevant for getters. */ |
180 | | false, /* isLazilyCachedInSlot. Only relevant for getters. */ |
181 | | false, /* isTypedMethod. Only relevant for methods. */ |
182 | | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ |
183 | | }; |
184 | | static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit"); |
185 | | static_assert(0 < 1, "There is no slot for us"); |
186 | | |
187 | | // We deliberately use brace-elision to make Visual Studio produce better initalization code. |
188 | | #if defined(__clang__) |
189 | | #pragma clang diagnostic push |
190 | | #pragma clang diagnostic ignored "-Wmissing-braces" |
191 | | #endif |
192 | | static const JSPropertySpec sAttributes_specs[] = { |
193 | | { "x", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &x_getterinfo, nullptr, nullptr }, |
194 | | { "y", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &y_getterinfo, nullptr, nullptr }, |
195 | | { "dx", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &dx_getterinfo, nullptr, nullptr }, |
196 | | { "dy", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &dy_getterinfo, nullptr, nullptr }, |
197 | | { "rotate", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &rotate_getterinfo, nullptr, nullptr }, |
198 | | { nullptr, 0, nullptr, nullptr, nullptr, nullptr } |
199 | | }; |
200 | | #if defined(__clang__) |
201 | | #pragma clang diagnostic pop |
202 | | #endif |
203 | | |
204 | | |
205 | | static const Prefable<const JSPropertySpec> sAttributes[] = { |
206 | | { nullptr, &sAttributes_specs[0] }, |
207 | | { nullptr, nullptr } |
208 | | }; |
209 | | |
210 | | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX, |
211 | | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); |
212 | | static_assert(5 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX, |
213 | | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); |
214 | | |
215 | | |
216 | | static uint16_t sNativeProperties_sortedPropertyIndices[5]; |
217 | | static PropertyInfo sNativeProperties_propertyInfos[5]; |
218 | | |
219 | | static const NativePropertiesN<1> sNativeProperties = { |
220 | | false, 0, |
221 | | false, 0, |
222 | | false, 0, |
223 | | true, 0 /* sAttributes */, |
224 | | false, 0, |
225 | | false, 0, |
226 | | false, 0, |
227 | | -1, |
228 | | 5, |
229 | | sNativeProperties_sortedPropertyIndices, |
230 | | { |
231 | | { sAttributes, &sNativeProperties_propertyInfos[0] } |
232 | | } |
233 | | }; |
234 | | static_assert(5 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount), |
235 | | "We have a property info count that is oversized"); |
236 | | |
237 | | static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = { |
238 | | { |
239 | | "Function", |
240 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE), |
241 | | &sBoringInterfaceObjectClassClassOps, |
242 | | JS_NULL_CLASS_SPEC, |
243 | | JS_NULL_CLASS_EXT, |
244 | | &sInterfaceObjectClassObjectOps |
245 | | }, |
246 | | eInterface, |
247 | | true, |
248 | | prototypes::id::SVGTextPositioningElement, |
249 | | PrototypeTraits<prototypes::id::SVGTextPositioningElement>::Depth, |
250 | | sNativePropertyHooks, |
251 | | "function SVGTextPositioningElement() {\n [native code]\n}", |
252 | | SVGTextContentElement_Binding::GetConstructorObject |
253 | | }; |
254 | | |
255 | | static const DOMIfaceAndProtoJSClass sPrototypeClass = { |
256 | | { |
257 | | "SVGTextPositioningElementPrototype", |
258 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE), |
259 | | JS_NULL_CLASS_OPS, |
260 | | JS_NULL_CLASS_SPEC, |
261 | | JS_NULL_CLASS_EXT, |
262 | | JS_NULL_OBJECT_OPS |
263 | | }, |
264 | | eInterfacePrototype, |
265 | | false, |
266 | | prototypes::id::SVGTextPositioningElement, |
267 | | PrototypeTraits<prototypes::id::SVGTextPositioningElement>::Depth, |
268 | | sNativePropertyHooks, |
269 | | "[object SVGTextPositioningElementPrototype]", |
270 | | SVGTextContentElement_Binding::GetProtoObject |
271 | | }; |
272 | | |
273 | | const NativePropertyHooks sNativePropertyHooks[] = { { |
274 | | nullptr, |
275 | | nullptr, |
276 | | nullptr, |
277 | | { sNativeProperties.Upcast(), nullptr }, |
278 | | prototypes::id::SVGTextPositioningElement, |
279 | | constructors::id::SVGTextPositioningElement, |
280 | | SVGTextContentElement_Binding::sNativePropertyHooks, |
281 | | &DefaultXrayExpandoObjectClass |
282 | | } }; |
283 | | |
284 | | void |
285 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal) |
286 | 0 | { |
287 | 0 | JS::Handle<JSObject*> parentProto(SVGTextContentElement_Binding::GetProtoObjectHandle(aCx)); |
288 | 0 | if (!parentProto) { |
289 | 0 | return; |
290 | 0 | } |
291 | 0 | |
292 | 0 | JS::Handle<JSObject*> constructorProto(SVGTextContentElement_Binding::GetConstructorObjectHandle(aCx)); |
293 | 0 | if (!constructorProto) { |
294 | 0 | return; |
295 | 0 | } |
296 | 0 | |
297 | 0 | static bool sIdsInited = false; |
298 | 0 | if (!sIdsInited && NS_IsMainThread()) { |
299 | 0 | if (!InitIds(aCx, sNativeProperties.Upcast())) { |
300 | 0 | return; |
301 | 0 | } |
302 | 0 | sIdsInited = true; |
303 | 0 | } |
304 | 0 |
|
305 | 0 | JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::SVGTextPositioningElement); |
306 | 0 | JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::SVGTextPositioningElement); |
307 | 0 | dom::CreateInterfaceObjects(aCx, aGlobal, parentProto, |
308 | 0 | &sPrototypeClass.mBase, protoCache, |
309 | 0 | nullptr, |
310 | 0 | constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr, |
311 | 0 | interfaceCache, |
312 | 0 | sNativeProperties.Upcast(), |
313 | 0 | nullptr, |
314 | 0 | "SVGTextPositioningElement", aDefineOnGlobal, |
315 | 0 | nullptr, |
316 | 0 | false); |
317 | 0 | } |
318 | | |
319 | | JSObject* |
320 | | GetProtoObject(JSContext* aCx) |
321 | 0 | { |
322 | 0 | return GetProtoObjectHandle(aCx); |
323 | 0 | } |
324 | | |
325 | | JSObject* |
326 | | GetConstructorObject(JSContext* aCx) |
327 | 0 | { |
328 | 0 | return GetConstructorObjectHandle(aCx); |
329 | 0 | } |
330 | | |
331 | | } // namespace SVGTextPositioningElement_Binding |
332 | | |
333 | | |
334 | | |
335 | | } // namespace dom |
336 | | } // namespace mozilla |