Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dom/bindings/SVGFEDropShadowElementBinding.cpp
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM SVGFEDropShadowElement.webidl BY Codegen.py - DO NOT EDIT */
2
3
#include "SVGElementBinding.h"
4
#include "SVGFEDropShadowElementBinding.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/SVGFEDropShadowElement.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 SVGFEDropShadowElement_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::SVGFEDropShadowElement* self, JSJitGetterCallArgs args)
32
0
{
33
0
  AUTO_PROFILER_LABEL_FAST("get SVGFEDropShadowElement.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::SVGFEDropShadowElement },
47
  { PrototypeTraits<prototypes::id::SVGFEDropShadowElement>::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_dx(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEDropShadowElement* self, JSJitGetterCallArgs args)
64
0
{
65
0
  AUTO_PROFILER_LABEL_FAST("get SVGFEDropShadowElement.dx", DOM, cx);
66
0
67
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->Dx()));
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 dx_getterinfo = {
77
  { (JSJitGetterOp)get_dx },
78
  { prototypes::id::SVGFEDropShadowElement },
79
  { PrototypeTraits<prototypes::id::SVGFEDropShadowElement>::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_dy(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEDropShadowElement* self, JSJitGetterCallArgs args)
96
0
{
97
0
  AUTO_PROFILER_LABEL_FAST("get SVGFEDropShadowElement.dy", DOM, cx);
98
0
99
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->Dy()));
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 dy_getterinfo = {
109
  { (JSJitGetterOp)get_dy },
110
  { prototypes::id::SVGFEDropShadowElement },
111
  { PrototypeTraits<prototypes::id::SVGFEDropShadowElement>::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
get_stdDeviationX(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEDropShadowElement* self, JSJitGetterCallArgs args)
128
0
{
129
0
  AUTO_PROFILER_LABEL_FAST("get SVGFEDropShadowElement.stdDeviationX", DOM, cx);
130
0
131
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->StdDeviationX()));
132
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
133
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
134
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
135
0
    return false;
136
0
  }
137
0
  return true;
138
0
}
139
140
static const JSJitInfo stdDeviationX_getterinfo = {
141
  { (JSJitGetterOp)get_stdDeviationX },
142
  { prototypes::id::SVGFEDropShadowElement },
143
  { PrototypeTraits<prototypes::id::SVGFEDropShadowElement>::Depth },
144
  JSJitInfo::Getter,
145
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
146
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
147
  false,  /* isInfallible. False in setters. */
148
  true,  /* isMovable.  Not relevant for setters. */
149
  true, /* isEliminatable.  Not relevant for setters. */
150
  false, /* isAlwaysInSlot.  Only relevant for getters. */
151
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
152
  false,  /* isTypedMethod.  Only relevant for methods. */
153
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
154
};
155
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
156
static_assert(0 < 1, "There is no slot for us");
157
158
MOZ_CAN_RUN_SCRIPT static bool
159
get_stdDeviationY(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEDropShadowElement* self, JSJitGetterCallArgs args)
160
0
{
161
0
  AUTO_PROFILER_LABEL_FAST("get SVGFEDropShadowElement.stdDeviationY", DOM, cx);
162
0
163
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedNumber>(self->StdDeviationY()));
164
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
165
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
166
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
167
0
    return false;
168
0
  }
169
0
  return true;
170
0
}
171
172
static const JSJitInfo stdDeviationY_getterinfo = {
173
  { (JSJitGetterOp)get_stdDeviationY },
174
  { prototypes::id::SVGFEDropShadowElement },
175
  { PrototypeTraits<prototypes::id::SVGFEDropShadowElement>::Depth },
176
  JSJitInfo::Getter,
177
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
178
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
179
  false,  /* isInfallible. False in setters. */
180
  true,  /* isMovable.  Not relevant for setters. */
181
  true, /* isEliminatable.  Not relevant for setters. */
182
  false, /* isAlwaysInSlot.  Only relevant for getters. */
183
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
184
  false,  /* isTypedMethod.  Only relevant for methods. */
185
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
186
};
187
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
188
static_assert(0 < 1, "There is no slot for us");
189
190
MOZ_CAN_RUN_SCRIPT static bool
191
setStdDeviation(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEDropShadowElement* self, const JSJitMethodCallArgs& args)
192
0
{
193
0
  AUTO_PROFILER_LABEL_FAST("SVGFEDropShadowElement.setStdDeviation", DOM, cx);
194
0
195
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
196
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "SVGFEDropShadowElement.setStdDeviation");
197
0
  }
