Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM KeyframeEffect.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_KeyframeEffectBinding_h
4 : #define mozilla_dom_KeyframeEffectBinding_h
5 :
6 : #include "AnimationEffectReadOnlyBinding.h"
7 : #include "BaseKeyframeTypesBinding.h"
8 : #include "js/RootingAPI.h"
9 : #include "jspubtd.h"
10 : #include "mozilla/ErrorResult.h"
11 : #include "mozilla/dom/BindingDeclarations.h"
12 : #include "mozilla/dom/FakeString.h"
13 : #include "mozilla/dom/Nullable.h"
14 : #include "mozilla/dom/UnionMember.h"
15 : #include "mozilla/dom/UnionTypes.h"
16 :
17 : namespace mozilla {
18 : namespace dom {
19 :
20 : struct AnimationPropertyDetailsAtoms;
21 : struct AnimationPropertyValueDetails;
22 : struct AnimationPropertyValueDetailsAtoms;
23 : class CSSPseudoElement;
24 : class Element;
25 : class KeyframeEffect;
26 : struct KeyframeEffectAtoms;
27 : struct KeyframeEffectOptionsAtoms;
28 : class KeyframeEffectReadOnly;
29 : struct KeyframeEffectReadOnlyAtoms;
30 : struct NativePropertyHooks;
31 : class OwningElementOrCSSPseudoElement;
32 : class OwningUnrestrictedDoubleOrString;
33 : class ProtoAndIfaceCache;
34 : class UnrestrictedDoubleOrString;
35 :
36 : } // namespace dom
37 : } // namespace mozilla
38 :
39 : namespace mozilla {
40 : namespace dom {
41 :
42 : enum class IterationCompositeOperation : uint8_t {
43 : Replace,
44 : Accumulate,
45 : EndGuard_
46 : };
47 :
48 : namespace IterationCompositeOperationValues {
49 : extern const EnumEntry strings[3];
50 : } // namespace IterationCompositeOperationValues
51 :
52 : bool
53 : ToJSValue(JSContext* aCx, IterationCompositeOperation aArgument, JS::MutableHandle<JS::Value> aValue);
54 :
55 :
56 : void
57 : ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback, OwningElementOrCSSPseudoElement& aUnion, const char* aName, uint32_t aFlags = 0);
58 :
59 :
60 : void
61 : ImplCycleCollectionUnlink(OwningElementOrCSSPseudoElement& aUnion);
62 :
63 :
64 0 : struct AnimationPropertyValueDetails : public DictionaryBase
65 : {
66 : MOZ_INIT_OUTSIDE_CTOR CompositeOperation mComposite;
67 : MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mEasing;
68 : MOZ_INIT_OUTSIDE_CTOR double mOffset;
69 : MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mValue;
70 :
71 : AnimationPropertyValueDetails();
72 :
73 0 : explicit inline AnimationPropertyValueDetails(const FastDictionaryInitializer& )
74 0 : {
75 : // Do nothing here; this is used by our "Fast" subclass
76 0 : }
77 :
78 0 : explicit inline AnimationPropertyValueDetails(const AnimationPropertyValueDetails& aOther)
79 0 : {
80 0 : *this = aOther;
81 0 : }
82 :
83 : bool
84 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
85 :
86 : bool
87 : Init(const nsAString& aJSON);
88 :
89 : bool
90 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
91 :
92 : bool
93 : ToJSON(nsAString& aJSON) const;
94 :
95 : void
96 : TraceDictionary(JSTracer* trc);
97 :
98 : AnimationPropertyValueDetails&
99 : operator=(const AnimationPropertyValueDetails& aOther);
100 :
101 : private:
102 : static bool
103 : InitIds(JSContext* cx, AnimationPropertyValueDetailsAtoms* atomsCache);
104 : };
105 :
106 : namespace binding_detail {
107 0 : struct FastAnimationPropertyValueDetails : public AnimationPropertyValueDetails
108 : {
109 0 : inline FastAnimationPropertyValueDetails()
110 0 : : AnimationPropertyValueDetails(FastDictionaryInitializer())
111 : {
112 : // Doesn't matter what int we pass to the parent constructor
113 0 : }
114 : };
115 : } // namespace binding_detail
116 :
117 :
118 : class ElementOrCSSPseudoElement
119 : {
120 : friend class ElementOrCSSPseudoElementArgument;
121 : enum Type
122 : {
123 : eUninitialized,
124 : eElement,
125 : eCSSPseudoElement
126 : };
127 :
128 0 : union Value
129 : {
130 : UnionMember<NonNull<mozilla::dom::Element> > mElement;
131 : UnionMember<NonNull<mozilla::dom::CSSPseudoElement> > mCSSPseudoElement;
132 :
133 : };
134 :
135 : Type mType;
136 : Value mValue;
137 :
138 : ElementOrCSSPseudoElement(const ElementOrCSSPseudoElement&) = delete;
139 : ElementOrCSSPseudoElement& operator=(const ElementOrCSSPseudoElement&) = delete;
140 : public:
141 0 : explicit inline ElementOrCSSPseudoElement()
142 0 : : mType(eUninitialized)
143 : {
144 0 : }
145 :
146 0 : inline ~ElementOrCSSPseudoElement()
147 0 : {
148 0 : Uninit();
149 0 : }
150 :
151 : inline NonNull<mozilla::dom::Element>&
152 : RawSetAsElement()
153 : {
154 : if (mType == eElement) {
155 : return mValue.mElement.Value();
156 : }
157 : MOZ_ASSERT(mType == eUninitialized);
158 : mType = eElement;
159 : return mValue.mElement.SetValue();
160 : }
161 :
162 : inline NonNull<mozilla::dom::Element>&
163 0 : SetAsElement()
164 : {
165 0 : if (mType == eElement) {
166 0 : return mValue.mElement.Value();
167 : }
168 0 : Uninit();
169 0 : mType = eElement;
170 0 : return mValue.mElement.SetValue();
171 : }
172 :
173 : inline bool
174 0 : IsElement() const
175 : {
176 0 : return mType == eElement;
177 : }
178 :
179 : inline NonNull<mozilla::dom::Element>&
180 : GetAsElement()
181 : {
182 : MOZ_ASSERT(IsElement(), "Wrong type!");
183 : return mValue.mElement.Value();
184 : }
185 :
186 : inline mozilla::dom::Element&
187 0 : GetAsElement() const
188 : {
189 0 : MOZ_ASSERT(IsElement(), "Wrong type!");
190 0 : return mValue.mElement.Value();
191 : }
192 :
193 : inline NonNull<mozilla::dom::CSSPseudoElement>&
194 : RawSetAsCSSPseudoElement()
195 : {
196 : if (mType == eCSSPseudoElement) {
197 : return mValue.mCSSPseudoElement.Value();
198 : }
199 : MOZ_ASSERT(mType == eUninitialized);
200 : mType = eCSSPseudoElement;
201 : return mValue.mCSSPseudoElement.SetValue();
202 : }
203 :
204 : inline NonNull<mozilla::dom::CSSPseudoElement>&
205 0 : SetAsCSSPseudoElement()
206 : {
207 0 : if (mType == eCSSPseudoElement) {
208 0 : return mValue.mCSSPseudoElement.Value();
209 : }
210 0 : Uninit();
211 0 : mType = eCSSPseudoElement;
212 0 : return mValue.mCSSPseudoElement.SetValue();
213 : }
214 :
215 : inline bool
216 0 : IsCSSPseudoElement() const
217 : {
218 0 : return mType == eCSSPseudoElement;
219 : }
220 :
221 : inline NonNull<mozilla::dom::CSSPseudoElement>&
222 : GetAsCSSPseudoElement()
223 : {
224 : MOZ_ASSERT(IsCSSPseudoElement(), "Wrong type!");
225 : return mValue.mCSSPseudoElement.Value();
226 : }
227 :
228 : inline mozilla::dom::CSSPseudoElement&
229 0 : GetAsCSSPseudoElement() const
230 : {
231 0 : MOZ_ASSERT(IsCSSPseudoElement(), "Wrong type!");
232 0 : return mValue.mCSSPseudoElement.Value();
233 : }
234 :
235 : inline void
236 0 : Uninit()
237 : {
238 0 : switch (mType) {
239 : case eUninitialized: {
240 0 : break;
241 : }
242 : case eElement: {
243 0 : DestroyElement();
244 0 : break;
245 : }
246 : case eCSSPseudoElement: {
247 0 : DestroyCSSPseudoElement();
248 0 : break;
249 : }
250 : }
251 0 : }
252 :
253 : bool
254 : ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
255 :
256 : private:
257 : inline void
258 0 : DestroyElement()
259 : {
260 0 : MOZ_ASSERT(IsElement(), "Wrong type!");
261 0 : mValue.mElement.Destroy();
262 0 : mType = eUninitialized;
263 0 : }
264 :
265 : inline void
266 0 : DestroyCSSPseudoElement()
267 : {
268 0 : MOZ_ASSERT(IsCSSPseudoElement(), "Wrong type!");
269 0 : mValue.mCSSPseudoElement.Destroy();
270 0 : mType = eUninitialized;
271 0 : }
272 : };
273 :
274 :
275 : class OwningElementOrCSSPseudoElement : public AllOwningUnionBase
276 : {
277 : friend void ImplCycleCollectionUnlink(OwningElementOrCSSPseudoElement& aUnion);
278 : enum Type
279 : {
280 : eUninitialized,
281 : eElement,
282 : eCSSPseudoElement
283 : };
284 :
285 0 : union Value
286 : {
287 : UnionMember<OwningNonNull<mozilla::dom::Element> > mElement;
288 : UnionMember<OwningNonNull<mozilla::dom::CSSPseudoElement> > mCSSPseudoElement;
289 :
290 : };
291 :
292 : Type mType;
293 : Value mValue;
294 :
295 : public:
296 0 : explicit inline OwningElementOrCSSPseudoElement()
297 0 : : mType(eUninitialized)
298 : {
299 0 : }
300 :
301 : explicit inline OwningElementOrCSSPseudoElement(const OwningElementOrCSSPseudoElement& aOther)
302 : : mType(eUninitialized)
303 : {
304 : *this = aOther;
305 : }
306 :
307 0 : inline ~OwningElementOrCSSPseudoElement()
308 0 : {
309 0 : Uninit();
310 0 : }
311 :
312 : OwningNonNull<mozilla::dom::Element>&
313 : RawSetAsElement();
314 :
315 : OwningNonNull<mozilla::dom::Element>&
316 : SetAsElement();
317 :
318 : bool
319 : TrySetToElement(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
320 :
321 : inline bool
322 0 : IsElement() const
323 : {
324 0 : return mType == eElement;
325 : }
326 :
327 : inline OwningNonNull<mozilla::dom::Element>&
328 0 : GetAsElement()
329 : {
330 0 : MOZ_ASSERT(IsElement(), "Wrong type!");
331 0 : return mValue.mElement.Value();
332 : }
333 :
334 : inline OwningNonNull<mozilla::dom::Element> const &
335 0 : GetAsElement() const
336 : {
337 0 : MOZ_ASSERT(IsElement(), "Wrong type!");
338 0 : return mValue.mElement.Value();
339 : }
340 :
341 : OwningNonNull<mozilla::dom::CSSPseudoElement>&
342 : RawSetAsCSSPseudoElement();
343 :
344 : OwningNonNull<mozilla::dom::CSSPseudoElement>&
345 : SetAsCSSPseudoElement();
346 :
347 : bool
348 : TrySetToCSSPseudoElement(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
349 :
350 : inline bool
351 0 : IsCSSPseudoElement() const
352 : {
353 0 : return mType == eCSSPseudoElement;
354 : }
355 :
356 : inline OwningNonNull<mozilla::dom::CSSPseudoElement>&
357 0 : GetAsCSSPseudoElement()
358 : {
359 0 : MOZ_ASSERT(IsCSSPseudoElement(), "Wrong type!");
360 0 : return mValue.mCSSPseudoElement.Value();
361 : }
362 :
363 : inline OwningNonNull<mozilla::dom::CSSPseudoElement> const &
364 0 : GetAsCSSPseudoElement() const
365 : {
366 0 : MOZ_ASSERT(IsCSSPseudoElement(), "Wrong type!");
367 0 : return mValue.mCSSPseudoElement.Value();
368 : }
369 :
370 : void
371 : Uninit();
372 :
373 : bool
374 : ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
375 :
376 : void
377 : TraceUnion(JSTracer* trc);
378 :
379 : OwningElementOrCSSPseudoElement&
380 : operator=(const OwningElementOrCSSPseudoElement& aOther);
381 :
382 : private:
383 : void
384 : DestroyElement();
385 :
386 : void
387 : DestroyCSSPseudoElement();
388 : };
389 :
390 :
391 0 : struct KeyframeEffectOptions : public AnimationEffectTimingProperties
392 : {
393 : MOZ_INIT_OUTSIDE_CTOR CompositeOperation mComposite;
394 : MOZ_INIT_OUTSIDE_CTOR IterationCompositeOperation mIterationComposite;
395 :
396 : KeyframeEffectOptions();
397 :
398 0 : explicit inline KeyframeEffectOptions(const FastDictionaryInitializer& )
399 0 : : AnimationEffectTimingProperties(FastDictionaryInitializer())
400 : {
401 : // Do nothing here; this is used by our "Fast" subclass
402 0 : }
403 :
404 : explicit inline KeyframeEffectOptions(const KeyframeEffectOptions& aOther)
405 : {
406 : *this = aOther;
407 : }
408 :
409 : bool
410 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
411 :
412 : bool
413 : Init(const nsAString& aJSON);
414 :
415 : bool
416 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
417 :
418 : bool
419 : ToJSON(nsAString& aJSON) const;
420 :
421 : void
422 : TraceDictionary(JSTracer* trc);
423 :
424 : KeyframeEffectOptions&
425 : operator=(const KeyframeEffectOptions& aOther);
426 :
427 : private:
428 : static bool
429 : InitIds(JSContext* cx, KeyframeEffectOptionsAtoms* atomsCache);
430 : };
431 :
432 : namespace binding_detail {
433 0 : struct FastKeyframeEffectOptions : public KeyframeEffectOptions
434 : {
435 0 : inline FastKeyframeEffectOptions()
436 0 : : KeyframeEffectOptions(FastDictionaryInitializer())
437 : {
438 : // Doesn't matter what int we pass to the parent constructor
439 0 : }
440 : };
441 : } // namespace binding_detail
442 :
443 :
444 0 : struct AnimationPropertyDetails : public DictionaryBase
445 : {
446 : MOZ_INIT_OUTSIDE_CTOR nsString mProperty;
447 : MOZ_INIT_OUTSIDE_CTOR bool mRunningOnCompositor;
448 : MOZ_INIT_OUTSIDE_CTOR Sequence<AnimationPropertyValueDetails> mValues;
449 : MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mWarning;
450 :
451 : AnimationPropertyDetails();
452 :
453 : explicit inline AnimationPropertyDetails(const FastDictionaryInitializer& )
454 : {
455 : // Do nothing here; this is used by our "Fast" subclass
456 : }
457 :
458 0 : explicit inline AnimationPropertyDetails(const AnimationPropertyDetails& aOther)
459 0 : {
460 0 : *this = aOther;
461 0 : }
462 :
463 : bool
464 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
465 :
466 : bool
467 : Init(const nsAString& aJSON);
468 :
469 : bool
470 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
471 :
472 : bool
473 : ToJSON(nsAString& aJSON) const;
474 :
475 : void
476 : TraceDictionary(JSTracer* trc);
477 :
478 : AnimationPropertyDetails&
479 : operator=(const AnimationPropertyDetails& aOther);
480 :
481 : private:
482 : static bool
483 : InitIds(JSContext* cx, AnimationPropertyDetailsAtoms* atomsCache);
484 : };
485 :
486 : namespace binding_detail {
487 : struct FastAnimationPropertyDetails : public AnimationPropertyDetails
488 : {
489 : inline FastAnimationPropertyDetails()
490 : : AnimationPropertyDetails(FastDictionaryInitializer())
491 : {
492 : // Doesn't matter what int we pass to the parent constructor
493 : }
494 : };
495 : } // namespace binding_detail
496 :
497 :
498 : class UnrestrictedDoubleOrKeyframeEffectOptions
499 : {
500 : friend class UnrestrictedDoubleOrKeyframeEffectOptionsArgument;
501 : enum Type
502 : {
503 : eUninitialized,
504 : eUnrestrictedDouble,
505 : eKeyframeEffectOptions
506 : };
507 :
508 0 : union Value
509 : {
510 : UnionMember<double > mUnrestrictedDouble;
511 : UnionMember<binding_detail::FastKeyframeEffectOptions > mKeyframeEffectOptions;
512 :
513 : };
514 :
515 : Type mType;
516 : Value mValue;
517 :
518 : UnrestrictedDoubleOrKeyframeEffectOptions(const UnrestrictedDoubleOrKeyframeEffectOptions&) = delete;
519 : UnrestrictedDoubleOrKeyframeEffectOptions& operator=(const UnrestrictedDoubleOrKeyframeEffectOptions&) = delete;
520 : public:
521 0 : explicit inline UnrestrictedDoubleOrKeyframeEffectOptions()
522 0 : : mType(eUninitialized)
523 : {
524 0 : }
525 :
526 0 : inline ~UnrestrictedDoubleOrKeyframeEffectOptions()
527 0 : {
528 0 : Uninit();
529 0 : }
530 :
531 : inline double&
532 : RawSetAsUnrestrictedDouble()
533 : {
534 : if (mType == eUnrestrictedDouble) {
535 : return mValue.mUnrestrictedDouble.Value();
536 : }
537 : MOZ_ASSERT(mType == eUninitialized);
538 : mType = eUnrestrictedDouble;
539 : return mValue.mUnrestrictedDouble.SetValue();
540 : }
541 :
542 : inline double&
543 : SetAsUnrestrictedDouble()
544 : {
545 : if (mType == eUnrestrictedDouble) {
546 : return mValue.mUnrestrictedDouble.Value();
547 : }
548 : Uninit();
549 : mType = eUnrestrictedDouble;
550 : return mValue.mUnrestrictedDouble.SetValue();
551 : }
552 :
553 : inline bool
554 0 : IsUnrestrictedDouble() const
555 : {
556 0 : return mType == eUnrestrictedDouble;
557 : }
558 :
559 : inline double&
560 : GetAsUnrestrictedDouble()
561 : {
562 : MOZ_ASSERT(IsUnrestrictedDouble(), "Wrong type!");
563 : return mValue.mUnrestrictedDouble.Value();
564 : }
565 :
566 : inline double
567 0 : GetAsUnrestrictedDouble() const
568 : {
569 0 : MOZ_ASSERT(IsUnrestrictedDouble(), "Wrong type!");
570 0 : return mValue.mUnrestrictedDouble.Value();
571 : }
572 :
573 : inline binding_detail::FastKeyframeEffectOptions&
574 0 : RawSetAsKeyframeEffectOptions()
575 : {
576 0 : if (mType == eKeyframeEffectOptions) {
577 0 : return mValue.mKeyframeEffectOptions.Value();
578 : }
579 0 : MOZ_ASSERT(mType == eUninitialized);
580 0 : mType = eKeyframeEffectOptions;
581 0 : return mValue.mKeyframeEffectOptions.SetValue();
582 : }
583 :
584 : inline binding_detail::FastKeyframeEffectOptions&
585 : SetAsKeyframeEffectOptions()
586 : {
587 : if (mType == eKeyframeEffectOptions) {
588 : return mValue.mKeyframeEffectOptions.Value();
589 : }
590 : Uninit();
591 : mType = eKeyframeEffectOptions;
592 : return mValue.mKeyframeEffectOptions.SetValue();
593 : }
594 :
595 : inline bool
596 0 : IsKeyframeEffectOptions() const
597 : {
598 0 : return mType == eKeyframeEffectOptions;
599 : }
600 :
601 : inline binding_detail::FastKeyframeEffectOptions&
602 : GetAsKeyframeEffectOptions()
603 : {
604 : MOZ_ASSERT(IsKeyframeEffectOptions(), "Wrong type!");
605 : return mValue.mKeyframeEffectOptions.Value();
606 : }
607 :
608 : inline const KeyframeEffectOptions&
609 0 : GetAsKeyframeEffectOptions() const
610 : {
611 0 : MOZ_ASSERT(IsKeyframeEffectOptions(), "Wrong type!");
612 0 : return mValue.mKeyframeEffectOptions.Value();
613 : }
614 :
615 : inline void
616 0 : Uninit()
617 : {
618 0 : switch (mType) {
619 : case eUninitialized: {
620 0 : break;
621 : }
622 : case eUnrestrictedDouble: {
623 0 : DestroyUnrestrictedDouble();
624 0 : break;
625 : }
626 : case eKeyframeEffectOptions: {
627 0 : DestroyKeyframeEffectOptions();
628 0 : break;
629 : }
630 : }
631 0 : }
632 :
633 : bool
634 : ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
635 :
636 : private:
637 : inline void
638 0 : DestroyUnrestrictedDouble()
639 : {
640 0 : MOZ_ASSERT(IsUnrestrictedDouble(), "Wrong type!");
641 0 : mValue.mUnrestrictedDouble.Destroy();
642 0 : mType = eUninitialized;
643 0 : }
644 :
645 : inline void
646 0 : DestroyKeyframeEffectOptions()
647 : {
648 0 : MOZ_ASSERT(IsKeyframeEffectOptions(), "Wrong type!");
649 0 : mValue.mKeyframeEffectOptions.Destroy();
650 0 : mType = eUninitialized;
651 0 : }
652 : };
653 :
654 :
655 : class OwningUnrestrictedDoubleOrKeyframeEffectOptions : public AllOwningUnionBase
656 : {
657 : friend void ImplCycleCollectionUnlink(OwningUnrestrictedDoubleOrKeyframeEffectOptions& aUnion);
658 : enum Type
659 : {
660 : eUninitialized,
661 : eUnrestrictedDouble,
662 : eKeyframeEffectOptions
663 : };
664 :
665 : union Value
666 : {
667 : UnionMember<double > mUnrestrictedDouble;
668 : UnionMember<KeyframeEffectOptions > mKeyframeEffectOptions;
669 :
670 : };
671 :
672 : Type mType;
673 : Value mValue;
674 :
675 : public:
676 : explicit inline OwningUnrestrictedDoubleOrKeyframeEffectOptions()
677 : : mType(eUninitialized)
678 : {
679 : }
680 :
681 : explicit inline OwningUnrestrictedDoubleOrKeyframeEffectOptions(const OwningUnrestrictedDoubleOrKeyframeEffectOptions& aOther)
682 : : mType(eUninitialized)
683 : {
684 : *this = aOther;
685 : }
686 :
687 : inline ~OwningUnrestrictedDoubleOrKeyframeEffectOptions()
688 : {
689 : Uninit();
690 : }
691 :
692 : double&
693 : RawSetAsUnrestrictedDouble();
694 :
695 : double&
696 : SetAsUnrestrictedDouble();
697 :
698 : bool
699 : TrySetToUnrestrictedDouble(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
700 :
701 : inline bool
702 0 : IsUnrestrictedDouble() const
703 : {
704 0 : return mType == eUnrestrictedDouble;
705 : }
706 :
707 : inline double&
708 : GetAsUnrestrictedDouble()
709 : {
710 : MOZ_ASSERT(IsUnrestrictedDouble(), "Wrong type!");
711 : return mValue.mUnrestrictedDouble.Value();
712 : }
713 :
714 : inline double const &
715 0 : GetAsUnrestrictedDouble() const
716 : {
717 0 : MOZ_ASSERT(IsUnrestrictedDouble(), "Wrong type!");
718 0 : return mValue.mUnrestrictedDouble.Value();
719 : }
720 :
721 : KeyframeEffectOptions&
722 : RawSetAsKeyframeEffectOptions();
723 :
724 : KeyframeEffectOptions&
725 : SetAsKeyframeEffectOptions();
726 :
727 : bool
728 : TrySetToKeyframeEffectOptions(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
729 :
730 : inline bool
731 0 : IsKeyframeEffectOptions() const
732 : {
733 0 : return mType == eKeyframeEffectOptions;
734 : }
735 :
736 : inline KeyframeEffectOptions&
737 : GetAsKeyframeEffectOptions()
738 : {
739 : MOZ_ASSERT(IsKeyframeEffectOptions(), "Wrong type!");
740 : return mValue.mKeyframeEffectOptions.Value();
741 : }
742 :
743 : inline KeyframeEffectOptions const &
744 0 : GetAsKeyframeEffectOptions() const
745 : {
746 0 : MOZ_ASSERT(IsKeyframeEffectOptions(), "Wrong type!");
747 0 : return mValue.mKeyframeEffectOptions.Value();
748 : }
749 :
750 : void
751 : Uninit();
752 :
753 : bool
754 : ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
755 :
756 : void
757 : TraceUnion(JSTracer* trc);
758 :
759 : OwningUnrestrictedDoubleOrKeyframeEffectOptions&
760 : operator=(const OwningUnrestrictedDoubleOrKeyframeEffectOptions& aOther);
761 :
762 : private:
763 : void
764 : DestroyUnrestrictedDouble();
765 :
766 : void
767 : DestroyKeyframeEffectOptions();
768 : };
769 :
770 :
771 : namespace KeyframeEffectBinding {
772 :
773 : typedef mozilla::dom::KeyframeEffect NativeType;
774 :
775 : bool
776 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
777 :
778 : JSObject*
779 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
780 :
781 : const JSClass*
782 : GetJSClass();
783 :
784 : bool
785 : Wrap(JSContext* aCx, mozilla::dom::KeyframeEffect* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
786 :
787 : template <class T>
788 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
789 : {
790 0 : JS::Rooted<JSObject*> reflector(aCx);
791 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
792 : }
793 :
794 : // We declare this as an array so that retrieving a pointer to this
795 : // binding's property hooks only requires compile/link-time resolvable
796 : // address arithmetic. Declaring it as a pointer instead would require
797 : // doing a run-time load to fetch a pointer to this binding's property
798 : // hooks. And then structures which embedded a pointer to this structure
799 : // would require a run-time load for proper initialization, which would
800 : // then induce static constructors. Lots of static constructors.
801 : extern const NativePropertyHooks sNativePropertyHooks[];
802 :
803 : void
804 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
805 :
806 : JS::Handle<JSObject*>
807 : GetProtoObjectHandle(JSContext* aCx);
808 :
809 : JS::Handle<JSObject*>
810 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
811 :
812 : JSObject*
813 : GetConstructorObject(JSContext* aCx);
814 :
815 : } // namespace KeyframeEffectBinding
816 :
817 :
818 :
819 : namespace KeyframeEffectReadOnlyBinding {
820 :
821 : typedef mozilla::dom::KeyframeEffectReadOnly NativeType;
822 :
823 : bool
824 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
825 :
826 : JSObject*
827 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
828 :
829 : const JSClass*
830 : GetJSClass();
831 :
832 : bool
833 : Wrap(JSContext* aCx, mozilla::dom::KeyframeEffectReadOnly* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
834 :
835 : template <class T>
836 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
837 : {
838 0 : JS::Rooted<JSObject*> reflector(aCx);
839 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
840 : }
841 :
842 : // We declare this as an array so that retrieving a pointer to this
843 : // binding's property hooks only requires compile/link-time resolvable
844 : // address arithmetic. Declaring it as a pointer instead would require
845 : // doing a run-time load to fetch a pointer to this binding's property
846 : // hooks. And then structures which embedded a pointer to this structure
847 : // would require a run-time load for proper initialization, which would
848 : // then induce static constructors. Lots of static constructors.
849 : extern const NativePropertyHooks sNativePropertyHooks[];
850 :
851 : void
852 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
853 :
854 : JS::Handle<JSObject*>
855 : GetProtoObjectHandle(JSContext* aCx);
856 :
857 : JSObject*
858 : GetProtoObject(JSContext* aCx);
859 :
860 : JS::Handle<JSObject*>
861 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
862 :
863 : JSObject*
864 : GetConstructorObject(JSContext* aCx);
865 :
866 : } // namespace KeyframeEffectReadOnlyBinding
867 :
868 :
869 :
870 : } // namespace dom
871 : } // namespace mozilla
872 :
873 : #endif // mozilla_dom_KeyframeEffectBinding_h
|