Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dom/bindings/SVGFEGaussianBlurElementBinding.cpp
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM SVGFEGaussianBlurElement.webidl BY Codegen.py - DO NOT EDIT */
2
3
#include "SVGElementBinding.h"
4
#include "SVGFEGaussianBlurElementBinding.h"
5
#include "WrapperFactory.h"
6
#include "mozilla/FloatingPoint.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/PrimitiveConversions.h"
12
#include "mozilla/dom/SVGAnimatedLength.h"
13
#include "mozilla/dom/SVGAnimatedNumber.h"
14
#include "mozilla/dom/SVGAnimatedString.h"
15
#include "mozilla/dom/SVGFEGaussianBlurElement.h"
16
#include "mozilla/dom/XrayExpandoClass.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 SVGFEGaussianBlurElement_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_in1(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEGaussianBlurElement* self, JSJitGetterCallArgs args)
32
0
{
33
0
  AUTO_PROFILER_LABEL_FAST("get SVGFEGaussianBlurElement.in1", DOM, cx);
34
0
35
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedString>(self->In1()));
36
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
37
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
38
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
39
0
    return false;
40
0
  }
41
0
  return true;
42
0
}
43
44
static const JSJitInfo in1_getterinfo = {
45
  { (JSJitGetterOp)get_in1 },
46
  { prototypes::id::SVGFEGaussianBlurElement },
47
  { PrototypeTraits<prototypes::id::SVGFEGaussianBlurElement>::Depth },
48
  JSJitInfo::Getter,
49
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
50
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
51
  false,  /* isInfallible. False in setters. */
52
  true,  /* isMovable.  Not relevant for setters. */
53
  true, /* isEliminatable.  Not relevant for setters. */
54
  false, /* isAlwaysInSlot.  Only relevant for getters. */
55
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
56
  false,  /* isTypedMethod.  Only relevant for methods. */
57
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
58
};
59
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
60
static_assert(0 < 1, "There is no slot for us");
61
62
MOZ_CAN_RUN_SCRIPT static bool
63
get_stdDeviationX(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEGaussianBlurElement* self, JSJitGetterCallArgs args)
64
0
{
65
0
  AUTO_PROFILER_LABEL_FAST("get SVGFEGaussianBlurElement.stdDeviationX", DOM, cx);
66
0
67
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->StdDeviationX()));
68
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
69
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
70
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
71
0
    return false;
72
0
  }
73
0
  return true;
74
0
}
75
76
static const JSJitInfo stdDeviationX_getterinfo = {
77
  { (JSJitGetterOp)get_stdDeviationX },
78
  { prototypes::id::SVGFEGaussianBlurElement },
79
  { PrototypeTraits<prototypes::id::SVGFEGaussianBlurElement>::Depth },
80
  JSJitInfo::Getter,
81
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
82
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
83
  false,  /* isInfallible. False in setters. */
84
  true,  /* isMovable.  Not relevant for setters. */
85
  true, /* isEliminatable.  Not relevant for setters. */
86
  false, /* isAlwaysInSlot.  Only relevant for getters. */
87
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
88
  false,  /* isTypedMethod.  Only relevant for methods. */
89
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
90
};
91
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
92
static_assert(0 < 1, "There is no slot for us");
93
94
MOZ_CAN_RUN_SCRIPT static bool
95
get_stdDeviationY(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEGaussianBlurElement* self, JSJitGetterCallArgs args)
96
0
{
97
0
  AUTO_PROFILER_LABEL_FAST("get SVGFEGaussianBlurElement.stdDeviationY", DOM, cx);
98
0
99
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->StdDeviationY()));
100
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
101
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
102
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
103
0
    return false;
104
0
  }
105
0
  return true;
106
0
}
107
108
static const JSJitInfo stdDeviationY_getterinfo = {
109
  { (JSJitGetterOp)get_stdDeviationY },
110
  { prototypes::id::SVGFEGaussianBlurElement },
111
  { PrototypeTraits<prototypes::id::SVGFEGaussianBlurElement>::Depth },
112
  JSJitInfo::Getter,
113
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
114
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
115
  false,  /* isInfallible. False in setters. */
116
  true,  /* isMovable.  Not relevant for setters. */
117
  true, /* isEliminatable.  Not relevant for setters. */
118
  false, /* isAlwaysInSlot.  Only relevant for getters. */
119
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
120
  false,  /* isTypedMethod.  Only relevant for methods. */
121
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
122
};
123
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
124
static_assert(0 < 1, "There is no slot for us");
125
126
MOZ_CAN_RUN_SCRIPT static bool
127
setStdDeviation(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEGaussianBlurElement* self, const JSJitMethodCallArgs& args)
128
0
{
129
0
  AUTO_PROFILER_LABEL_FAST("SVGFEGaussianBlurElement.setStdDeviation", DOM, cx);
130
0
131
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
132
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "SVGFEGaussianBlurElement.setStdDeviation");
133
0
  }