198
0
  float arg0;
199
0
  if (!ValueToPrimitive<float, eDefault>(cx, args[0], &arg0)) {
200
0
    return false;
201
0
  } else if (!mozilla::IsFinite(arg0)) {
202
0
    ThrowErrorMessage(cx, MSG_NOT_FINITE, "Argument 1 of SVGFEDropShadowElement.setStdDeviation");
203
0
    return false;
204
0
  }
205
0
  float arg1;
206
0
  if (!ValueToPrimitive<float, eDefault>(cx, args[1], &arg1)) {
207
0
    return false;
208
0
  } else if (!mozilla::IsFinite(arg1)) {
209
0
    ThrowErrorMessage(cx, MSG_NOT_FINITE, "Argument 2 of SVGFEDropShadowElement.setStdDeviation");
210
0
    return false;
211
0
  }
212
0
  self->SetStdDeviation(arg0, arg1);
213
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
214
0
  args.rval().setUndefined();
215
0
  return true;
216
0
}
217
218
static const JSJitInfo setStdDeviation_methodinfo = {
219
  { (JSJitGetterOp)setStdDeviation },
220
  { prototypes::id::SVGFEDropShadowElement },
221
  { PrototypeTraits<prototypes::id::SVGFEDropShadowElement>::Depth },
222
  JSJitInfo::Method,
223
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
224
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
225
  false,  /* isInfallible. False in setters. */
226
  false,  /* isMovable.  Not relevant for setters. */
227
  false, /* 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_x(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEDropShadowElement* self, JSJitGetterCallArgs args)
238
0
{
239
0
  AUTO_PROFILER_LABEL_FAST("get SVGFEDropShadowElement.x", DOM, cx);
240
0
241
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->X()));
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 x_getterinfo = {
251
  { (JSJitGetterOp)get_x },
252
  { prototypes::id::SVGFEDropShadowElement },
253
  { PrototypeTraits<prototypes::id::SVGFEDropShadowElement>::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_y(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEDropShadowElement* self, JSJitGetterCallArgs args)
270
0
{
271
0
  AUTO_PROFILER_LABEL_FAST("get SVGFEDropShadowElement.y", DOM, cx);
272
0
273
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->Y()));
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 y_getterinfo = {
283
  { (JSJitGetterOp)get_y },
284
  { prototypes::id::SVGFEDropShadowElement },
285
  { PrototypeTraits<prototypes::id::SVGFEDropShadowElement>::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_width(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEDropShadowElement* self, JSJitGetterCallArgs args)
302
0
{
303
0
  AUTO_PROFILER_LABEL_FAST("get SVGFEDropShadowElement.width", DOM, cx);
304
0
305
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->Width()));
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 width_getterinfo = {
315
  { (JSJitGetterOp)get_width },
316
  { prototypes::id::SVGFEDropShadowElement },
317
  { PrototypeTraits<prototypes::id::SVGFEDropShadowElement>::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
MOZ_CAN_RUN_SCRIPT static bool
333
get_height(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEDropShadowElement* self, JSJitGetterCallArgs args)
334
0
{
335
0
  AUTO_PROFILER_LABEL_FAST("get SVGFEDropShadowElement.height", DOM, cx);
336
0
337
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->Height()));
338
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
339
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
340
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
341
0
    return false;
342
0
  }
343
0
  return true;
344
0
}
345
346
static const JSJitInfo height_getterinfo = {
347
  { (JSJitGetterOp)get_height },
348
  { prototypes::id::SVGFEDropShadowElement },
349
  { PrototypeTraits<prototypes::id::SVGFEDropShadowElement>::Depth },
350
  JSJitInfo::Getter,
351
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
352
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
353
  false,  /* isInfallible. False in setters. */
354
  true,  /* isMovable.  Not relevant for setters. */
355
  true, /* isEliminatable.  Not relevant for setters. */
356
  false, /* isAlwaysInSlot.  Only relevant for getters. */
357
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
358
  false,  /* isTypedMethod.  Only relevant for methods. */
359
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
360
};
361
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
362
static_assert(0 < 1, "There is no slot for us");
363
364
MOZ_CAN_RUN_SCRIPT static bool
365
get_result(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGFEDropShadowElement* self, JSJitGetterCallArgs args)
366
0
{
367
0
  AUTO_PROFILER_LABEL_FAST("get SVGFEDropShadowElement.result", DOM, cx);
368
0
369
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedString>(self->Result()));
370
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
371
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
372
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
373
0
    return false;
