Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dom/bindings/SVGComponentTransferFunctionElementBinding.cpp
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM SVGComponentTransferFunctionElement.webidl BY Codegen.py - DO NOT EDIT */
2
3
#include "DOMSVGAnimatedNumberList.h"
4
#include "SVGComponentTransferFunctionElementBinding.h"
5
#include "SVGElementBinding.h"
6
#include "WrapperFactory.h"
7
#include "mozilla/OwningNonNull.h"
8
#include "mozilla/dom/BindingUtils.h"
9
#include "mozilla/dom/DOMJSClass.h"
10
#include "mozilla/dom/NonRefcountedDOMObject.h"
11
#include "mozilla/dom/SVGAnimatedEnumeration.h"
12
#include "mozilla/dom/SVGAnimatedNumber.h"
13
#include "mozilla/dom/SVGComponentTransferFunctionElement.h"
14
#include "mozilla/dom/XrayExpandoClass.h"
15
16
namespace mozilla {
17
namespace dom {
18
19
namespace binding_detail {}; // Just to make sure it's known as a namespace
20
using namespace mozilla::dom::binding_detail;
21
22
23
namespace SVGComponentTransferFunctionElement_Binding {
24
25
static_assert(IsRefcounted<NativeType>::value == IsRefcounted<SVGElement_Binding::NativeType>::value,
26
              "Can't inherit from an interface with a different ownership model.");
27
28
MOZ_CAN_RUN_SCRIPT static bool
29
get_type(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGComponentTransferFunctionElement* self, JSJitGetterCallArgs args)
30
0
{
31
0
  AUTO_PROFILER_LABEL_FAST("get SVGComponentTransferFunctionElement.type", DOM, cx);
32
0
33
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedEnumeration>(self->Type()));
34
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
35
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
36
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
37
0
    return false;
38
0
  }
39
0
  return true;
40
0
}
41
42
static const JSJitInfo type_getterinfo = {
43
  { (JSJitGetterOp)get_type },
44
  { prototypes::id::SVGComponentTransferFunctionElement },
45
  { PrototypeTraits<prototypes::id::SVGComponentTransferFunctionElement>::Depth },
46
  JSJitInfo::Getter,
47
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
48
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
49
  false,  /* isInfallible. False in setters. */
50
  true,  /* isMovable.  Not relevant for setters. */
51
  true, /* isEliminatable.  Not relevant for setters. */
52
  false, /* isAlwaysInSlot.  Only relevant for getters. */
53
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
54
  false,  /* isTypedMethod.  Only relevant for methods. */
55
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
56
};
57
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
58
static_assert(0 < 1, "There is no slot for us");
59
60
MOZ_CAN_RUN_SCRIPT static bool
61
get_tableValues(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGComponentTransferFunctionElement* self, JSJitGetterCallArgs args)
62
0
{
63
0
  AUTO_PROFILER_LABEL_FAST("get SVGComponentTransferFunctionElement.tableValues", DOM, cx);
64
0
65
0
  auto result(StrongOrRawPtr<mozilla::DOMSVGAnimatedNumberList>(self->TableValues()));
66
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
67
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
68
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
69
0
    return false;
70
0
  }
71
0
  return true;
72
0
}
73
74
static const JSJitInfo tableValues_getterinfo = {
75
  { (JSJitGetterOp)get_tableValues },
76
  { prototypes::id::SVGComponentTransferFunctionElement },
77
  { PrototypeTraits<prototypes::id::SVGComponentTransferFunctionElement>::Depth },
78
  JSJitInfo::Getter,
79
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
80
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
81
  false,  /* isInfallible. False in setters. */
82
  true,  /* isMovable.  Not relevant for setters. */
83
  true, /* isEliminatable.  Not relevant for setters. */
84
  false, /* isAlwaysInSlot.  Only relevant for getters. */
85
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
86
  false,  /* isTypedMethod.  Only relevant for methods. */
87
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
88
};
89
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
90
static_assert(0 < 1, "There is no slot for us");
91
92
MOZ_CAN_RUN_SCRIPT static bool
93
get_slope(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGComponentTransferFunctionElement* self, JSJitGetterCallArgs args)
94
0
{
95
0
  AUTO_PROFILER_LABEL_FAST("get SVGComponentTransferFunctionElement.slope", DOM, cx);
96
0
97
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->Slope()));
98
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
99
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
100
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
101
0
    return false;