134
0
  float arg0;
135
0
  if (!ValueToPrimitive<float, eDefault>(cx, args[0], &arg0)) {
136
0
    return false;
137
0
  } else if (!mozilla::IsFinite(arg0)) {
138
0
    ThrowErrorMessage(cx, MSG_NOT_FINITE, "Argument 1 of SVGFEGaussianBlurElement.setStdDeviation");
139
0
    return false;
140
0
  }
141
0
  float arg1;
142
0
  if (!ValueToPrimitive<float, eDefault>(cx, args[1], &arg1)) {
143
0
    return false;
144
0
  } else if (!mozilla::IsFinite(arg1)) {
145
0
    ThrowErrorMessage(cx, MSG_NOT_FINITE, "Argument 2 of SVGFEGaussianBlurElement.setStdDeviation");
146
0
    return false;
147
0
  }
148
0
  self->SetStdDeviation(arg0, arg1);
149
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
150
0
  args.rval().setUndefined();
151
0
  return true;
152
0
}
153
154
static const JSJitInfo setStdDeviation_methodinfo = {
155
  { (JSJitGetterOp)setStdDeviation },
156
  { prototypes::id::SVGFEGaussianBlurElement },
157
  { PrototypeTraits<prototypes::id::SVGFEGaussianBlurElement>::Depth },
158
  JSJitInfo::Method,
159
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
160
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
161
  false,  /* isInfallible. False in setters. */
162
  false,  /* isMovable.  Not relevant for setters. */
163
  false, /* isEliminatable.  Not relevant for setters. */
164
  false, /* isAlwaysInSlot.  Only relevant for getters. */
165
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
166
  false,  /* isTypedMethod.  Only relevant for methods. */
167
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
168
};
169
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
170
static_assert(0 < 1, "There is no slot for us");
171
172
MOZ_CAN_RUN_SCRIPT static bool
173
get_x(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEGaussianBlurElement* self, JSJitGetterCallArgs args)
174
0
{
175
0
  AUTO_PROFILER_LABEL_FAST("get SVGFEGaussianBlurElement.x", DOM, cx);
176
0
177
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->X()));
178
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
179
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
180
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
181
0
    return false;
182
0
  }
183
0
  return true;
184
0
}
185
186
static const JSJitInfo x_getterinfo = {
187
  { (JSJitGetterOp)get_x },
188
  { prototypes::id::SVGFEGaussianBlurElement },
189
  { PrototypeTraits<prototypes::id::SVGFEGaussianBlurElement>::Depth },
190
  JSJitInfo::Getter,
191
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
192
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
193
  false,  /* isInfallible. False in setters. */
194
  true,  /* isMovable.  Not relevant for setters. */
195
  true, /* isEliminatable.  Not relevant for setters. */
196
  false, /* isAlwaysInSlot.  Only relevant for getters. */
197
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
198
  false,  /* isTypedMethod.  Only relevant for methods. */
199
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
200
};
201
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
202
static_assert(0 < 1, "There is no slot for us");
203
204
MOZ_CAN_RUN_SCRIPT static bool
205
get_y(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEGaussianBlurElement* self, JSJitGetterCallArgs args)
206
0
{
207
0
  AUTO_PROFILER_LABEL_FAST("get SVGFEGaussianBlurElement.y", DOM, cx);
208
0
209
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->Y()));
210
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
211
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
212
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
213
0
    return false;
214
0
  }
215
0
  return true;
