From 4f9502c418801dfb46d6c9466fd7adb609248b1d Mon Sep 17 00:00:00 2001 From: Ryo Motozawa Date: Mon, 15 Feb 2016 09:34:47 +0900 Subject: [PATCH] Bug 1211783 - Add KeyframeEffect interface to dom/webidl/KeyframeEffect.webidl. r=smaug,birtles --- dom/animation/KeyframeEffect.cpp | 7 +++++++ dom/animation/KeyframeEffect.h | 13 ++++++++++++ .../mochitest/general/test_interfaces.html | 2 ++ dom/webidl/KeyframeEffect.webidl | 20 ++++++++++++++++++- 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/dom/animation/KeyframeEffect.cpp b/dom/animation/KeyframeEffect.cpp index 79b0c2ecefa..82973c07c8c 100644 --- a/dom/animation/KeyframeEffect.cpp +++ b/dom/animation/KeyframeEffect.cpp @@ -2091,5 +2091,12 @@ KeyframeEffectReadOnly::ShouldBlockCompositorAnimations(const nsIFrame* return false; } +JSObject* +KeyframeEffect::WrapObject(JSContext* aCx, + JS::Handle aGivenProto) +{ + return KeyframeEffectBinding::Wrap(aCx, this, aGivenProto); +} + } // namespace dom } // namespace mozilla diff --git a/dom/animation/KeyframeEffect.h b/dom/animation/KeyframeEffect.h index 5a4a52b5f29..64a92b042a6 100644 --- a/dom/animation/KeyframeEffect.h +++ b/dom/animation/KeyframeEffect.h @@ -384,6 +384,19 @@ private: static const TimeDuration OverflowRegionRefreshInterval(); }; +class KeyframeEffect : public KeyframeEffectReadOnly +{ +public: + KeyframeEffect(nsIDocument* aDocument, + Element* aTarget, + nsCSSPseudoElements::Type aPseudoType, + const TimingParams& aTiming) + : KeyframeEffectReadOnly(aDocument, aTarget, aPseudoType, aTiming) { } + + JSObject* WrapObject(JSContext* aCx, + JS::Handle aGivenProto) override; +}; + } // namespace dom } // namespace mozilla diff --git a/dom/tests/mochitest/general/test_interfaces.html b/dom/tests/mochitest/general/test_interfaces.html index 2ea01c169ce..173f4a47d0c 100644 --- a/dom/tests/mochitest/general/test_interfaces.html +++ b/dom/tests/mochitest/general/test_interfaces.html @@ -727,6 +727,8 @@ var interfaceNamesInGlobalScope = "KeyboardEvent", // IMPORTANT: Do not change this list without review from a DOM peer! {name: "KeyframeEffectReadOnly", release: false}, +// IMPORTANT: Do not change this list without review from a DOM peer! + {name: "KeyframeEffect", release: false}, // IMPORTANT: Do not change this list without review from a DOM peer! "LocalMediaStream", // IMPORTANT: Do not change this list without review from a DOM peer! diff --git a/dom/webidl/KeyframeEffect.webidl b/dom/webidl/KeyframeEffect.webidl index 04786e46933..d17c400ac42 100644 --- a/dom/webidl/KeyframeEffect.webidl +++ b/dom/webidl/KeyframeEffect.webidl @@ -4,7 +4,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. * * The origin of this IDL file is - * http://w3c.github.io/web-animations/#the-keyframeeffect-interfaces + * https://w3c.github.io/web-animations/#the-keyframeeffect-interfaces * * Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. @@ -44,3 +44,21 @@ interface KeyframeEffectReadOnly : AnimationEffectReadOnly { // property-value pairs on the object. [Throws] sequence getFrames(); }; + + +// Bug 1211783 Implement KeyframeEffect constructor +// [Constructor (Animatable? target, +// object? frames, +// optional (unrestricted double or KeyframeEffectOptions) options)] +interface KeyframeEffect : KeyframeEffectReadOnly { + // Bug 1067769 - Allow setting KeyframeEffect.target + // inherit attribute Animatable? target; + // Bug 1216843 - implement animation composition + // inherit attribute IterationCompositeOperation iterationComposite; + // Bug 1216844 - implement additive animation + // inherit attribute CompositeOperation composite; + // Bug 1244590 - implement spacing modes + // inherit attribute DOMString spacing; + // Bug 1244591 - implement setFrames + // void setFrames (object? frames); +};