374
0
  }
375
0
  return true;
376
0
}
377
378
static const JSJitInfo result_getterinfo = {
379
  { (JSJitGetterOp)get_result },
380
  { prototypes::id::SVGFEDropShadowElement },
381
  { PrototypeTraits<prototypes::id::SVGFEDropShadowElement>::Depth },
382
  JSJitInfo::Getter,
383
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
384
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
385
  false,  /* isInfallible. False in setters. */
386
  true,  /* isMovable.  Not relevant for setters. */
387
  true, /* isEliminatable.  Not relevant for setters. */
388
  false, /* isAlwaysInSlot.  Only relevant for getters. */
389
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
390
  false,  /* isTypedMethod.  Only relevant for methods. */
391
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
392
};
393
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
394
static_assert(0 < 1, "There is no slot for us");
395
396
static bool
397
_addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
398
0
{
399
0
  mozilla::dom::SVGFEDropShadowElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGFEDropShadowElement>(obj);
400
0
  // We don't want to preserve if we don't have a wrapper, and we
401
0
  // obviously can't preserve if we're not initialized.
402
0
  if (self && self->GetWrapperPreserveColor()) {
403
0
    PreserveWrapper(self);
404
0
  }
405
0
  return true;
406
0
}
407
408
static void
409
_finalize(js::FreeOp* fop, JSObject* obj)
410
0
{
411
0
  mozilla::dom::SVGFEDropShadowElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGFEDropShadowElement>(obj);
412
0
  if (self) {
413
0
    ClearWrapper(self, self, obj);
414
0
    AddForDeferredFinalization<mozilla::dom::SVGFEDropShadowElement>(self);
415
0
  }
416
0
}
417
418
static size_t
419
_objectMoved(JSObject* obj, JSObject* old)
420
0
{
421
0
  mozilla::dom::SVGFEDropShadowElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGFEDropShadowElement>(obj);
422
0
  if (self) {
423
0
    UpdateWrapper(self, self, obj, old);
424
0
  }
425
0
426
0
  return 0;
427
0
}
428
429
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
430
#if defined(__clang__)
431
#pragma clang diagnostic push
432
#pragma clang diagnostic ignored "-Wmissing-braces"
433
#endif
434
static const JSFunctionSpec sMethods_specs[] = {
435
  JS_FNSPEC("setStdDeviation", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&setStdDeviation_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
436
  JS_FS_END
437
};
438
#if defined(__clang__)
439
#pragma clang diagnostic pop
440
#endif
441
442
443
static const Prefable<const JSFunctionSpec> sMethods[] = {
444
  { nullptr, &sMethods_specs[0] },
445
  { nullptr, nullptr }
446
};
447
448
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
449
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
450
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
451
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
452
453
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
454
#if defined(__clang__)
455
#pragma clang diagnostic push
456
#pragma clang diagnostic ignored "-Wmissing-braces"
457
#endif
458
static const JSPropertySpec sAttributes_specs[] = {
459
  { "in1", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &in1_getterinfo, nullptr, nullptr },
460
  { "dx", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &dx_getterinfo, nullptr, nullptr },
461
  { "dy", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &dy_getterinfo, nullptr, nullptr },
462
  { "stdDeviationX", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &stdDeviationX_getterinfo, nullptr, nullptr },
463
  { "stdDeviationY", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &stdDeviationY_getterinfo, nullptr, nullptr },
464
  { "x", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &x_getterinfo, nullptr, nullptr },
465
  { "y", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &y_getterinfo, nullptr, nullptr },
466
  { "width", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &width_getterinfo, nullptr, nullptr },
467
  { "height", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &height_getterinfo, nullptr, nullptr },
468
  { "result", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &result_getterinfo, nullptr, nullptr },
469
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
470
};
471
#if defined(__clang__)
472
#pragma clang diagnostic pop
473
#endif
474
475
476
static const Prefable<const JSPropertySpec> sAttributes[] = {
477
  { nullptr, &sAttributes_specs[0] },
478
  { nullptr, nullptr }
479
};
480
481
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
482
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
483
static_assert(10 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
484
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
485
486
487
static uint16_t sNativeProperties_sortedPropertyIndices[11];
488
static PropertyInfo sNativeProperties_propertyInfos[11];
489
490
static const NativePropertiesN<2> sNativeProperties = {
491
  false, 0,
492
  false, 0,
493
  true,  0 /* sMethods */,
494
  true,  1 /* sAttributes */,
495
  false, 0,
496
  false, 0,
497
  false, 0,
498
  -1,
499
  11,
500
  sNativeProperties_sortedPropertyIndices,
501
  {
502
    { sMethods, &sNativeProperties_propertyInfos[0] },
503
    { sAttributes, &sNativeProperties_propertyInfos[1] }
504
  }
505
};
506
static_assert(11 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
507
    "We have a property info count that is oversized");
508
509
static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
510
  {
511
    "Function",
512
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE),
513
    &sBoringInterfaceObjectClassClassOps,
514
    JS_NULL_CLASS_SPEC,
515
    JS_NULL_CLASS_EXT,
516
    &sInterfaceObjectClassObjectOps
517
  },
518
  eInterface,
519
  true,
520
  prototypes::id::SVGFEDropShadowElement,
521
  PrototypeTraits<prototypes::id::SVGFEDropShadowElement>::Depth,
522
  sNativePropertyHooks,
523
  "function SVGFEDropShadowElement() {\n    [native code]\n}",
524
  SVGElement_Binding::GetConstructorObject
525
};
526
527
static const DOMIfaceAndProtoJSClass sPrototypeClass = {
528
  {
529
    "SVGFEDropShadowElementPrototype",
530
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE),
531
    JS_NULL_CLASS_OPS,
532
    JS_NULL_CLASS_SPEC,
533
    JS_NULL_CLASS_EXT,
534
    JS_NULL_OBJECT_OPS
535
  },