216
0
}
217
218
static const JSJitInfo y_getterinfo = {
219
  { (JSJitGetterOp)get_y },
220
  { prototypes::id::SVGFEGaussianBlurElement },
221
  { PrototypeTraits<prototypes::id::SVGFEGaussianBlurElement>::Depth },
222
  JSJitInfo::Getter,
223
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
224
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
225
  false,  /* isInfallible. False in setters. */
226
  true,  /* isMovable.  Not relevant for setters. */
227
  true, /* isEliminatable.  Not relevant for setters. */
228
  false, /* isAlwaysInSlot.  Only relevant for getters. */
229
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
230
  false,  /* isTypedMethod.  Only relevant for methods. */
231
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
232
};
233
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
234
static_assert(0 < 1, "There is no slot for us");
235
236
MOZ_CAN_RUN_SCRIPT static bool
237
get_width(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEGaussianBlurElement* self, JSJitGetterCallArgs args)
238
0
{
239
0
  AUTO_PROFILER_LABEL_FAST("get SVGFEGaussianBlurElement.width", DOM, cx);
240
0
241
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->Width()));
242
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
243
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
244
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
245
0
    return false;
246
0
  }
247
0
  return true;
248
0
}
249
250
static const JSJitInfo width_getterinfo = {
251
  { (JSJitGetterOp)get_width },
252
  { prototypes::id::SVGFEGaussianBlurElement },
253
  { PrototypeTraits<prototypes::id::SVGFEGaussianBlurElement>::Depth },
254
  JSJitInfo::Getter,
255
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
256
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
257
  false,  /* isInfallible. False in setters. */
258
  true,  /* isMovable.  Not relevant for setters. */
259
  true, /* isEliminatable.  Not relevant for setters. */
260
  false, /* isAlwaysInSlot.  Only relevant for getters. */
261
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
262
  false,  /* isTypedMethod.  Only relevant for methods. */
263
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
264
};
265
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
266
static_assert(0 < 1, "There is no slot for us");
267
268
MOZ_CAN_RUN_SCRIPT static bool
269
get_height(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEGaussianBlurElement* self, JSJitGetterCallArgs args)
270
0
{
271
0
  AUTO_PROFILER_LABEL_FAST("get SVGFEGaussianBlurElement.height", DOM, cx);
272
0
273
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->Height()));
274
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
275
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
276
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
277
0
    return false;
278
0
  }
279
0
  return true;
280
0
}
281
282
static const JSJitInfo height_getterinfo = {
283
  { (JSJitGetterOp)get_height },
284
  { prototypes::id::SVGFEGaussianBlurElement },
285
  { PrototypeTraits<prototypes::id::SVGFEGaussianBlurElement>::Depth },
286
  JSJitInfo::Getter,
287
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
288
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
289
  false,  /* isInfallible. False in setters. */
290
  true,  /* isMovable.  Not relevant for setters. */
291
  true, /* isEliminatable.  Not relevant for setters. */
292
  false, /* isAlwaysInSlot.  Only relevant for getters. */
293
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
294
  false,  /* isTypedMethod.  Only relevant for methods. */
295
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
296
};
297
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
298
static_assert(0 < 1, "There is no slot for us");
299
300
MOZ_CAN_RUN_SCRIPT static bool
301
get_result(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEGaussianBlurElement* self, JSJitGetterCallArgs args)
302
0
{
303
0
  AUTO_PROFILER_LABEL_FAST("get SVGFEGaussianBlurElement.result", DOM, cx);
304
0
305
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedString>(self->Result()));
306
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
307
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
308
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
309
0
    return false;
310
0
  }
311
0
  return true;
