Bug 1067769 - Part 5: Support setting KeyframeEffect.target webidl interface. r=smaug draft
authorBoris Chiou <boris.chiou@gmail.com>
Thu, 28 Apr 2016 23:22:43 +0800
changeset 357391 4c8fa7bfb6502c78a96e1af1e2a6d98d7708d7dd
parent 357390 4cb041aea661f2355bd693e983e407f9df6838b5
child 357392 79b52ece67f16bd32ac8c07d698a9aae076fe5fe
push id16759
push userbchiou@mozilla.com
push dateThu, 28 Apr 2016 15:27:13 +0000
reviewerssmaug
bugs1067769
milestone49.0a1
Bug 1067769 - Part 5: Support setting KeyframeEffect.target webidl interface. r=smaug MozReview-Commit-ID: 9494jdI97MT
dom/animation/KeyframeEffect.cpp
dom/animation/KeyframeEffect.h
dom/webidl/KeyframeEffect.webidl
--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -1367,16 +1367,22 @@ void KeyframeEffect::NotifySpecifiedTimi
       presContext->EffectCompositor()->
         RequestRestyle(mTarget, mPseudoType,
                        EffectCompositor::RestyleType::Layer,
                        mAnimation->CascadeLevel());
     }
   }
 }
 
+void
+KeyframeEffect::SetTarget(const Nullable<ElementOrCSSPseudoElement>& aTarget)
+{
+  // TODO: fix in next patch
+}
+
 KeyframeEffect::~KeyframeEffect()
 {
   // mTiming is cycle collected, so we have to do null check first even though
   // mTiming shouldn't be null during the lifetime of KeyframeEffect.
   if (mTiming) {
     mTiming->Unlink();
   }
 }
--- a/dom/animation/KeyframeEffect.h
+++ b/dom/animation/KeyframeEffect.h
@@ -427,16 +427,18 @@ public:
   Constructor(const GlobalObject& aGlobal,
               const Nullable<ElementOrCSSPseudoElement>& aTarget,
               JS::Handle<JSObject*> aFrames,
               const UnrestrictedDoubleOrKeyframeAnimationOptions& aOptions,
               ErrorResult& aRv);
 
   void NotifySpecifiedTimingUpdated();
 
+  void SetTarget(const Nullable<ElementOrCSSPseudoElement>& aTarget);
+
 protected:
   ~KeyframeEffect() override;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_KeyframeEffect_h
--- a/dom/webidl/KeyframeEffect.webidl
+++ b/dom/webidl/KeyframeEffect.webidl
@@ -64,18 +64,17 @@ partial interface KeyframeEffectReadOnly
   [ChromeOnly, Throws] sequence<AnimationPropertyDetails> getProperties();
 };
 
 [Func="nsDocument::IsWebAnimationsEnabled",
  Constructor ((Element or CSSPseudoElement)? target,
               object? frames,
               optional (unrestricted double or KeyframeEffectOptions) options)]
 interface KeyframeEffect : KeyframeEffectReadOnly {
-  // Bug 1067769 - Allow setting KeyframeEffect.target
-  // inherit attribute Animatable?                 target;
+  inherit attribute (Element or CSSPseudoElement)? 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;
   [Throws]
   void setFrames (object? frames);