536
  eInterfacePrototype,
537
  false,
538
  prototypes::id::SVGFEDropShadowElement,
539
  PrototypeTraits<prototypes::id::SVGFEDropShadowElement>::Depth,
540
  sNativePropertyHooks,
541
  "[object SVGFEDropShadowElementPrototype]",
542
  SVGElement_Binding::GetProtoObject
543
};
544
545
static const js::ClassOps sClassOps = {
546
  _addProperty, /* addProperty */
547
  nullptr,               /* delProperty */
548
  nullptr,               /* enumerate */
549
  nullptr, /* newEnumerate */
550
  nullptr, /* resolve */
551
  nullptr, /* mayResolve */
552
  _finalize, /* finalize */
553
  nullptr, /* call */
554
  nullptr,               /* hasInstance */
555
  nullptr,               /* construct */
556
  nullptr, /* trace */
557
};
558
559
static const js::ClassExtension sClassExtension = {
560
  nullptr, /* weakmapKeyDelegateOp */
561
  _objectMoved /* objectMovedOp */
562
};
563
564
static const DOMJSClass sClass = {
565
  { "SVGFEDropShadowElement",
566
    JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
567
    &sClassOps,
568
    JS_NULL_CLASS_SPEC,
569
    &sClassExtension,
570
    JS_NULL_OBJECT_OPS
571
  },
572
  { prototypes::id::EventTarget, prototypes::id::Node, prototypes::id::Element, prototypes::id::SVGElement, prototypes::id::SVGFEDropShadowElement, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
573
  IsBaseOf<nsISupports, mozilla::dom::SVGFEDropShadowElement >::value,
574
  sNativePropertyHooks,
575
  FindAssociatedGlobalForNative<mozilla::dom::SVGFEDropShadowElement>::Get,
576
  GetProtoObjectHandle,
577
  GetCCParticipant<mozilla::dom::SVGFEDropShadowElement>::Get()
578
};
579
static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
580
              "Must have the right minimal number of reserved slots.");