312
0
}
313
314
static const JSJitInfo result_getterinfo = {
315
  { (JSJitGetterOp)get_result },
316
  { prototypes::id::SVGFEGaussianBlurElement },
317
  { PrototypeTraits<prototypes::id::SVGFEGaussianBlurElement>::Depth },
318
  JSJitInfo::Getter,
319
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
320
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
321
  false,  /* isInfallible. False in setters. */
322
  true,  /* isMovable.  Not relevant for setters. */
323
  true, /* isEliminatable.  Not relevant for setters. */
324
  false, /* isAlwaysInSlot.  Only relevant for getters. */
325
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
326
  false,  /* isTypedMethod.  Only relevant for methods. */
327
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
328
};
329
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
330
static_assert(0 < 1, "There is no slot for us");
331
332
static bool
333
_addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
334
0
{
335
0
  mozilla::dom::SVGFEGaussianBlurElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGFEGaussianBlurElement>(obj);
336
0
  // We don't want to preserve if we don't have a wrapper, and we
337
0
  // obviously can't preserve if we're not initialized.
338
0
  if (self && self->GetWrapperPreserveColor()) {
339
0
    PreserveWrapper(self);
340
0
  }
341
0
  return true;
342
0
}
343
344
static void
345
_finalize(js::FreeOp* fop, JSObject* obj)
346
0
{
347
0
  mozilla::dom::SVGFEGaussianBlurElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGFEGaussianBlurElement>(obj);
348
0
  if (self) {
349
0
    ClearWrapper(self, self, obj);
350
0
    AddForDeferredFinalization<mozilla::dom::SVGFEGaussianBlurElement>(self);
351
0
  }
352
0
}
353
354
static size_t
355
_objectMoved(JSObject* obj, JSObject* old)
356
0
{
357
0
  mozilla::dom::SVGFEGaussianBlurElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGFEGaussianBlurElement>(obj);
358
0
  if (self) {
359
0
    UpdateWrapper(self, self, obj, old);
360
0
  }
361
0
362
0
  return 0;
363
0
}
364
365
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
366
#if defined(__clang__)
367
#pragma clang diagnostic push
368
#pragma clang diagnostic ignored "-Wmissing-braces"
369
#endif
370
static const JSFunctionSpec sMethods_specs[] = {
371
  JS_FNSPEC("setStdDeviation", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&setStdDeviation_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
372
  JS_FS_END
373
};
374
#if defined(__clang__)
375
#pragma clang diagnostic pop
376
#endif
377
378
379
static const Prefable<const JSFunctionSpec> sMethods[] = {
380
  { nullptr, &sMethods_specs[0] },
381
  { nullptr, nullptr }
382
};
383
384
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
385
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
386
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
387
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
388
389
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
390
#if defined(__clang__)
391
#pragma clang diagnostic push
392
#pragma clang diagnostic ignored "-Wmissing-braces"
393
#endif
394
static const JSPropertySpec sAttributes_specs[] = {
395
  { "in1", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &in1_getterinfo, nullptr, nullptr },
396
  { "stdDeviationX", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &stdDeviationX_getterinfo, nullptr, nullptr },
397
  { "stdDeviationY", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &stdDeviationY_getterinfo, nullptr, nullptr },
398
  { "x", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &x_getterinfo, nullptr, nullptr },
399
  { "y", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &y_getterinfo, nullptr, nullptr },
400
  { "width", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &width_getterinfo, nullptr, nullptr },
401
  { "height", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &height_getterinfo, nullptr, nullptr },
402
  { "result", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &result_getterinfo, nullptr, nullptr },
403
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
404
};
405
#if defined(__clang__)
406
#pragma clang diagnostic pop
407
#endif
408
409
410
static const Prefable<const JSPropertySpec> sAttributes[] = {
411
  { nullptr, &sAttributes_specs[0] },
412
  { nullptr, nullptr }
413
};
414
415
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
416
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
417
static_assert(8 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
418
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
419
420
421
static uint16_t sNativeProperties_sortedPropertyIndices[9];
422
static PropertyInfo sNativeProperties_propertyInfos[9];
423
424
static const NativePropertiesN<2> sNativeProperties = {
425
  false, 0,
426
  false, 0,
427
  true,  0 /* sMethods */,
428
  true,  1 /* sAttributes */,
429
  false, 0,
430
  false, 0,
431
  false, 0,
432
  -1,
433
  9,
434
  sNativeProperties_sortedPropertyIndices,
435
  {
436
    { sMethods, &sNativeProperties_propertyInfos[0] },
437
    { sAttributes, &sNativeProperties_propertyInfos[1] }
438
  }
439
};
440
static_assert(9 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
441
    "We have a property info count that is oversized");
442
443
static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
444
  {
445
    "Function",
446
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE),
447
    &sBoringInterfaceObjectClassClassOps,
448
    JS_NULL_CLASS_SPEC,
449
    JS_NULL_CLASS_EXT,
450
    &sInterfaceObjectClassObjectOps
451
  },
452
  eInterface,
453
  true,
454
  prototypes::id::SVGFEGaussianBlurElement,
455
  PrototypeTraits<prototypes::id::SVGFEGaussianBlurElement>::Depth,
456
  sNativePropertyHooks,
457
  "function SVGFEGaussianBlurElement() {\n    [native code]\n}",
458
  SVGElement_Binding::GetConstructorObject
459
};
460
461
static const DOMIfaceAndProtoJSClass sPrototypeClass = {
462
  {
463
    "SVGFEGaussianBlurElementPrototype",
464
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE),
465
    JS_NULL_CLASS_OPS,
466
    JS_NULL_CLASS_SPEC,
467
    JS_NULL_CLASS_EXT,
468
    JS_NULL_OBJECT_OPS
469
  },