102
0
  }
103
0
  return true;
104
0
}
105
106
static const JSJitInfo slope_getterinfo = {
107
  { (JSJitGetterOp)get_slope },
108
  { prototypes::id::SVGComponentTransferFunctionElement },
109
  { PrototypeTraits<prototypes::id::SVGComponentTransferFunctionElement>::Depth },
110
  JSJitInfo::Getter,
111
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
112
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
113
  false,  /* isInfallible. False in setters. */
114
  true,  /* isMovable.  Not relevant for setters. */
115
  true, /* isEliminatable.  Not relevant for setters. */
116
  false, /* isAlwaysInSlot.  Only relevant for getters. */
117
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
118
  false,  /* isTypedMethod.  Only relevant for methods. */
119
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
120
};
121
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
122
static_assert(0 < 1, "There is no slot for us");
123
124
MOZ_CAN_RUN_SCRIPT static bool
125
get_intercept(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGComponentTransferFunctionElement* self, JSJitGetterCallArgs args)
126
0
{
127
0
  AUTO_PROFILER_LABEL_FAST("get SVGComponentTransferFunctionElement.intercept", DOM, cx);
128
0
129
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->Intercept()));
130
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
131
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
132
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
133
0
    return false;
134
0
  }
135
0
  return true;
136
0
}
137
138
static const JSJitInfo intercept_getterinfo = {
139
  { (JSJitGetterOp)get_intercept },
140
  { prototypes::id::SVGComponentTransferFunctionElement },
141
  { PrototypeTraits<prototypes::id::SVGComponentTransferFunctionElement>::Depth },
142
  JSJitInfo::Getter,
143
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
144
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
145
  false,  /* isInfallible. False in setters. */
146
  true,  /* isMovable.  Not relevant for setters. */
147
  true, /* isEliminatable.  Not relevant for setters. */
148
  false, /* isAlwaysInSlot.  Only relevant for getters. */
149
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
150
  false,  /* isTypedMethod.  Only relevant for methods. */
151
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
152
};
153
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
154
static_assert(0 < 1, "There is no slot for us");
155
156
MOZ_CAN_RUN_SCRIPT static bool
157
get_amplitude(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGComponentTransferFunctionElement* self, JSJitGetterCallArgs args)
158
0
{
159
0
  AUTO_PROFILER_LABEL_FAST("get SVGComponentTransferFunctionElement.amplitude", DOM, cx);
160
0
161
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->Amplitude()));
162
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
163
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
164
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
165
0
    return false;
166
0
  }
167
0
  return true;
168
0
}
169
170
static const JSJitInfo amplitude_getterinfo = {
171
  { (JSJitGetterOp)get_amplitude },
172
  { prototypes::id::SVGComponentTransferFunctionElement },
173
  { PrototypeTraits<prototypes::id::SVGComponentTransferFunctionElement>::Depth },
174
  JSJitInfo::Getter,
175
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
176
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
177
  false,  /* isInfallible. False in setters. */
178
  true,  /* isMovable.  Not relevant for setters. */
179
  true, /* isEliminatable.  Not relevant for setters. */
180
  false, /* isAlwaysInSlot.  Only relevant for getters. */
181
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
182
  false,  /* isTypedMethod.  Only relevant for methods. */
183
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
184
};
185
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
186
static_assert(0 < 1, "There is no slot for us");
187
188
MOZ_CAN_RUN_SCRIPT static bool
189
get_exponent(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGComponentTransferFunctionElement* self, JSJitGetterCallArgs args)
190
0
{
191
0
  AUTO_PROFILER_LABEL_FAST("get SVGComponentTransferFunctionElement.exponent", DOM, cx);
192
0
193
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->Exponent()));
194
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
195
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
196
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
197
0
    return false;
198
0
  }
199
0
  return true;