581
static_assert(1 >= 1,
582
              "Must have enough reserved slots.");
583
584
const JSClass*
585
GetJSClass()
586
0
{
587
0
  return sClass.ToJSClass();
588
0
}
589
590
bool
591
Wrap(JSContext* aCx, mozilla::dom::SVGFEDropShadowElement* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
592
0
{
593
0
  static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::dom::SVGFEDropShadowElement>::value,
594
0
                "Shouldn't have wrappercached things that are not refcounted.");
595
0
  MOZ_ASSERT(static_cast<mozilla::dom::SVGFEDropShadowElement*>(aObject) ==
596
0
             reinterpret_cast<mozilla::dom::SVGFEDropShadowElement*>(aObject),
597
0
             "Multiple inheritance for mozilla::dom::SVGFEDropShadowElement is broken.");
598
0
  MOZ_ASSERT(static_cast<nsSVGElement*>(aObject) ==
599
0
             reinterpret_cast<nsSVGElement*>(aObject),
600
0
             "Multiple inheritance for nsSVGElement is broken.");
601
0
  MOZ_ASSERT(static_cast<mozilla::dom::Element*>(aObject) ==
602
0
             reinterpret_cast<mozilla::dom::Element*>(aObject),
603
0
             "Multiple inheritance for mozilla::dom::Element is broken.");
604
0
  MOZ_ASSERT(static_cast<nsINode*>(aObject) ==
605
0
             reinterpret_cast<nsINode*>(aObject),
606
0
             "Multiple inheritance for nsINode is broken.");
607
0
  MOZ_ASSERT(static_cast<mozilla::dom::EventTarget*>(aObject) ==
608
0
             reinterpret_cast<mozilla::dom::EventTarget*>(aObject),
609
0
             "Multiple inheritance for mozilla::dom::EventTarget is broken.");
610
0
  MOZ_ASSERT(ToSupportsIsCorrect(aObject));
611
0
  MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
612
0
  MOZ_ASSERT(!aCache->GetWrapper(),
613
0
             "You should probably not be using Wrap() directly; use "
614
0
             "GetOrCreateDOMReflector instead");
615
0
616
0
  MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
617
0
             "nsISupports must be on our primary inheritance chain");
618
0
619
0
  JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
620
0
  if (!global) {
621
0
    return false;
622
0
  }
623
0
  MOZ_ASSERT(JS_IsGlobalObject(global));
624
0
  MOZ_ASSERT(JS::ObjectIsNotGray(global));
625
0
626
0
  // That might have ended up wrapping us already, due to the wonders
627
0
  // of XBL.  Check for that, and bail out as needed.
628
0
  aReflector.set(aCache->GetWrapper());