470
  eInterfacePrototype,
471
  false,
472
  prototypes::id::SVGFEGaussianBlurElement,
473
  PrototypeTraits<prototypes::id::SVGFEGaussianBlurElement>::Depth,
474
  sNativePropertyHooks,
475
  "[object SVGFEGaussianBlurElementPrototype]",
476
  SVGElement_Binding::GetProtoObject
477
};
478
479
static const js::ClassOps sClassOps = {
480
  _addProperty, /* addProperty */
481
  nullptr,               /* delProperty */
482
  nullptr,               /* enumerate */
483
  nullptr, /* newEnumerate */
484
  nullptr, /* resolve */
485
  nullptr, /* mayResolve */
486
  _finalize, /* finalize */
487
  nullptr, /* call */
488
  nullptr,               /* hasInstance */
489
  nullptr,               /* construct */
490
  nullptr, /* trace */
491
};
492
493
static const js::ClassExtension sClassExtension = {
494
  nullptr, /* weakmapKeyDelegateOp */
495
  _objectMoved /* objectMovedOp */
496
};
497
498
static const DOMJSClass sClass = {
499
  { "SVGFEGaussianBlurElement",
500
    JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
501
    &sClassOps,
502
    JS_NULL_CLASS_SPEC,
503
    &sClassExtension,
504
    JS_NULL_OBJECT_OPS
505
  },
506
  { prototypes::id::EventTarget, prototypes::id::Node, prototypes::id::Element, prototypes::id::SVGElement, prototypes::id::SVGFEGaussianBlurElement, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
507
  IsBaseOf<nsISupports, mozilla::dom::SVGFEGaussianBlurElement >::value,
508
  sNativePropertyHooks,
509
  FindAssociatedGlobalForNative<mozilla::dom::SVGFEGaussianBlurElement>::Get,
510
  GetProtoObjectHandle,
511
  GetCCParticipant<mozilla::dom::SVGFEGaussianBlurElement>::Get()
512
};
513
static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
514
              "Must have the right minimal number of reserved slots.");
515
static_assert(1 >= 1,
516
              "Must have enough reserved slots.");
517
518
const JSClass*
519
GetJSClass()
520
0
{
521
0
  return sClass.ToJSClass();
522
0
}
523
524
bool
525
Wrap(JSContext* aCx, mozilla::dom::SVGFEGaussianBlurElement* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
526
0
{
527
0
  static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::dom::SVGFEGaussianBlurElement>::value,
528
0
                "Shouldn't have wrappercached things that are not refcounted.");
529
0
  MOZ_ASSERT(static_cast<mozilla::dom::SVGFEGaussianBlurElement*>(aObject) ==
530
0
             reinterpret_cast<mozilla::dom::SVGFEGaussianBlurElement*>(aObject),
531
0
             "Multiple inheritance for mozilla::dom::SVGFEGaussianBlurElement is broken.");
532
0
  MOZ_ASSERT(static_cast<nsSVGElement*>(aObject) ==
533
0
             reinterpret_cast<nsSVGElement*>(aObject),
534
0
             "Multiple inheritance for nsSVGElement is broken.");
535
0
  MOZ_ASSERT(static_cast<mozilla::dom::Element*>(aObject) ==
536
0
             reinterpret_cast<mozilla::dom::Element*>(aObject),
537
0
             "Multiple inheritance for mozilla::dom::Element is broken.");
538
0
  MOZ_ASSERT(static_cast<nsINode*>(aObject) ==
539
0
             reinterpret_cast<nsINode*>(aObject),
540
0
             "Multiple inheritance for nsINode is broken.");
541
0
  MOZ_ASSERT(static_cast<mozilla::dom::EventTarget*>(aObject) ==
542
0
             reinterpret_cast<mozilla::dom::EventTarget*>(aObject),
543
0
             "Multiple inheritance for mozilla::dom::EventTarget is broken.");
544
0
  MOZ_ASSERT(ToSupportsIsCorrect(aObject));
545
0
  MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
546
0
  MOZ_ASSERT(!aCache->GetWrapper(),
547
0
             "You should probably not be using Wrap() directly; use "
548
0
             "GetOrCreateDOMReflector instead");
549
0
550
0
  MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
551
0
             "nsISupports must be on our primary inheritance chain");