200
0
}
201
202
static const JSJitInfo exponent_getterinfo = {
203
  { (JSJitGetterOp)get_exponent },
204
  { prototypes::id::SVGComponentTransferFunctionElement },
205
  { PrototypeTraits<prototypes::id::SVGComponentTransferFunctionElement>::Depth },
206
  JSJitInfo::Getter,
207
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
208
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
209
  false,  /* isInfallible. False in setters. */
210
  true,  /* isMovable.  Not relevant for setters. */
211
  true, /* isEliminatable.  Not relevant for setters. */
212
  false, /* isAlwaysInSlot.  Only relevant for getters. */
213
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
214
  false,  /* isTypedMethod.  Only relevant for methods. */
215
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
216
};
217
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
218
static_assert(0 < 1, "There is no slot for us");
219
220
MOZ_CAN_RUN_SCRIPT static bool
221
get_offset(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGComponentTransferFunctionElement* self, JSJitGetterCallArgs args)
222
0
{
223
0
  AUTO_PROFILER_LABEL_FAST("get SVGComponentTransferFunctionElement.offset", DOM, cx);
224
0
225
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->Offset()));
226
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
227
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
228
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
229
0
    return false;
230
0
  }
231
0
  return true;
232
0
}
233
234
static const JSJitInfo offset_getterinfo = {
235
  { (JSJitGetterOp)get_offset },
236
  { prototypes::id::SVGComponentTransferFunctionElement },
237
  { PrototypeTraits<prototypes::id::SVGComponentTransferFunctionElement>::Depth },
238
  JSJitInfo::Getter,
239
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
240
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
241
  false,  /* isInfallible. False in setters. */
242
  true,  /* isMovable.  Not relevant for setters. */
243
  true, /* isEliminatable.  Not relevant for setters. */
244
  false, /* isAlwaysInSlot.  Only relevant for getters. */
245
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
246
  false,  /* isTypedMethod.  Only relevant for methods. */
247
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
248
};
249
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
250
static_assert(0 < 1, "There is no slot for us");
251
252
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
253
#if defined(__clang__)
254
#pragma clang diagnostic push
255
#pragma clang diagnostic ignored "-Wmissing-braces"
256
#endif
257
static const JSPropertySpec sAttributes_specs[] = {
258
  { "type", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &type_getterinfo, nullptr, nullptr },
259
  { "tableValues", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &tableValues_getterinfo, nullptr, nullptr },
260
  { "slope", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &slope_getterinfo, nullptr, nullptr },
261
  { "intercept", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &intercept_getterinfo, nullptr, nullptr },
262
  { "amplitude", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &amplitude_getterinfo, nullptr, nullptr },
263
  { "exponent", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &exponent_getterinfo, nullptr, nullptr },
264
  { "offset", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &offset_getterinfo, nullptr, nullptr },
265
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
266
};
267
#if defined(__clang__)
268
#pragma clang diagnostic pop
269
#endif
270
271
272
static const Prefable<const JSPropertySpec> sAttributes[] = {
273
  { nullptr, &sAttributes_specs[0] },
274
  { nullptr, nullptr }
275
};
276
277
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
278
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
279
static_assert(7 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
280
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
281
282
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
283
#if defined(__clang__)
284
#pragma clang diagnostic push
285
#pragma clang diagnostic ignored "-Wmissing-braces"
286
#endif
287
static const ConstantSpec sConstants_specs[] = {
288
  { "SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN", JS::Int32Value(0) },
289
  { "SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY", JS::Int32Value(1) },
290
  { "SVG_FECOMPONENTTRANSFER_TYPE_TABLE", JS::Int32Value(2) },
291
  { "SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE", JS::Int32Value(3) },
292
  { "SVG_FECOMPONENTTRANSFER_TYPE_LINEAR", JS::Int32Value(4) },
293
  { "SVG_FECOMPONENTTRANSFER_TYPE_GAMMA", JS::Int32Value(5) },
294
  { 0, JS::UndefinedValue() }
295
};
296
#if defined(__clang__)
297
#pragma clang diagnostic pop
298
#endif
299
300
301
static const Prefable<const ConstantSpec> sConstants[] = {
302
  { nullptr, &sConstants_specs[0] },
303
  { nullptr, nullptr }
304
};
305
306
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
307
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
308
static_assert(6 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
309
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
310
311
312
static uint16_t sNativeProperties_sortedPropertyIndices[13];
313
static PropertyInfo sNativeProperties_propertyInfos[13];
314
315
static const NativePropertiesN<2> sNativeProperties = {
316
  false, 0,
317
  false, 0,
318
  false, 0,
319
  true,  0 /* sAttributes */,
320
  false, 0,
321
  false, 0,
322
  true,  1 /* sConstants */,
323
  -1,
324
  13,
325
  sNativeProperties_sortedPropertyIndices,
326
  {
327
    { sAttributes, &sNativeProperties_propertyInfos[0] },
328
    { sConstants, &sNativeProperties_propertyInfos[7] }
329
  }
330
};
331
static_assert(13 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
332
    "We have a property info count that is oversized");
333
334
static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
335
  {
336
    "Function",
337
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE),
338
    &sBoringInterfaceObjectClassClassOps,
339
    JS_NULL_CLASS_SPEC,
340
    JS_NULL_CLASS_EXT,
341
    &sInterfaceObjectClassObjectOps
342
  },
343
  eInterface,
344
  true,
345
  prototypes::id::SVGComponentTransferFunctionElement,
346
  PrototypeTraits<prototypes::id::SVGComponentTransferFunctionElement>::Depth,
347
  sNativePropertyHooks,
348
  "function SVGComponentTransferFunctionElement() {\n    [native code]\n}",
349
  SVGElement_Binding::GetConstructorObject
350
};
351
352
static const DOMIfaceAndProtoJSClass sPrototypeClass = {
353
  {
354
    "SVGComponentTransferFunctionElementPrototype",
355
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE),
356
    JS_NULL_CLASS_OPS,
357
    JS_NULL_CLASS_SPEC,
358
    JS_NULL_CLASS_EXT,
359
    JS_NULL_OBJECT_OPS
360
  },