629
0
  if (aReflector) {
630
#ifdef DEBUG
631
    AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
632
#endif // DEBUG
633
    return true;
634
0
  }
635
0
636
0
  JSAutoRealm ar(aCx, global);
637
0
  JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
638
0
  if (!canonicalProto) {
639
0
    return false;
640
0
  }
641
0
  JS::Rooted<JSObject*> proto(aCx);
642
0
  if (aGivenProto) {
643
0
    proto = aGivenProto;
644
0
    // Unfortunately, while aGivenProto was in the compartment of aCx
645
0
    // coming in, we changed compartments to that of "parent" so may need
646
0
    // to wrap the proto here.
647
0
    if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) {
648
0
      if (!JS_WrapObject(aCx, &proto)) {
649
0
        return false;
650
0
      }
651
0
    }
652
0
  } else {
653
0
    proto = canonicalProto;
654
0
  }
655
0
656
0
  BindingJSObjectCreator<mozilla::dom::SVGFEDropShadowElement> creator(aCx);
657
0
  creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
658
0
  if (!aReflector) {
659
0
    return false;
660
0
  }
661
0
662
0
  aCache->SetWrapper(aReflector);
663
0
  creator.InitializationSucceeded();
664
0
665
0
  MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&
666
0
             aCache->GetWrapperPreserveColor() == aReflector);
667
0
  // If proto != canonicalProto, we have to preserve our wrapper;
668
0
  // otherwise we won't be able to properly recreate it later, since
669
0
  // we won't know what proto to use.  Note that we don't check
670
0
  // aGivenProto here, since it's entirely possible (and even
671
0
  // somewhat common) to have a non-null aGivenProto which is the
672
0
  // same as canonicalProto.
673
0
  if (proto != canonicalProto) {
674
0
    PreserveWrapper(aObject);
675
0
  }
676
0
677
0
  return true;
678
0
}
679
680
const NativePropertyHooks sNativePropertyHooks[] = { {
681
  nullptr,
682
  nullptr,
683
  nullptr,
684
  { sNativeProperties.Upcast(), nullptr },
685
  prototypes::id::SVGFEDropShadowElement,
686
  constructors::id::SVGFEDropShadowElement,
687
  SVGElement_Binding::sNativePropertyHooks,
688
  &DefaultXrayExpandoObjectClass
689
} };
690
691
void
692
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
693
0
{
694
0
  JS::Handle<JSObject*> parentProto(SVGElement_Binding::GetProtoObjectHandle(aCx));
695
0
  if (!parentProto) {
696
0
    return;
697
0
  }
698
0
699
0
  JS::Handle<JSObject*> constructorProto(SVGElement_Binding::GetConstructorObjectHandle(aCx));
700
0
  if (!constructorProto) {
701
0
    return;
702
0
  }
703
0
704
0
  static bool sIdsInited = false;
705
0
  if (!sIdsInited && NS_IsMainThread()) {
706
0
    if (!InitIds(aCx, sNativeProperties.Upcast())) {
707
0
      return;
708
0
    }
709
0
    sIdsInited = true;
710
0
  }
711
0
712
0
  JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::SVGFEDropShadowElement);
713
0
  JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::SVGFEDropShadowElement);
714
0
  dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
715
0
                              &sPrototypeClass.mBase, protoCache,
716
0
                              nullptr,
717
0
                              constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr,
718
0
                              interfaceCache,
719
0
                              sNativeProperties.Upcast(),
720
0
                              nullptr,
721
0
                              "SVGFEDropShadowElement", aDefineOnGlobal,
722
0
                              nullptr,
723
0
                              false);
724
0
}
725
726
JSObject*
727
GetConstructorObject(JSContext* aCx)
728
0
{
729
0
  return GetConstructorObjectHandle(aCx);
730
0
}
731
732
} // namespace SVGFEDropShadowElement_Binding
733
734
735
736
} // namespace dom
737
} // namespace mozilla