552
0
553
0
  JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
554
0
  if (!global) {
555
0
    return false;
556
0
  }
557
0
  MOZ_ASSERT(JS_IsGlobalObject(global));
558
0
  MOZ_ASSERT(JS::ObjectIsNotGray(global));
559
0
560
0
  // That might have ended up wrapping us already, due to the wonders
561
0
  // of XBL.  Check for that, and bail out as needed.
562
0
  aReflector.set(aCache->GetWrapper());
563
0
  if (aReflector) {
564
#ifdef DEBUG
565
    AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
566
#endif // DEBUG
567
    return true;
568
0
  }
569
0
570
0
  JSAutoRealm ar(aCx, global);
571
0
  JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
572
0
  if (!canonicalProto) {
573
0
    return false;
574
0
  }
575
0
  JS::Rooted<JSObject*> proto(aCx);
576
0
  if (aGivenProto) {
577
0
    proto = aGivenProto;
578
0
    // Unfortunately, while aGivenProto was in the compartment of aCx
579
0
    // coming in, we changed compartments to that of "parent" so may need
580
0
    // to wrap the proto here.
581
0
    if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) {
582
0
      if (!JS_WrapObject(aCx, &proto)) {
583
0
        return false;
584
0
      }
585
0
    }
586
0
  } else {
587
0
    proto = canonicalProto;
588
0
  }
589
0
590
0
  BindingJSObjectCreator<mozilla::dom::SVGFEGaussianBlurElement> creator(aCx);
591
0
  creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
592
0
  if (!aReflector) {
593
0
    return false;
594
0
  }
595
0
596
0
  aCache->SetWrapper(aReflector);
597
0
  creator.InitializationSucceeded();
598
0
599
0
  MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&
600
0
             aCache->GetWrapperPreserveColor() == aReflector);
601
0
  // If proto != canonicalProto, we have to preserve our wrapper;
602
0
  // otherwise we won't be able to properly recreate it later, since
603
0
  // we won't know what proto to use.  Note that we don't check
604
0
  // aGivenProto here, since it's entirely possible (and even
605
0
  // somewhat common) to have a non-null aGivenProto which is the
606
0
  // same as canonicalProto.
607
0
  if (proto != canonicalProto) {
608
0
    PreserveWrapper(aObject);
609
0
  }
610
0
611
0
  return true;
612
0
}
613
614
const NativePropertyHooks sNativePropertyHooks[] = { {
615
  nullptr,
616
  nullptr,
617
  nullptr,
618
  { sNativeProperties.Upcast(), nullptr },
619
  prototypes::id::SVGFEGaussianBlurElement,
620
  constructors::id::SVGFEGaussianBlurElement,
621
  SVGElement_Binding::sNativePropertyHooks,
622
  &DefaultXrayExpandoObjectClass
623
} };
624
625
void
626
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
627
0
{
628
0
  JS::Handle<JSObject*> parentProto(SVGElement_Binding::GetProtoObjectHandle(aCx));
629
0
  if (!parentProto) {
630
0
    return;
631
0
  }
632
0
633
0
  JS::Handle<JSObject*> constructorProto(SVGElement_Binding::GetConstructorObjectHandle(aCx));
634
0
  if (!constructorProto) {
635
0
    return;
636
0
  }
637
0
638
0
  static bool sIdsInited = false;
639
0
  if (!sIdsInited && NS_IsMainThread()) {
640
0
    if (!InitIds(aCx, sNativeProperties.Upcast())) {
641
0
      return;
642
0
    }
643
0
    sIdsInited = true;
644
0
  }
645
0
646
0
  JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::SVGFEGaussianBlurElement);
647
0
  JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::SVGFEGaussianBlurElement);
648
0
  dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
649
0
                              &sPrototypeClass.mBase, protoCache,
650
0
                              nullptr,
651
0
                              constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr,
652
0
                              interfaceCache,
653
0
                              sNativeProperties.Upcast(),
654
0
                              nullptr,
655
0
                              "SVGFEGaussianBlurElement", aDefineOnGlobal,
656
0
                              nullptr,
657
0
                              false);
658
0
}
659
660
JSObject*
661
GetConstructorObject(JSContext* aCx)
662
0
{
663
0
  return GetConstructorObjectHandle(aCx);
664
0
}
665
666
} // namespace SVGFEGaussianBlurElement_Binding
667
668
669
670
} // namespace dom
671
} // namespace mozilla