361
  eInterfacePrototype,
362
  false,
363
  prototypes::id::SVGComponentTransferFunctionElement,
364
  PrototypeTraits<prototypes::id::SVGComponentTransferFunctionElement>::Depth,
365
  sNativePropertyHooks,
366
  "[object SVGComponentTransferFunctionElementPrototype]",
367
  SVGElement_Binding::GetProtoObject
368
};
369
370
const NativePropertyHooks sNativePropertyHooks[] = { {
371
  nullptr,
372
  nullptr,
373
  nullptr,
374
  { sNativeProperties.Upcast(), nullptr },
375
  prototypes::id::SVGComponentTransferFunctionElement,
376
  constructors::id::SVGComponentTransferFunctionElement,
377
  SVGElement_Binding::sNativePropertyHooks,
378
  &DefaultXrayExpandoObjectClass
379
} };
380
381
void
382
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
383
0
{
384
0
  JS::Handle<JSObject*> parentProto(SVGElement_Binding::GetProtoObjectHandle(aCx));
385
0
  if (!parentProto) {
386
0
    return;
387
0
  }
388
0
389
0
  JS::Handle<JSObject*> constructorProto(SVGElement_Binding::GetConstructorObjectHandle(aCx));
390
0
  if (!constructorProto) {
391
0
    return;
392
0
  }
393
0
394
0
  static bool sIdsInited = false;
395
0
  if (!sIdsInited && NS_IsMainThread()) {
396
0
    if (!InitIds(aCx, sNativeProperties.Upcast())) {
397
0
      return;
398
0
    }
399
0
    sIdsInited = true;
400
0
  }
401
0
402
0
  JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::SVGComponentTransferFunctionElement);
403
0
  JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::SVGComponentTransferFunctionElement);
404
0
  dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
405
0
                              &sPrototypeClass.mBase, protoCache,
406
0
                              nullptr,
407
0
                              constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr,
408
0
                              interfaceCache,
409
0
                              sNativeProperties.Upcast(),
410
0
                              nullptr,
411
0
                              "SVGComponentTransferFunctionElement", aDefineOnGlobal,
412
0
                              nullptr,
413
0
                              false);
414
0
}
415
416
JSObject*
417
GetProtoObject(JSContext* aCx)
418
0
{
419
0
  return GetProtoObjectHandle(aCx);
420
0
}
421
422
JSObject*
423
GetConstructorObject(JSContext* aCx)
424
0
{
425
0
  return GetConstructorObjectHandle(aCx);
426
0
}
427
428
} // namespace SVGComponentTransferFunctionElement_Binding
429
430
431
432
} // namespace dom
433
} // namespace mozilla