Coverage Report

Created: 2018-09-25 14:53

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