Bug 1154615 part 1 - Rename AnimationPlayer to Animation in WebIDL; r=smaug
authorBrian Birtles <birtles@gmail.com>
Tue, 21 Apr 2015 10:22:09 +0900
changeset 240074 d7428dd3f9488be4be939d09d27658326a18c573
parent 240073 737853697fe3c5aaee5879c26f3fdf43cbc6e08d
child 240075 12c02905de559b1b7bbeee20ceecdf2f7527469d
push id28621
push usercbook@mozilla.com
push dateTue, 21 Apr 2015 09:59:54 +0000
treeherdermozilla-central@ef3c6dd09234 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1154615
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1154615 part 1 - Rename AnimationPlayer to Animation in WebIDL; r=smaug This patch is a fairly minimal rename of the AnimationPlayer interface. It leaves a bunch of local variables and helper classes still using the word "player". These will be addressed in subsequent patches that don't require DOM peer review.
dom/animation/Animation.cpp
dom/animation/Animation.h
dom/animation/AnimationPlayer.cpp
dom/animation/AnimationPlayer.h
dom/animation/KeyframeEffect.cpp
dom/animation/KeyframeEffect.h
dom/animation/PendingPlayerTracker.cpp
dom/animation/PendingPlayerTracker.h
dom/animation/moz.build
dom/base/Element.cpp
dom/base/Element.h
dom/base/nsDOMMutationObserver.cpp
dom/base/nsDOMMutationObserver.h
dom/base/nsIAnimationObserver.h
dom/base/nsNodeUtils.cpp
dom/base/nsNodeUtils.h
dom/tests/mochitest/general/test_interfaces.html
dom/webidl/Animatable.webidl
dom/webidl/Animation.webidl
dom/webidl/AnimationPlayer.webidl
dom/webidl/AnimationTimeline.webidl
dom/webidl/MutationObserver.webidl
dom/webidl/moz.build
gfx/layers/Layers.cpp
gfx/layers/apz/src/AsyncPanZoomController.cpp
gfx/layers/apz/src/Axis.cpp
gfx/layers/apz/util/APZCCallbackHelper.cpp
gfx/layers/composite/AsyncCompositionManager.cpp
layout/base/nsDisplayList.cpp
layout/base/nsLayoutUtils.cpp
layout/style/AnimationCommon.cpp
layout/style/AnimationCommon.h
layout/style/nsAnimationManager.cpp
layout/style/nsAnimationManager.h
layout/style/nsTransitionManager.cpp
layout/style/nsTransitionManager.h
rename from dom/animation/AnimationPlayer.cpp
rename to dom/animation/Animation.cpp
--- a/dom/animation/AnimationPlayer.cpp
+++ b/dom/animation/Animation.cpp
@@ -1,44 +1,44 @@
 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "AnimationPlayer.h"
+#include "Animation.h"
 #include "AnimationUtils.h"
-#include "mozilla/dom/AnimationPlayerBinding.h"
+#include "mozilla/dom/AnimationBinding.h"
 #include "mozilla/AutoRestore.h"
 #include "AnimationCommon.h" // For AnimationPlayerCollection,
                              // CommonAnimationManager
 #include "nsIDocument.h" // For nsIDocument
 #include "nsIPresShell.h" // For nsIPresShell
 #include "nsLayoutUtils.h" // For PostRestyleEvent (remove after bug 1073336)
 #include "PendingPlayerTracker.h" // For PendingPlayerTracker
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(AnimationPlayer, mTimeline,
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Animation, mTimeline,
                                       mEffect, mReady, mFinished)
-NS_IMPL_CYCLE_COLLECTING_ADDREF(AnimationPlayer)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(AnimationPlayer)
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AnimationPlayer)
+NS_IMPL_CYCLE_COLLECTING_ADDREF(Animation)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(Animation)
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Animation)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 JSObject*
-AnimationPlayer::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
+Animation::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return dom::AnimationPlayerBinding::Wrap(aCx, this, aGivenProto);
+  return dom::AnimationBinding::Wrap(aCx, this, aGivenProto);
 }
 
 void
-AnimationPlayer::SetStartTime(const Nullable<TimeDuration>& aNewStartTime)
+Animation::SetStartTime(const Nullable<TimeDuration>& aNewStartTime)
 {
 #if 1
   // Bug 1096776: once we support inactive/missing timelines we'll want to take
   // the disabled branch.
   MOZ_ASSERT(mTimeline && !mTimeline->GetCurrentTime().IsNull(),
              "We don't support inactive/missing timelines yet");
 #else
   Nullable<TimeDuration> timelineTime = mTimeline->GetCurrentTime();
@@ -69,17 +69,17 @@ AnimationPlayer::SetStartTime(const Null
     mReady->MaybeResolve(this);
   }
 
   UpdateTiming();
   PostUpdate();
 }
 
 Nullable<TimeDuration>
-AnimationPlayer::GetCurrentTime() const
+Animation::GetCurrentTime() const
 {
   Nullable<TimeDuration> result;
   if (!mHoldTime.IsNull()) {
     result = mHoldTime;
     return result;
   }
 
   if (!mStartTime.IsNull()) {
@@ -89,17 +89,17 @@ AnimationPlayer::GetCurrentTime() const
                         .MultDouble(mPlaybackRate));
     }
   }
   return result;
 }
 
 // Implements http://w3c.github.io/web-animations/#silently-set-the-current-time
 void
-AnimationPlayer::SilentlySetCurrentTime(const TimeDuration& aSeekTime)
+Animation::SilentlySetCurrentTime(const TimeDuration& aSeekTime)
 {
   if (!mHoldTime.IsNull() ||
       !mTimeline ||
       mTimeline->GetCurrentTime().IsNull() ||
       mPlaybackRate == 0.0
       /*or, once supported, if we have a pending pause task*/) {
     mHoldTime.SetValue(aSeekTime);
     if (!mTimeline || mTimeline->GetCurrentTime().IsNull()) {
@@ -110,58 +110,58 @@ AnimationPlayer::SilentlySetCurrentTime(
                           (aSeekTime.MultDouble(1 / mPlaybackRate)));
   }
 
   mPreviousCurrentTime.SetNull();
 }
 
 // Implements http://w3c.github.io/web-animations/#set-the-current-time
 void
-AnimationPlayer::SetCurrentTime(const TimeDuration& aSeekTime)
+Animation::SetCurrentTime(const TimeDuration& aSeekTime)
 {
   SilentlySetCurrentTime(aSeekTime);
 
   if (mPendingState == PendingState::PausePending) {
     CancelPendingTasks();
     if (mReady) {
       mReady->MaybeResolve(this);
     }
   }
 
   UpdateFinishedState(true);
   UpdateEffect();
   PostUpdate();
 }
 
 void
-AnimationPlayer::SetPlaybackRate(double aPlaybackRate)
+Animation::SetPlaybackRate(double aPlaybackRate)
 {
   Nullable<TimeDuration> previousTime = GetCurrentTime();
   mPlaybackRate = aPlaybackRate;
   if (!previousTime.IsNull()) {
     ErrorResult rv;
     SetCurrentTime(previousTime.Value());
     MOZ_ASSERT(!rv.Failed(), "Should not assert for non-null time");
   }
 }
 
 void
-AnimationPlayer::SilentlySetPlaybackRate(double aPlaybackRate)
+Animation::SilentlySetPlaybackRate(double aPlaybackRate)
 {
   Nullable<TimeDuration> previousTime = GetCurrentTime();
   mPlaybackRate = aPlaybackRate;
   if (!previousTime.IsNull()) {
     ErrorResult rv;
     SilentlySetCurrentTime(previousTime.Value());
     MOZ_ASSERT(!rv.Failed(), "Should not assert for non-null time");
   }
 }
 
 AnimationPlayState
-AnimationPlayer::PlayState() const
+Animation::PlayState() const
 {
   if (mPendingState != PendingState::NotPending) {
     return AnimationPlayState::Pending;
   }
 
   Nullable<TimeDuration> currentTime = GetCurrentTime();
   if (currentTime.IsNull()) {
     return AnimationPlayState::Idle;
@@ -185,106 +185,106 @@ CreatePromise(DocumentTimeline* aTimelin
   nsIGlobalObject* global = aTimeline->GetParentObject();
   if (global) {
     return Promise::Create(global, aRv);
   }
   return nullptr;
 }
 
 Promise*
-AnimationPlayer::GetReady(ErrorResult& aRv)
+Animation::GetReady(ErrorResult& aRv)
 {
   if (!mReady) {
     mReady = CreatePromise(mTimeline, aRv); // Lazily create on demand
   }
   if (!mReady) {
     aRv.Throw(NS_ERROR_FAILURE);
   } else if (PlayState() != AnimationPlayState::Pending) {
     mReady->MaybeResolve(this);
   }
   return mReady;
 }
 
 Promise*
-AnimationPlayer::GetFinished(ErrorResult& aRv)
+Animation::GetFinished(ErrorResult& aRv)
 {
   if (!mFinished) {
     mFinished = CreatePromise(mTimeline, aRv); // Lazily create on demand
   }
   if (!mFinished) {
     aRv.Throw(NS_ERROR_FAILURE);
   } else if (IsFinished()) {
     mFinished->MaybeResolve(this);
   }
   return mFinished;
 }
 
 void
-AnimationPlayer::Play(LimitBehavior aLimitBehavior)
+Animation::Play(LimitBehavior aLimitBehavior)
 {
   DoPlay(aLimitBehavior);
   PostUpdate();
 }
 
 void
-AnimationPlayer::Pause()
+Animation::Pause()
 {
   // TODO: The DoPause() call should not be synchronous (bug 1109390). See
   // http://w3c.github.io/web-animations/#pausing-an-animation-section
   DoPause();
   PostUpdate();
 }
 
 Nullable<double>
-AnimationPlayer::GetStartTimeAsDouble() const
+Animation::GetStartTimeAsDouble() const
 {
   return AnimationUtils::TimeDurationToDouble(mStartTime);
 }
 
 void
-AnimationPlayer::SetStartTimeAsDouble(const Nullable<double>& aStartTime)
+Animation::SetStartTimeAsDouble(const Nullable<double>& aStartTime)
 {
   return SetStartTime(AnimationUtils::DoubleToTimeDuration(aStartTime));
 }
-  
+
 Nullable<double>
-AnimationPlayer::GetCurrentTimeAsDouble() const
+Animation::GetCurrentTimeAsDouble() const
 {
   return AnimationUtils::TimeDurationToDouble(GetCurrentTime());
 }
 
 void
-AnimationPlayer::SetCurrentTimeAsDouble(const Nullable<double>& aCurrentTime,
+Animation::SetCurrentTimeAsDouble(const Nullable<double>& aCurrentTime,
                                         ErrorResult& aRv)
 {
   if (aCurrentTime.IsNull()) {
     if (!GetCurrentTime().IsNull()) {
       aRv.Throw(NS_ERROR_DOM_TYPE_ERR);
     }
     return;
   }
 
   return SetCurrentTime(TimeDuration::FromMilliseconds(aCurrentTime.Value()));
 }
 
 void
-AnimationPlayer::SetEffect(KeyframeEffectReadonly* aEffect)
+Animation::SetEffect(KeyframeEffectReadonly* aEffect)
 {
   if (mEffect) {
     mEffect->SetParentTime(Nullable<TimeDuration>());
   }
   mEffect = aEffect;
   if (mEffect) {
     mEffect->SetParentTime(GetCurrentTime());
   }
   UpdateRelevance();
 }
 
 void
-AnimationPlayer::Tick()
+Animation::Tick()
 {
   // Since we are not guaranteed to get only one call per refresh driver tick,
   // it's possible that mPendingReadyTime is set to a time in the future.
   // In that case, we should wait until the next refresh driver tick before
   // resuming.
   if (mPendingState != PendingState::NotPending &&
       !mPendingReadyTime.IsNull() &&
       mPendingReadyTime.Value() <= mTimeline->GetCurrentTime().Value()) {
@@ -297,43 +297,43 @@ AnimationPlayer::Tick()
                "Orphaned pending players should have an active timeline");
     FinishPendingAt(mTimeline->GetCurrentTime().Value());
   }
 
   UpdateTiming();
 }
 
 void
-AnimationPlayer::TriggerOnNextTick(const Nullable<TimeDuration>& aReadyTime)
+Animation::TriggerOnNextTick(const Nullable<TimeDuration>& aReadyTime)
 {
   // Normally we expect the play state to be pending but it's possible that,
   // due to the handling of possibly orphaned players in Tick(), this player got
   // started whilst still being in another document's pending player map.
   if (PlayState() != AnimationPlayState::Pending) {
     return;
   }
 
   // If aReadyTime.IsNull() we'll detect this in Tick() where we check for
   // orphaned players and trigger this animation anyway
   mPendingReadyTime = aReadyTime;
 }
 
 void
-AnimationPlayer::TriggerNow()
+Animation::TriggerNow()
 {
   MOZ_ASSERT(PlayState() == AnimationPlayState::Pending,
              "Expected to start a pending player");
   MOZ_ASSERT(mTimeline && !mTimeline->GetCurrentTime().IsNull(),
              "Expected an active timeline");
 
   FinishPendingAt(mTimeline->GetCurrentTime().Value());
 }
 
 Nullable<TimeDuration>
-AnimationPlayer::GetCurrentOrPendingStartTime() const
+Animation::GetCurrentOrPendingStartTime() const
 {
   Nullable<TimeDuration> result;
 
   if (!mStartTime.IsNull()) {
     result = mStartTime;
     return result;
   }
 
@@ -344,17 +344,17 @@ AnimationPlayer::GetCurrentOrPendingStar
   // Calculate the equivalent start time from the pending ready time.
   // This is the same as the calculation performed in ResumeAt and will
   // need to incorporate the playbackRate when implemented (bug 1127380).
   result.SetValue(mPendingReadyTime.Value() - mHoldTime.Value());
   return result;
 }
 
 void
-AnimationPlayer::Cancel()
+Animation::Cancel()
 {
   if (mPendingState != PendingState::NotPending) {
     CancelPendingTasks();
     if (mReady) {
       mReady->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
     }
   }
 
@@ -366,31 +366,31 @@ AnimationPlayer::Cancel()
 
   mHoldTime.SetNull();
   mStartTime.SetNull();
 
   UpdateEffect();
 }
 
 void
-AnimationPlayer::UpdateRelevance()
+Animation::UpdateRelevance()
 {
   bool wasRelevant = mIsRelevant;
   mIsRelevant = HasCurrentEffect() || IsInEffect();
 
   // Notify animation observers.
   if (wasRelevant && !mIsRelevant) {
     nsNodeUtils::AnimationRemoved(this);
   } else if (!wasRelevant && mIsRelevant) {
     nsNodeUtils::AnimationAdded(this);
   }
 }
 
 bool
-AnimationPlayer::CanThrottle() const
+Animation::CanThrottle() const
 {
   if (!mEffect ||
       mEffect->IsFinishedTransition() ||
       mEffect->Properties().IsEmpty()) {
     return true;
   }
 
   if (!mIsRunningOnCompositor) {
@@ -405,19 +405,19 @@ AnimationPlayer::CanThrottle() const
   // The animation has finished but, if this is the first sample since
   // finishing, we need an unthrottled sample so we can apply the correct
   // end-of-animation behavior on the main thread (either removing the
   // animation style or applying the fill mode).
   return mFinishedAtLastComposeStyle;
 }
 
 void
-AnimationPlayer::ComposeStyle(nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
-                              nsCSSPropertySet& aSetProperties,
-                              bool& aNeedsRefreshes)
+Animation::ComposeStyle(nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
+                        nsCSSPropertySet& aSetProperties,
+                        bool& aNeedsRefreshes)
 {
   if (!mEffect || mEffect->IsFinishedTransition()) {
     return;
   }
 
   AnimationPlayState playState = PlayState();
   if (playState == AnimationPlayState::Running ||
       playState == AnimationPlayState::Pending) {
@@ -488,17 +488,17 @@ AnimationPlayer::ComposeStyle(nsRefPtr<c
       UpdateTiming();
     }
 
     mFinishedAtLastComposeStyle = (playState == AnimationPlayState::Finished);
   }
 }
 
 void
-AnimationPlayer::DoPlay(LimitBehavior aLimitBehavior)
+Animation::DoPlay(LimitBehavior aLimitBehavior)
 {
   bool abortedPause = mPendingState == PendingState::PausePending;
 
   bool reuseReadyPromise = false;
   if (mPendingState != PendingState::NotPending) {
     CancelPendingTasks();
     reuseReadyPromise = true;
   }
@@ -551,17 +551,17 @@ AnimationPlayer::DoPlay(LimitBehavior aL
   PendingPlayerTracker* tracker = doc->GetOrCreatePendingPlayerTracker();
   tracker->AddPlayPending(*this);
 
   // We may have updated the current time when we set the hold time above.
   UpdateTiming();
 }
 
 void
-AnimationPlayer::DoPause()
+Animation::DoPause()
 {
   if (IsPausedOrPausing()) {
     return;
   }
 
   bool reuseReadyPromise = false;
   if (mPendingState == PendingState::PlayPending) {
     CancelPendingTasks();
@@ -588,17 +588,17 @@ AnimationPlayer::DoPause()
 
   PendingPlayerTracker* tracker = doc->GetOrCreatePendingPlayerTracker();
   tracker->AddPausePending(*this);
 
   UpdateFinishedState();
 }
 
 void
-AnimationPlayer::ResumeAt(const TimeDuration& aReadyTime)
+Animation::ResumeAt(const TimeDuration& aReadyTime)
 {
   // This method is only expected to be called for a player that is
   // waiting to play. We can easily adapt it to handle other states
   // but it's currently not necessary.
   MOZ_ASSERT(mPendingState == PendingState::PlayPending,
              "Expected to resume a play-pending player");
   MOZ_ASSERT(mHoldTime.IsNull() != mStartTime.IsNull(),
              "A player in the play-pending state should have either a"
@@ -620,17 +620,17 @@ AnimationPlayer::ResumeAt(const TimeDura
   UpdateTiming();
 
   if (mReady) {
     mReady->MaybeResolve(this);
   }
 }
 
 void
-AnimationPlayer::PauseAt(const TimeDuration& aReadyTime)
+Animation::PauseAt(const TimeDuration& aReadyTime)
 {
   MOZ_ASSERT(mPendingState == PendingState::PausePending,
              "Expected to pause a pause-pending player");
 
   if (!mStartTime.IsNull()) {
     mHoldTime.SetValue((aReadyTime - mStartTime.Value())
                         .MultDouble(mPlaybackRate));
   }
@@ -640,26 +640,26 @@ AnimationPlayer::PauseAt(const TimeDurat
   UpdateTiming();
 
   if (mReady) {
     mReady->MaybeResolve(this);
   }
 }
 
 void
-AnimationPlayer::UpdateTiming()
+Animation::UpdateTiming()
 {
   // We call UpdateFinishedState before UpdateEffect because the former
   // can change the current time, which is used by the latter.
   UpdateFinishedState();
   UpdateEffect();
 }
 
 void
-AnimationPlayer::UpdateFinishedState(bool aSeekFlag)
+Animation::UpdateFinishedState(bool aSeekFlag)
 {
   Nullable<TimeDuration> currentTime = GetCurrentTime();
   TimeDuration effectEnd = TimeDuration(EffectEnd());
 
   if (!mStartTime.IsNull() &&
       mPendingState == PendingState::NotPending) {
     if (mPlaybackRate > 0.0 &&
         !currentTime.IsNull() &&
@@ -703,44 +703,44 @@ AnimationPlayer::UpdateFinishedState(boo
   }
   mIsPreviousStateFinished = currentFinishedState;
   // We must recalculate the current time to take account of any mHoldTime
   // changes the code above made.
   mPreviousCurrentTime = GetCurrentTime();
 }
 
 void
-AnimationPlayer::UpdateEffect()
+Animation::UpdateEffect()
 {
   if (mEffect) {
     mEffect->SetParentTime(GetCurrentTime());
     UpdateRelevance();
   }
 }
 
 void
-AnimationPlayer::FlushStyle() const
+Animation::FlushStyle() const
 {
   nsIDocument* doc = GetRenderedDocument();
   if (doc) {
     doc->FlushPendingNotifications(Flush_Style);
   }
 }
 
 void
-AnimationPlayer::PostUpdate()
+Animation::PostUpdate()
 {
   AnimationPlayerCollection* collection = GetCollection();
   if (collection) {
     collection->NotifyPlayerUpdated();
   }
 }
 
 void
-AnimationPlayer::CancelPendingTasks()
+Animation::CancelPendingTasks()
 {
   if (mPendingState == PendingState::NotPending) {
     return;
   }
 
   nsIDocument* doc = GetRenderedDocument();
   if (doc) {
     PendingPlayerTracker* tracker = doc->GetPendingPlayerTracker();
@@ -753,30 +753,30 @@ AnimationPlayer::CancelPendingTasks()
     }
   }
 
   mPendingState = PendingState::NotPending;
   mPendingReadyTime.SetNull();
 }
 
 bool
-AnimationPlayer::IsFinished() const
+Animation::IsFinished() const
 {
   // Unfortunately there's some weirdness in the spec at the moment where if
   // you're finished and paused, the playState is paused. This prevents us
   // from just checking |PlayState() == AnimationPlayState::Finished| here,
   // and we need this much more messy check to see if we're finished.
   Nullable<TimeDuration> currentTime = GetCurrentTime();
   return !currentTime.IsNull() &&
       ((mPlaybackRate > 0.0 && currentTime.Value() >= EffectEnd()) ||
        (mPlaybackRate < 0.0 && currentTime.Value().ToMilliseconds() <= 0.0));
 }
 
 bool
-AnimationPlayer::IsPossiblyOrphanedPendingPlayer() const
+Animation::IsPossiblyOrphanedPendingPlayer() const
 {
   // Check if we are pending but might never start because we are not being
   // tracked.
   //
   // This covers the following cases:
   //
   // * We started playing but our effect's target element was orphaned
   //   or bound to a different document.
@@ -820,59 +820,59 @@ AnimationPlayer::IsPossiblyOrphanedPendi
 
   PendingPlayerTracker* tracker = doc->GetPendingPlayerTracker();
   return !tracker ||
          (!tracker->IsWaitingToPlay(*this) &&
           !tracker->IsWaitingToPause(*this));
 }
 
 StickyTimeDuration
-AnimationPlayer::EffectEnd() const
+Animation::EffectEnd() const
 {
   if (!mEffect) {
     return StickyTimeDuration(0);
   }
 
   return mEffect->Timing().mDelay
          + mEffect->GetComputedTiming().mActiveDuration;
 }
 
 nsIDocument*
-AnimationPlayer::GetRenderedDocument() const
+Animation::GetRenderedDocument() const
 {
   if (!mEffect) {
     return nullptr;
   }
 
   Element* targetElement;
   nsCSSPseudoElements::Type pseudoType;
   mEffect->GetTarget(targetElement, pseudoType);
   if (!targetElement) {
     return nullptr;
   }
 
   return targetElement->GetComposedDoc();
 }
 
 nsPresContext*
-AnimationPlayer::GetPresContext() const
+Animation::GetPresContext() const
 {
   nsIDocument* doc = GetRenderedDocument();
   if (!doc) {
     return nullptr;
   }
   nsIPresShell* shell = doc->GetShell();
   if (!shell) {
     return nullptr;
   }
   return shell->GetPresContext();
 }
 
 AnimationPlayerCollection*
-AnimationPlayer::GetCollection() const
+Animation::GetCollection() const
 {
   css::CommonAnimationManager* manager = GetAnimationManager();
   if (!manager) {
     return nullptr;
   }
   MOZ_ASSERT(mEffect, "A player with an animation manager must have an effect");
 
   Element* targetElement;
rename from dom/animation/AnimationPlayer.h
rename to dom/animation/Animation.h
--- a/dom/animation/AnimationPlayer.h
+++ b/dom/animation/Animation.h
@@ -1,21 +1,21 @@
 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef mozilla_dom_AnimationPlayer_h
-#define mozilla_dom_AnimationPlayer_h
+#ifndef mozilla_dom_Animation_h
+#define mozilla_dom_Animation_h
 
 #include "nsWrapperCache.h"
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/TimeStamp.h" // for TimeStamp, TimeDuration
-#include "mozilla/dom/AnimationPlayerBinding.h" // for AnimationPlayState
+#include "mozilla/dom/AnimationBinding.h" // for AnimationPlayState
 #include "mozilla/dom/DocumentTimeline.h" // for DocumentTimeline
 #include "mozilla/dom/KeyframeEffect.h" // for KeyframeEffectReadonly
 #include "mozilla/dom/Promise.h" // for Promise
 #include "nsCSSProperty.h" // for nsCSSProperty
 
 // X11 has a #define for CurrentTime.
 #ifdef CurrentTime
 #undef CurrentTime
@@ -39,52 +39,53 @@ class AnimValuesStyleRule;
 class CommonAnimationManager;
 } // namespace css
 
 class CSSAnimationPlayer;
 class CSSTransitionPlayer;
 
 namespace dom {
 
-class AnimationPlayer : public nsISupports,
-                        public nsWrapperCache
+class Animation
+  : public nsISupports
+  , public nsWrapperCache
 {
 protected:
-  virtual ~AnimationPlayer() {}
+  virtual ~Animation() {}
 
 public:
-  explicit AnimationPlayer(DocumentTimeline* aTimeline)
+  explicit Animation(DocumentTimeline* aTimeline)
     : mTimeline(aTimeline)
     , mPlaybackRate(1.0)
     , mPendingState(PendingState::NotPending)
     , mIsRunningOnCompositor(false)
     , mIsPreviousStateFinished(false)
     , mFinishedAtLastComposeStyle(false)
     , mIsRelevant(false)
   {
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AnimationPlayer)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Animation)
 
   DocumentTimeline* GetParentObject() const { return mTimeline; }
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
 
   virtual CSSAnimationPlayer* AsCSSAnimationPlayer() { return nullptr; }
   virtual CSSTransitionPlayer* AsCSSTransitionPlayer() { return nullptr; }
 
   // Flag to pass to DoPlay to indicate that it should not carry out finishing
   // behavior (reset the current time to the beginning of the active duration).
   enum LimitBehavior {
     AutoRewind = 0,
     Continue = 1
   };
 
-  // AnimationPlayer methods
+  // Animation methods
   KeyframeEffectReadonly* GetEffect() const { return mEffect; }
   DocumentTimeline* Timeline() const { return mTimeline; }
   Nullable<TimeDuration> GetStartTime() const { return mStartTime; }
   void SetStartTime(const Nullable<TimeDuration>& aNewStartTime);
   Nullable<TimeDuration> GetCurrentTime() const;
   void SilentlySetCurrentTime(const TimeDuration& aNewCurrentTime);
   void SetCurrentTime(const TimeDuration& aNewCurrentTime);
   double PlaybackRate() const { return mPlaybackRate; }
@@ -92,17 +93,17 @@ public:
   void SilentlySetPlaybackRate(double aPlaybackRate);
   AnimationPlayState PlayState() const;
   virtual Promise* GetReady(ErrorResult& aRv);
   virtual Promise* GetFinished(ErrorResult& aRv);
   virtual void Play(LimitBehavior aLimitBehavior);
   virtual void Pause();
   bool IsRunningOnCompositor() const { return mIsRunningOnCompositor; }
 
-  // Wrapper functions for AnimationPlayer DOM methods when called
+  // Wrapper functions for Animation DOM methods when called
   // from script. We often use the same methods internally and from
   // script but when called from script we (or one of our subclasses) perform
   // extra steps such as flushing style or converting the return type.
   Nullable<double> GetStartTimeAsDouble() const;
   void SetStartTimeAsDouble(const Nullable<double>& aStartTime);
   Nullable<double> GetCurrentTimeAsDouble() const;
   void SetCurrentTimeAsDouble(const Nullable<double>& aCurrentTime,
                               ErrorResult& aRv);
@@ -341,9 +342,9 @@ protected:
   // Indicates that the animation should be exposed in an element's
   // getAnimations() list.
   bool mIsRelevant;
 };
 
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_AnimationPlayer_h
+#endif // mozilla_dom_Animation_h
--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -229,29 +229,29 @@ KeyframeEffectReadonly::ActiveDuration(c
            : StickyTimeDuration::Forever();
   }
   return StickyTimeDuration(
     aTiming.mIterationDuration.MultDouble(aTiming.mIterationCount));
 }
 
 // http://w3c.github.io/web-animations/#in-play
 bool
-KeyframeEffectReadonly::IsInPlay(const AnimationPlayer& aPlayer) const
+KeyframeEffectReadonly::IsInPlay(const Animation& aPlayer) const
 {
   if (IsFinishedTransition() ||
       aPlayer.PlayState() == AnimationPlayState::Finished) {
     return false;
   }
 
   return GetComputedTiming().mPhase == ComputedTiming::AnimationPhase_Active;
 }
 
 // http://w3c.github.io/web-animations/#current
 bool
-KeyframeEffectReadonly::IsCurrent(const AnimationPlayer& aPlayer) const
+KeyframeEffectReadonly::IsCurrent(const Animation& aPlayer) const
 {
   if (IsFinishedTransition() ||
       aPlayer.PlayState() == AnimationPlayState::Finished) {
     return false;
   }
 
   ComputedTiming computedTiming = GetComputedTiming();
   return computedTiming.mPhase == ComputedTiming::AnimationPhase_Before ||
--- a/dom/animation/KeyframeEffect.h
+++ b/dom/animation/KeyframeEffect.h
@@ -301,18 +301,18 @@ public:
   }
 
   void SetIsFinishedTransition(bool aIsFinished) {
     MOZ_ASSERT(AsTransition(),
                "Calling SetIsFinishedTransition but it's not a transition");
     mIsFinishedTransition = aIsFinished;
   }
 
-  bool IsInPlay(const AnimationPlayer& aPlayer) const;
-  bool IsCurrent(const AnimationPlayer& aPlayer) const;
+  bool IsInPlay(const Animation& aPlayer) const;
+  bool IsCurrent(const Animation& aPlayer) const;
   bool IsInEffect() const;
 
   const AnimationProperty*
   GetAnimationOfProperty(nsCSSProperty aProperty) const;
   bool HasAnimationOfProperty(nsCSSProperty aProperty) const {
     return GetAnimationOfProperty(aProperty) != nullptr;
   }
   bool HasAnimationOfProperties(const nsCSSProperty* aProperties,
--- a/dom/animation/PendingPlayerTracker.cpp
+++ b/dom/animation/PendingPlayerTracker.cpp
@@ -17,46 +17,46 @@ NS_IMPL_CYCLE_COLLECTION(PendingPlayerTr
                          mPlayPendingSet,
                          mPausePendingSet,
                          mDocument)
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(PendingPlayerTracker, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(PendingPlayerTracker, Release)
 
 void
-PendingPlayerTracker::AddPending(dom::AnimationPlayer& aPlayer,
+PendingPlayerTracker::AddPending(dom::Animation& aPlayer,
                                  AnimationPlayerSet& aSet)
 {
   aSet.PutEntry(&aPlayer);
 
   // Schedule a paint. Otherwise animations that don't trigger a paint by
   // themselves (e.g. CSS animations with an empty keyframes rule) won't
   // start until something else paints.
   EnsurePaintIsScheduled();
 }
 
 void
-PendingPlayerTracker::RemovePending(dom::AnimationPlayer& aPlayer,
+PendingPlayerTracker::RemovePending(dom::Animation& aPlayer,
                                     AnimationPlayerSet& aSet)
 {
   aSet.RemoveEntry(&aPlayer);
 }
 
 bool
-PendingPlayerTracker::IsWaiting(const dom::AnimationPlayer& aPlayer,
+PendingPlayerTracker::IsWaiting(const dom::Animation& aPlayer,
                                 const AnimationPlayerSet& aSet) const
 {
-  return aSet.Contains(const_cast<dom::AnimationPlayer*>(&aPlayer));
+  return aSet.Contains(const_cast<dom::Animation*>(&aPlayer));
 }
 
 PLDHashOperator
-TriggerPlayerAtTime(nsRefPtrHashKey<dom::AnimationPlayer>* aKey,
+TriggerPlayerAtTime(nsRefPtrHashKey<dom::Animation>* aKey,
                     void* aReadyTime)
 {
-  dom::AnimationPlayer* player = aKey->GetKey();
+  dom::Animation* player = aKey->GetKey();
   dom::DocumentTimeline* timeline = player->Timeline();
 
   // When the timeline's refresh driver is under test control, its values
   // have no correspondance to wallclock times so we shouldn't try to convert
   // aReadyTime (which is a wallclock time) to a timeline value. Instead, the
   // animation player will be started/paused when the refresh driver is next
   // advanced since this will trigger a call to TriggerPendingPlayersNow.
   if (timeline->IsUnderTestControl()) {
@@ -76,17 +76,17 @@ PendingPlayerTracker::TriggerPendingPlay
 {
   mPlayPendingSet.EnumerateEntries(TriggerPlayerAtTime,
                                    const_cast<TimeStamp*>(&aReadyTime));
   mPausePendingSet.EnumerateEntries(TriggerPlayerAtTime,
                                     const_cast<TimeStamp*>(&aReadyTime));
 }
 
 PLDHashOperator
-TriggerPlayerNow(nsRefPtrHashKey<dom::AnimationPlayer>* aKey, void*)
+TriggerPlayerNow(nsRefPtrHashKey<dom::Animation>* aKey, void*)
 {
   aKey->GetKey()->TriggerNow();
   return PL_DHASH_NEXT;
 }
 
 void
 PendingPlayerTracker::TriggerPendingPlayersNow()
 {
--- a/dom/animation/PendingPlayerTracker.h
+++ b/dom/animation/PendingPlayerTracker.h
@@ -1,17 +1,17 @@
 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_PendingPlayerTracker_h
 #define mozilla_dom_PendingPlayerTracker_h
 
-#include "mozilla/dom/AnimationPlayer.h"
+#include "mozilla/dom/Animation.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIDocument.h"
 #include "nsTHashtable.h"
 
 class nsIFrame;
 
 namespace mozilla {
 
@@ -20,65 +20,65 @@ class PendingPlayerTracker final
 public:
   explicit PendingPlayerTracker(nsIDocument* aDocument)
     : mDocument(aDocument)
   { }
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(PendingPlayerTracker)
   NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(PendingPlayerTracker)
 
-  void AddPlayPending(dom::AnimationPlayer& aPlayer)
+  void AddPlayPending(dom::Animation& aPlayer)
   {
     MOZ_ASSERT(!IsWaitingToPause(aPlayer),
                "Player is already waiting to pause");
     AddPending(aPlayer, mPlayPendingSet);
   }
-  void RemovePlayPending(dom::AnimationPlayer& aPlayer)
+  void RemovePlayPending(dom::Animation& aPlayer)
   {
     RemovePending(aPlayer, mPlayPendingSet);
   }
-  bool IsWaitingToPlay(const dom::AnimationPlayer& aPlayer) const
+  bool IsWaitingToPlay(const dom::Animation& aPlayer) const
   {
     return IsWaiting(aPlayer, mPlayPendingSet);
   }
 
-  void AddPausePending(dom::AnimationPlayer& aPlayer)
+  void AddPausePending(dom::Animation& aPlayer)
   {
     MOZ_ASSERT(!IsWaitingToPlay(aPlayer),
                "Player is already waiting to play");
     AddPending(aPlayer, mPausePendingSet);
   }
-  void RemovePausePending(dom::AnimationPlayer& aPlayer)
+  void RemovePausePending(dom::Animation& aPlayer)
   {
     RemovePending(aPlayer, mPausePendingSet);
   }
-  bool IsWaitingToPause(const dom::AnimationPlayer& aPlayer) const
+  bool IsWaitingToPause(const dom::Animation& aPlayer) const
   {
     return IsWaiting(aPlayer, mPausePendingSet);
   }
 
   void TriggerPendingPlayersOnNextTick(const TimeStamp& aReadyTime);
   void TriggerPendingPlayersNow();
   bool HasPendingPlayers() const {
     return mPlayPendingSet.Count() > 0 || mPausePendingSet.Count() > 0;
   }
 
 private:
   ~PendingPlayerTracker() { }
 
   void EnsurePaintIsScheduled();
 
-  typedef nsTHashtable<nsRefPtrHashKey<dom::AnimationPlayer>>
+  typedef nsTHashtable<nsRefPtrHashKey<dom::Animation>>
     AnimationPlayerSet;
 
-  void AddPending(dom::AnimationPlayer& aPlayer,
+  void AddPending(dom::Animation& aPlayer,
                   AnimationPlayerSet& aSet);
-  void RemovePending(dom::AnimationPlayer& aPlayer,
+  void RemovePending(dom::Animation& aPlayer,
                      AnimationPlayerSet& aSet);
-  bool IsWaiting(const dom::AnimationPlayer& aPlayer,
+  bool IsWaiting(const dom::Animation& aPlayer,
                  const AnimationPlayerSet& aSet) const;
 
   AnimationPlayerSet mPlayPendingSet;
   AnimationPlayerSet mPausePendingSet;
   nsCOMPtr<nsIDocument> mDocument;
 };
 
 } // namespace mozilla
--- a/dom/animation/moz.build
+++ b/dom/animation/moz.build
@@ -3,31 +3,31 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MOCHITEST_MANIFESTS += ['test/mochitest.ini']
 MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
 
 EXPORTS.mozilla.dom += [
+    'Animation.h',
     'AnimationEffectReadonly.h',
-    'AnimationPlayer.h',
     'AnimationTimeline.h',
     'DocumentTimeline.h',
     'KeyframeEffect.h',
 ]
 
 EXPORTS.mozilla += [
     'AnimationUtils.h',
     'PendingPlayerTracker.h',
 ]
 
 UNIFIED_SOURCES += [
+    'Animation.cpp',
     'AnimationEffectReadonly.cpp',
-    'AnimationPlayer.cpp',
     'AnimationTimeline.cpp',
     'DocumentTimeline.cpp',
     'KeyframeEffect.cpp',
     'PendingPlayerTracker.cpp',
 ]
 
 FAIL_ON_WARNINGS = True
 
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -9,17 +9,17 @@
  * of DOM Core's nsIDOMElement, implements nsIContent, provides
  * utility methods for subclasses, and so forth.
  */
 
 #include "mozilla/dom/ElementInlines.h"
 
 #include "AnimationCommon.h"
 #include "mozilla/DebugOnly.h"
-#include "mozilla/dom/AnimationPlayer.h"
+#include "mozilla/dom/Animation.h"
 #include "mozilla/dom/Attr.h"
 #include "nsDOMAttributeMap.h"
 #include "nsIAtom.h"
 #include "nsIContentInlines.h"
 #include "mozilla/dom/NodeInfo.h"
 #include "nsIDocumentInlines.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMDocument.h"
@@ -3181,17 +3181,17 @@ Element::MozRequestFullScreen(JSContext*
 
 void
 Element::MozRequestPointerLock()
 {
   OwnerDoc()->RequestPointerLock(this);
 }
 
 void
-Element::GetAnimations(nsTArray<nsRefPtr<AnimationPlayer> >& aAnimations)
+Element::GetAnimations(nsTArray<nsRefPtr<Animation>>& aAnimations)
 {
   nsIDocument* doc = GetComposedDoc();
   if (doc) {
     doc->FlushPendingNotifications(Flush_Style);
   }
 
   nsIAtom* properties[] = { nsGkAtoms::transitionsProperty,
                             nsGkAtoms::animationsProperty };
@@ -3201,17 +3201,17 @@ Element::GetAnimations(nsTArray<nsRefPtr
       static_cast<AnimationPlayerCollection*>(
         GetProperty(properties[propIdx]));
     if (!collection) {
       continue;
     }
     for (size_t playerIdx = 0;
          playerIdx < collection->mPlayers.Length();
          playerIdx++) {
-      AnimationPlayer* player = collection->mPlayers[playerIdx];
+      Animation* player = collection->mPlayers[playerIdx];
       if (player->IsRelevant()) {
         aAnimations.AppendElement(player);
       }
     }
   }
 }
 
 NS_IMETHODIMP
--- a/dom/base/Element.h
+++ b/dom/base/Element.h
@@ -116,17 +116,17 @@ namespace mozilla {
 class EventChainPostVisitor;
 class EventChainPreVisitor;
 class EventChainVisitor;
 class EventListenerManager;
 class EventStateManager;
 
 namespace dom {
 
-class AnimationPlayer;
+class Animation;
 class Link;
 class UndoManager;
 class DOMRect;
 class DOMRectList;
 class DestinationInsertionPointList;
 
 // IID for the dom::Element interface
 #define NS_ELEMENT_IID \
@@ -803,17 +803,17 @@ public:
   {
     return false;
   }
 
   virtual void SetUndoScope(bool aUndoScope, ErrorResult& aError)
   {
   }
 
-  void GetAnimations(nsTArray<nsRefPtr<AnimationPlayer> >& aAnimations);
+  void GetAnimations(nsTArray<nsRefPtr<Animation>>& aAnimations);
 
   NS_IMETHOD GetInnerHTML(nsAString& aInnerHTML);
   virtual void SetInnerHTML(const nsAString& aInnerHTML, ErrorResult& aError);
   void GetOuterHTML(nsAString& aOuterHTML);
   void SetOuterHTML(const nsAString& aOuterHTML, ErrorResult& aError);
   void InsertAdjacentHTML(const nsAString& aPosition, const nsAString& aText,
                           ErrorResult& aError);
 
--- a/dom/base/nsDOMMutationObserver.cpp
+++ b/dom/base/nsDOMMutationObserver.cpp
@@ -9,17 +9,17 @@
 #include "mozilla/dom/OwningNonNull.h"
 #include "nsError.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsContentUtils.h"
 #include "nsThreadUtils.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsTextFragment.h"
 #include "nsServiceManagerUtils.h"
-#include "mozilla/dom/AnimationPlayer.h"
+#include "mozilla/dom/Animation.h"
 #include "mozilla/dom/KeyframeEffect.h"
 
 nsAutoTArray<nsRefPtr<nsDOMMutationObserver>, 4>*
   nsDOMMutationObserver::sScheduledMutationObservers = nullptr;
 
 nsDOMMutationObserver* nsDOMMutationObserver::sCurrentObserver = nullptr;
 
 uint32_t nsDOMMutationObserver::sMutationLevel = 0;
@@ -320,17 +320,17 @@ nsMutationReceiver::ContentRemoved(nsIDo
 
 void nsMutationReceiver::NodeWillBeDestroyed(const nsINode *aNode)
 {
   NS_ASSERTION(!mParent, "Shouldn't have mParent here!");
   Disconnect(true);
 }
 
 void
-nsAnimationReceiver::RecordAnimationMutation(AnimationPlayer* aPlayer,
+nsAnimationReceiver::RecordAnimationMutation(Animation* aPlayer,
                                              AnimationMutation aMutationType)
 {
   KeyframeEffectReadonly* effect = aPlayer->GetEffect();
   if (!effect) {
     return;
   }
 
   Element* animationTarget = effect->GetTarget();
@@ -380,29 +380,29 @@ nsAnimationReceiver::RecordAnimationMuta
       break;
     case eAnimationMutation_Removed:
       m->mRemovedAnimations.AppendElement(aPlayer);
       break;
   }
 }
 
 void
-nsAnimationReceiver::AnimationAdded(AnimationPlayer* aPlayer)
+nsAnimationReceiver::AnimationAdded(Animation* aPlayer)
 {
   RecordAnimationMutation(aPlayer, eAnimationMutation_Added);
 }
 
 void
-nsAnimationReceiver::AnimationChanged(AnimationPlayer* aPlayer)
+nsAnimationReceiver::AnimationChanged(Animation* aPlayer)
 {
   RecordAnimationMutation(aPlayer, eAnimationMutation_Changed);
 }
 
 void
-nsAnimationReceiver::AnimationRemoved(AnimationPlayer* aPlayer)
+nsAnimationReceiver::AnimationRemoved(Animation* aPlayer)
 {
   RecordAnimationMutation(aPlayer, eAnimationMutation_Removed);
 }
 
 NS_IMPL_ISUPPORTS_INHERITED(nsAnimationReceiver, nsMutationReceiver,
                             nsIAnimationObserver)
 
 // Observer
--- a/dom/base/nsDOMMutationObserver.h
+++ b/dom/base/nsDOMMutationObserver.h
@@ -19,29 +19,29 @@
 #include "nsContentList.h"
 #include "mozilla/dom/Element.h"
 #include "nsClassHashtable.h"
 #include "nsNodeUtils.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsWrapperCache.h"
 #include "mozilla/dom/MutationObserverBinding.h"
 #include "nsIDocument.h"
-#include "mozilla/dom/AnimationPlayer.h"
+#include "mozilla/dom/Animation.h"
 #include "nsIAnimationObserver.h"
 
 class nsDOMMutationObserver;
 using mozilla::dom::MutationObservingInfo;
 
 class nsDOMMutationRecord final : public nsISupports,
                                   public nsWrapperCache
 {
   virtual ~nsDOMMutationRecord() {}
 
 public:
-  typedef nsTArray<nsRefPtr<mozilla::dom::AnimationPlayer>> AnimationPlayerArray;
+  typedef nsTArray<nsRefPtr<mozilla::dom::Animation>> AnimationPlayerArray;
 
   nsDOMMutationRecord(nsIAtom* aType, nsISupports* aOwner)
   : mType(aType), mAttrNamespace(NullString()), mPrevValue(NullString()), mOwner(aOwner)
   {
   }
 
   nsISupports* GetParentObject() const
   {
@@ -429,17 +429,17 @@ protected:
 
 private:
   enum AnimationMutation {
     eAnimationMutation_Added,
     eAnimationMutation_Changed,
     eAnimationMutation_Removed
   };
 
-  void RecordAnimationMutation(mozilla::dom::AnimationPlayer* aPlayer,
+  void RecordAnimationMutation(mozilla::dom::Animation* aPlayer,
                                AnimationMutation aMutationType);
 };
 
 #define NS_DOM_MUTATION_OBSERVER_IID \
 { 0x0c3b91f8, 0xcc3b, 0x4b08, \
   { 0x9e, 0xab, 0x07, 0x47, 0xa9, 0xe4, 0x65, 0xb4 } }
 
 class nsDOMMutationObserver final : public nsISupports,
@@ -751,17 +751,17 @@ public:
     sCurrentBatch->mObservers.AppendElement(aObserver);
   }
 
   static nsINode* GetBatchTarget()
   {
     return sCurrentBatch->mBatchTarget;
   }
 
-  static void AnimationAdded(mozilla::dom::AnimationPlayer* aPlayer)
+  static void AnimationAdded(mozilla::dom::Animation* aPlayer)
   {
     if (!IsBatching()) {
       return;
     }
 
     Entry* entry = sCurrentBatch->FindEntry(aPlayer);
     if (entry) {
       switch (entry->mState) {
@@ -778,34 +778,34 @@ public:
     } else {
       entry = sCurrentBatch->mEntries.AppendElement();
       entry->mPlayer = aPlayer;
       entry->mState = eState_Added;
       entry->mChanged = false;
     }
   }
 
-  static void AnimationChanged(mozilla::dom::AnimationPlayer* aPlayer)
+  static void AnimationChanged(mozilla::dom::Animation* aPlayer)
   {
     Entry* entry = sCurrentBatch->FindEntry(aPlayer);
     if (entry) {
       NS_ASSERTION(entry->mState == eState_RemainedPresent ||
                    entry->mState == eState_Added,
                    "shouldn't have observed an animation being changed after "
                    "being removed");
       entry->mChanged = true;
     } else {
       entry = sCurrentBatch->mEntries.AppendElement();
       entry->mPlayer = aPlayer;
       entry->mState = eState_RemainedPresent;
       entry->mChanged = true;
     }
   }
 
-  static void AnimationRemoved(mozilla::dom::AnimationPlayer* aPlayer)
+  static void AnimationRemoved(mozilla::dom::Animation* aPlayer)
   {
     Entry* entry = sCurrentBatch->FindEntry(aPlayer);
     if (entry) {
       switch (entry->mState) {
         case eState_RemainedPresent:
           entry->mState = eState_Removed;
           break;
         case eState_Added:
@@ -819,17 +819,17 @@ public:
       entry = sCurrentBatch->mEntries.AppendElement();
       entry->mPlayer = aPlayer;
       entry->mState = eState_Removed;
       entry->mChanged = false;
     }
   }
 
 private:
-  Entry* FindEntry(mozilla::dom::AnimationPlayer* aPlayer)
+  Entry* FindEntry(mozilla::dom::Animation* aPlayer)
   {
     for (Entry& e : mEntries) {
       if (e.mPlayer == aPlayer) {
         return &e;
       }
     }
     return nullptr;
   }
@@ -838,17 +838,17 @@ private:
     eState_RemainedPresent,
     eState_RemainedAbsent,
     eState_Added,
     eState_Removed
   };
 
   struct Entry
   {
-    nsRefPtr<mozilla::dom::AnimationPlayer> mPlayer;
+    nsRefPtr<mozilla::dom::Animation> mPlayer;
     State mState;
     bool mChanged;
   };
 
   static nsAutoAnimationMutationBatch* sCurrentBatch;
   nsAutoAnimationMutationBatch* mPreviousBatch;
   nsAutoTArray<nsDOMMutationObserver*, 2> mObservers;
   nsTArray<Entry> mEntries;
--- a/dom/base/nsIAnimationObserver.h
+++ b/dom/base/nsIAnimationObserver.h
@@ -4,59 +4,59 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef nsIAnimationObserver_h___
 #define nsIAnimationObserver_h___
 
 #include "nsIMutationObserver.h"
 
 namespace mozilla {
 namespace dom {
-class AnimationPlayer;
+class Animation;
 }
 }
 
 #define NS_IANIMATION_OBSERVER_IID \
 { 0xed025fc7, 0xdeda, 0x48b9, \
   { 0x9c, 0x35, 0xf2, 0xb6, 0x1e, 0xeb, 0xd0, 0x8d } }
 
 class nsIAnimationObserver : public nsIMutationObserver
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_IANIMATION_OBSERVER_IID)
 
-  virtual void AnimationAdded(mozilla::dom::AnimationPlayer* aPlayer) = 0;
-  virtual void AnimationChanged(mozilla::dom::AnimationPlayer* aPlayer) = 0;
-  virtual void AnimationRemoved(mozilla::dom::AnimationPlayer* aPlayer) = 0;
+  virtual void AnimationAdded(mozilla::dom::Animation* aPlayer) = 0;
+  virtual void AnimationChanged(mozilla::dom::Animation* aPlayer) = 0;
+  virtual void AnimationRemoved(mozilla::dom::Animation* aPlayer) = 0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIAnimationObserver, NS_IANIMATION_OBSERVER_IID)
 
 #define NS_DECL_NSIANIMATIONOBSERVER_ANIMATIONADDED                          \
-    virtual void AnimationAdded(mozilla::dom::AnimationPlayer* aPlayer)      \
+    virtual void AnimationAdded(mozilla::dom::Animation* aPlayer)      \
       override;
 
 #define NS_DECL_NSIANIMATIONOBSERVER_ANIMATIONCHANGED                        \
-    virtual void AnimationChanged(mozilla::dom::AnimationPlayer* aPlayer)    \
+    virtual void AnimationChanged(mozilla::dom::Animation* aPlayer)    \
       override;
 
 #define NS_DECL_NSIANIMATIONOBSERVER_ANIMATIONREMOVED                        \
-    virtual void AnimationRemoved(mozilla::dom::AnimationPlayer* aPlayer)    \
+    virtual void AnimationRemoved(mozilla::dom::Animation* aPlayer)    \
       override;
 
 #define NS_IMPL_NSIANIMATIONOBSERVER_STUB(class_)                            \
 void                                                                         \
-class_::AnimationAdded(mozilla::dom::AnimationPlayer* aPlayer)               \
+class_::AnimationAdded(mozilla::dom::Animation* aPlayer)               \
 {                                                                            \
 }                                                                            \
 void                                                                         \
-class_::AnimationChanged(mozilla::dom::AnimationPlayer* aPlayer)             \
+class_::AnimationChanged(mozilla::dom::Animation* aPlayer)             \
 {                                                                            \
 }                                                                            \
 void                                                                         \
-class_::AnimationRemoved(mozilla::dom::AnimationPlayer* aPlayer)             \
+class_::AnimationRemoved(mozilla::dom::Animation* aPlayer)             \
 {                                                                            \
 }                                                                            \
 NS_IMPL_NSIMUTATIONOBSERVER_CORE_STUB(class_)                                \
 NS_IMPL_NSIMUTATIONOBSERVER_CONTENT(class_)
 
 #define NS_DECL_NSIANIMATIONOBSERVER                                         \
     NS_DECL_NSIANIMATIONOBSERVER_ANIMATIONADDED                              \
     NS_DECL_NSIANIMATIONOBSERVER_ANIMATIONCHANGED                            \
--- a/dom/base/nsNodeUtils.cpp
+++ b/dom/base/nsNodeUtils.cpp
@@ -19,17 +19,17 @@
 #include "nsPIDOMWindow.h"
 #include "nsDocument.h"
 #ifdef MOZ_XUL
 #include "nsXULElement.h"
 #endif
 #include "nsBindingManager.h"
 #include "nsGenericHTMLElement.h"
 #include "mozilla/Assertions.h"
-#include "mozilla/dom/AnimationPlayer.h"
+#include "mozilla/dom/Animation.h"
 #include "mozilla/dom/HTMLImageElement.h"
 #include "mozilla/dom/HTMLMediaElement.h"
 #include "mozilla/dom/KeyframeEffect.h"
 #include "nsWrapperCacheInlines.h"
 #include "nsObjectLoadingContent.h"
 #include "nsDOMMutationObserver.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/HTMLTemplateElement.h"
@@ -211,17 +211,17 @@ nsNodeUtils::ContentRemoved(nsINode* aCo
   }
 
   IMPL_MUTATION_NOTIFICATION(ContentRemoved, aContainer,
                              (document, container, aChild, aIndexInContainer,
                               aPreviousSibling));
 }
 
 static inline Element*
-GetTarget(AnimationPlayer* aPlayer)
+GetTarget(Animation* aPlayer)
 {
   KeyframeEffectReadonly* effect = aPlayer->GetEffect();
   if (!effect) {
     return nullptr;
   }
 
   Element* target;
   nsCSSPseudoElements::Type pseudoType;
@@ -233,45 +233,45 @@ GetTarget(AnimationPlayer* aPlayer)
   if (pseudoType != nsCSSPseudoElements::ePseudo_NotPseudoElement) {
     return nullptr;
   }
 
   return effect->GetTarget();
 }
 
 void
-nsNodeUtils::AnimationAdded(AnimationPlayer* aPlayer)
+nsNodeUtils::AnimationAdded(Animation* aPlayer)
 {
   Element* target = GetTarget(aPlayer);
   if (!target) {
     return;
   }
   nsIDocument* doc = target->OwnerDoc();
 
   if (doc->MayHaveAnimationObservers()) {
     IMPL_ANIMATION_NOTIFICATION(AnimationAdded, target, (aPlayer));
   }
 }
 
 void
-nsNodeUtils::AnimationChanged(AnimationPlayer* aPlayer)
+nsNodeUtils::AnimationChanged(Animation* aPlayer)
 {
   Element* target = GetTarget(aPlayer);
   if (!target) {
     return;
   }
   nsIDocument* doc = target->OwnerDoc();
 
   if (doc->MayHaveAnimationObservers()) {
     IMPL_ANIMATION_NOTIFICATION(AnimationChanged, target, (aPlayer));
   }
 }
 
 void
-nsNodeUtils::AnimationRemoved(AnimationPlayer* aPlayer)
+nsNodeUtils::AnimationRemoved(Animation* aPlayer)
 {
   Element* target = GetTarget(aPlayer);
   if (!target) {
     return;
   }
   nsIDocument* doc = target->OwnerDoc();
 
   if (doc->MayHaveAnimationObservers()) {
--- a/dom/base/nsNodeUtils.h
+++ b/dom/base/nsNodeUtils.h
@@ -13,17 +13,17 @@
 
 struct CharacterDataChangeInfo;
 class nsIVariant;
 class nsIDOMNode;
 template<class E> class nsCOMArray;
 class nsCycleCollectionTraversalCallback;
 namespace mozilla {
 namespace dom {
-class AnimationPlayer;
+class Animation;
 }
 }
 
 class nsNodeUtils
 {
 public:
   /**
    * Send CharacterDataWillChange notifications to nsIMutationObservers.
@@ -122,19 +122,19 @@ public:
     if (slots && !slots->mMutationObservers.IsEmpty()) {
       NS_OBSERVER_ARRAY_NOTIFY_OBSERVERS(slots->mMutationObservers,
                                          nsIMutationObserver,
                                          ParentChainChanged,
                                          (aContent));
     }
   }
 
-  static void AnimationAdded(mozilla::dom::AnimationPlayer* aPlayer);
-  static void AnimationChanged(mozilla::dom::AnimationPlayer* aPlayer);
-  static void AnimationRemoved(mozilla::dom::AnimationPlayer* aPlayer);
+  static void AnimationAdded(mozilla::dom::Animation* aPlayer);
+  static void AnimationChanged(mozilla::dom::Animation* aPlayer);
+  static void AnimationRemoved(mozilla::dom::Animation* aPlayer);
 
   /**
    * To be called when reference count of aNode drops to zero.
    * @param aNode The node which is going to be deleted.
    */
   static void LastRelease(nsINode* aNode);
 
   /**
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -125,22 +125,22 @@ var interfaceNamesInGlobalScope =
   [
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozAbortablePromise", pref: "dom.abortablepromise.enabled"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "AlarmsManager", pref: "dom.mozAlarms.enabled"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "AnalyserNode",
 // IMPORTANT: Do not change this list without review from a DOM peer!
+    {name: "Animation", pref: "dom.animations-api.core.enabled"},
+// IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "AnimationEffectReadonly", pref: "dom.animations-api.core.enabled"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "AnimationEvent",
 // IMPORTANT: Do not change this list without review from a DOM peer!
-    {name: "AnimationPlayer", pref: "dom.animations-api.core.enabled"},
-// IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "AnimationTimeline", pref: "dom.animations-api.core.enabled"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "Attr",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "Audio",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "AudioBuffer",
 // IMPORTANT: Do not change this list without review from a DOM peer!
--- a/dom/webidl/Animatable.webidl
+++ b/dom/webidl/Animatable.webidl
@@ -8,10 +8,10 @@
  *
  * Copyright © 2014 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 [NoInterfaceObject]
 interface Animatable {
   [Func="nsDocument::IsWebAnimationsEnabled"]
-  sequence<AnimationPlayer> getAnimations();
+  sequence<Animation> getAnimations();
 };
rename from dom/webidl/AnimationPlayer.webidl
rename to dom/webidl/Animation.webidl
--- a/dom/webidl/AnimationPlayer.webidl
+++ b/dom/webidl/Animation.webidl
@@ -1,49 +1,49 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * The origin of this IDL file is
- * http://dev.w3.org/fxtf/web-animations/#idl-def-AnimationPlayer
+ * http://w3c.github.io/web-animations/#the-animation-interface
  *
- * Copyright © 2014 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 enum AnimationPlayState { "idle", "pending", "running", "paused", "finished" };
 
 [Func="nsDocument::IsWebAnimationsEnabled"]
-interface AnimationPlayer {
+interface Animation {
   // Bug 1049975: Make 'effect' writeable
   [Pure]
   readonly attribute AnimationEffectReadonly? effect;
   readonly attribute AnimationTimeline timeline;
   [BinaryName="startTimeAsDouble"]
   attribute double? startTime;
   [SetterThrows, BinaryName="currentTimeAsDouble"]
   attribute double? currentTime;
 
            attribute double             playbackRate;
   [BinaryName="playStateFromJS"]
   readonly attribute AnimationPlayState playState;
   [Throws]
-  readonly attribute Promise<AnimationPlayer> ready;
+  readonly attribute Promise<Animation> ready;
   [Throws]
-  readonly attribute Promise<AnimationPlayer> finished;
+  readonly attribute Promise<Animation> finished;
   /*
   void cancel ();
   void finish ();
   */
   [BinaryName="playFromJS"]
   void play ();
   [BinaryName="pauseFromJS"]
   void pause ();
   /*
   void reverse ();
   */
 };
 
 // Non-standard extensions
-partial interface AnimationPlayer {
+partial interface Animation {
   [ChromeOnly] readonly attribute boolean isRunningOnCompositor;
 };
--- a/dom/webidl/AnimationTimeline.webidl
+++ b/dom/webidl/AnimationTimeline.webidl
@@ -10,11 +10,11 @@
  * liability, trademark and document use rules apply.
  */
 
 [Func="nsDocument::IsWebAnimationsEnabled"]
 interface AnimationTimeline {
   [BinaryName="currentTimeAsDouble"]
   readonly attribute double? currentTime;
   // Not yet implemented:
-  // AnimationPlayer            play (optional TimedItem? source = null);
-  // sequence<AnimationPlayer>  getAnimations ();
+  // Animation           play (optional TimedItem? source = null);
+  // sequence<Animation> getAnimations ();
 };
--- a/dom/webidl/MutationObserver.webidl
+++ b/dom/webidl/MutationObserver.webidl
@@ -24,21 +24,21 @@ interface MutationRecord {
   readonly attribute Node? nextSibling;
   [Constant]
   readonly attribute DOMString? attributeName;
   [Constant]
   readonly attribute DOMString? attributeNamespace;
   [Constant]
   readonly attribute DOMString? oldValue;
   [Constant,Cached,ChromeOnly]
-  readonly attribute sequence<AnimationPlayer> addedAnimations;
+  readonly attribute sequence<Animation> addedAnimations;
   [Constant,Cached,ChromeOnly]
-  readonly attribute sequence<AnimationPlayer> changedAnimations;
+  readonly attribute sequence<Animation> changedAnimations;
   [Constant,Cached,ChromeOnly]
-  readonly attribute sequence<AnimationPlayer> removedAnimations;
+  readonly attribute sequence<Animation> removedAnimations;
 };
 
 [Constructor(MutationCallback mutationCallback)]
 interface MutationObserver {
   [Throws]
   void observe(Node target, optional MutationObserverInit options);
   void disconnect();
   sequence<MutationRecord> takeRecords();
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -17,19 +17,19 @@ PREPROCESSED_WEBIDL_FILES = [
 
 WEBIDL_FILES = [
     'AbortablePromise.webidl',
     'AbstractWorker.webidl',
     'ActivityRequestHandler.webidl',
     'AlarmsManager.webidl',
     'AnalyserNode.webidl',
     'Animatable.webidl',
+    'Animation.webidl',
     'AnimationEffectReadonly.webidl',
     'AnimationEvent.webidl',
-    'AnimationPlayer.webidl',
     'AnimationTimeline.webidl',
     'AnonymousContent.webidl',
     'AppInfo.webidl',
     'AppNotificationServiceOptions.webidl',
     'Apps.webidl',
     'APZTestData.webidl',
     'ArchiveReader.webidl',
     'ArchiveRequest.webidl',
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -16,17 +16,17 @@
 #include "ReadbackLayer.h"              // for ReadbackLayer
 #include "UnitTransforms.h"             // for ViewAs
 #include "gfxPlatform.h"                // for gfxPlatform
 #include "gfxPrefs.h"
 #include "gfxUtils.h"                   // for gfxUtils, etc
 #include "gfx2DGlue.h"
 #include "mozilla/DebugOnly.h"          // for DebugOnly
 #include "mozilla/Telemetry.h"          // for Accumulate
-#include "mozilla/dom/AnimationPlayer.h" // for ComputedTimingFunction
+#include "mozilla/dom/Animation.h"      // for ComputedTimingFunction
 #include "mozilla/gfx/2D.h"             // for DrawTarget
 #include "mozilla/gfx/BaseSize.h"       // for BaseSize
 #include "mozilla/gfx/Matrix.h"         // for Matrix4x4
 #include "mozilla/layers/Compositor.h"  // for Compositor
 #include "mozilla/layers/CompositorTypes.h"
 #include "mozilla/layers/LayerManagerComposite.h"  // for LayerComposite
 #include "mozilla/layers/LayerMetricsWrapper.h" // for LayerMetricsWrapper
 #include "mozilla/layers/LayersMessages.h"  // for TransformFunction, etc
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -29,17 +29,17 @@
 #include "mozilla/BasicEvents.h"        // for Modifiers, MODIFIER_*
 #include "mozilla/ClearOnShutdown.h"    // for ClearOnShutdown
 #include "mozilla/Constants.h"          // for M_PI
 #include "mozilla/EventForwards.h"      // for nsEventStatus_*
 #include "mozilla/Preferences.h"        // for Preferences
 #include "mozilla/ReentrantMonitor.h"   // for ReentrantMonitorAutoEnter, etc
 #include "mozilla/StaticPtr.h"          // for StaticAutoPtr
 #include "mozilla/TimeStamp.h"          // for TimeDuration, TimeStamp
-#include "mozilla/dom/AnimationPlayer.h" // for ComputedTimingFunction
+#include "mozilla/dom/KeyframeEffect.h" // for ComputedTimingFunction
 #include "mozilla/dom/Touch.h"          // for Touch
 #include "mozilla/gfx/BasePoint.h"      // for BasePoint
 #include "mozilla/gfx/BaseRect.h"       // for BaseRect
 #include "mozilla/gfx/Point.h"          // for Point, RoundedToInt, etc
 #include "mozilla/gfx/Rect.h"           // for RoundedIn
 #include "mozilla/gfx/ScaleFactor.h"    // for ScaleFactor
 #include "mozilla/layers/APZCTreeManager.h"  // for ScrollableLayerGuid
 #include "mozilla/layers/APZThreadUtils.h"  // for AssertOnControllerThread, etc
--- a/gfx/layers/apz/src/Axis.cpp
+++ b/gfx/layers/apz/src/Axis.cpp
@@ -3,17 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "Axis.h"
 #include <math.h>                       // for fabsf, pow, powf
 #include <algorithm>                    // for max
 #include "AsyncPanZoomController.h"     // for AsyncPanZoomController
-#include "mozilla/dom/AnimationPlayer.h" // for ComputedTimingFunction
+#include "mozilla/dom/KeyframeEffect.h" // for ComputedTimingFunction
 #include "mozilla/layers/APZCTreeManager.h" // for APZCTreeManager
 #include "mozilla/layers/APZThreadUtils.h" // for AssertOnControllerThread
 #include "FrameMetrics.h"               // for FrameMetrics
 #include "mozilla/Attributes.h"         // for final
 #include "mozilla/Preferences.h"        // for Preferences
 #include "mozilla/gfx/Rect.h"           // for RoundedIn
 #include "mozilla/mozalloc.h"           // for operator new
 #include "mozilla/FloatingPoint.h"      // for FuzzyEqualsAdditive
--- a/gfx/layers/apz/util/APZCCallbackHelper.cpp
+++ b/gfx/layers/apz/util/APZCCallbackHelper.cpp
@@ -12,16 +12,17 @@
 #include "mozilla/layers/ShadowLayers.h"
 #include "nsIScrollableFrame.h"
 #include "nsLayoutUtils.h"
 #include "nsIDOMElement.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsIDOMWindow.h"
+#include "nsRefreshDriver.h"
 
 #define APZCCH_LOG(...)
 // #define APZCCH_LOG(...) printf_stderr("APZCCH: " __VA_ARGS__)
 
 namespace mozilla {
 namespace layers {
 
 using dom::TabParent;
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -8,17 +8,16 @@
 #include <stdint.h>                     // for uint32_t
 #include "apz/src/AsyncPanZoomController.h"
 #include "FrameMetrics.h"               // for FrameMetrics
 #include "LayerManagerComposite.h"      // for LayerManagerComposite, etc
 #include "Layers.h"                     // for Layer, ContainerLayer, etc
 #include "gfxPoint.h"                   // for gfxPoint, gfxSize
 #include "mozilla/StyleAnimationValue.h" // for StyleAnimationValue, etc
 #include "mozilla/WidgetUtils.h"        // for ComputeTransformForRotation
-#include "mozilla/dom/AnimationPlayer.h" // for AnimationPlayer
 #include "mozilla/dom/KeyframeEffect.h" // for KeyframeEffectReadonly
 #include "mozilla/gfx/BaseRect.h"       // for BaseRect
 #include "mozilla/gfx/Point.h"          // for RoundedToInt, PointTyped
 #include "mozilla/gfx/Rect.h"           // for RoundedToInt, RectTyped
 #include "mozilla/gfx/ScaleFactor.h"    // for ScaleFactor
 #include "mozilla/layers/Compositor.h"  // for Compositor
 #include "mozilla/layers/CompositorParent.h" // for CompositorParent, etc
 #include "mozilla/layers/LayerMetricsWrapper.h" // for LayerMetricsWrapper
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -343,17 +343,17 @@ ToTimingFunction(const ComputedTimingFun
   }
 
   uint32_t type = aCTF.GetType() == nsTimingFunction::StepStart ? 1 : 2;
   return TimingFunction(StepFunction(aCTF.GetSteps(), type));
 }
 
 static void
 AddAnimationForProperty(nsIFrame* aFrame, const AnimationProperty& aProperty,
-                        AnimationPlayer* aPlayer, Layer* aLayer,
+                        dom::Animation* aPlayer, Layer* aLayer,
                         AnimationData& aData, bool aPending)
 {
   MOZ_ASSERT(aLayer->AsContainerLayer(), "Should only animate ContainerLayer");
   MOZ_ASSERT(aPlayer->GetEffect(),
              "Should not be adding an animation for a player without"
              " an effect");
   nsStyleContext* styleContext = aFrame->StyleContext();
   nsPresContext* presContext = aFrame->PresContext();
@@ -412,17 +412,17 @@ AddAnimationsForProperty(nsIFrame* aFram
                          bool aPending)
 {
   MOZ_ASSERT(nsCSSProps::PropHasFlags(aProperty,
                                       CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR),
              "inconsistent property flags");
 
   // Add from first to last (since last overrides)
   for (size_t playerIdx = 0; playerIdx < aPlayers.Length(); playerIdx++) {
-    AnimationPlayer* player = aPlayers[playerIdx];
+    dom::Animation* player = aPlayers[playerIdx];
     if (!player->IsPlaying()) {
       continue;
     }
     dom::KeyframeEffectReadonly* effect = player->GetEffect();
     MOZ_ASSERT(effect, "A playing player should have an effect");
     const AnimationProperty* property =
       effect->GetAnimationOfProperty(aProperty);
     if (!property) {
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -496,17 +496,17 @@ GetSuitableScale(float aMaxScale, float 
 
 static void
 GetMinAndMaxScaleForAnimationProperty(nsIContent* aContent,
                                       AnimationPlayerCollection* aPlayers,
                                       gfxSize& aMaxScale,
                                       gfxSize& aMinScale)
 {
   for (size_t playerIdx = aPlayers->mPlayers.Length(); playerIdx-- != 0; ) {
-    AnimationPlayer* player = aPlayers->mPlayers[playerIdx];
+    dom::Animation* player = aPlayers->mPlayers[playerIdx];
     if (!player->GetEffect() || player->GetEffect()->IsFinishedTransition()) {
       continue;
     }
     dom::KeyframeEffectReadonly* effect = player->GetEffect();
     for (size_t propIdx = effect->Properties().Length(); propIdx-- != 0; ) {
       AnimationProperty& prop = effect->Properties()[propIdx];
       if (prop.mProperty == eCSSProperty_transform) {
         for (uint32_t segIdx = prop.mSegments.Length(); segIdx-- != 0; ) {
--- a/layout/style/AnimationCommon.cpp
+++ b/layout/style/AnimationCommon.cpp
@@ -24,17 +24,17 @@
 #include "mozilla/dom/KeyframeEffect.h"
 #include "RestyleManager.h"
 #include "nsRuleProcessorData.h"
 #include "nsStyleSet.h"
 #include "nsStyleChangeList.h"
 
 
 using mozilla::layers::Layer;
-using mozilla::dom::AnimationPlayer;
+using mozilla::dom::Animation;
 using mozilla::dom::KeyframeEffectReadonly;
 
 namespace mozilla {
 
 /* static */ bool
 IsGeometricProperty(nsCSSProperty aProperty)
 {
   switch (aProperty) {
@@ -596,17 +596,17 @@ AnimationPlayerCollection::CanPerformOnC
       message.Append(nsAtomCString(mElementProperty));
       message.Append(")");
       LogAsyncAnimationFailure(message, mElement);
     }
     return false;
   }
 
   for (size_t playerIdx = mPlayers.Length(); playerIdx-- != 0; ) {
-    const AnimationPlayer* player = mPlayers[playerIdx];
+    const Animation* player = mPlayers[playerIdx];
     if (!player->IsPlaying()) {
       continue;
     }
 
     const KeyframeEffectReadonly* effect = player->GetEffect();
     MOZ_ASSERT(effect, "A playing player should have an effect");
 
     for (size_t propIdx = 0, propEnd = effect->Properties().Length();
@@ -615,17 +615,17 @@ AnimationPlayerCollection::CanPerformOnC
         aFlags = CanAnimateFlags(aFlags | CanAnimate_HasGeometricProperty);
         break;
       }
     }
   }
 
   bool existsProperty = false;
   for (size_t playerIdx = mPlayers.Length(); playerIdx-- != 0; ) {
-    const AnimationPlayer* player = mPlayers[playerIdx];
+    const Animation* player = mPlayers[playerIdx];
     if (!player->IsPlaying()) {
       continue;
     }
 
     const KeyframeEffectReadonly* effect = player->GetEffect();
     MOZ_ASSERT(effect, "A playing player should have an effect");
 
     existsProperty = existsProperty || effect->Properties().Length() > 0;
@@ -923,17 +923,17 @@ AnimationPlayerCollection::HasCurrentAni
 }
 
 bool
 AnimationPlayerCollection::HasCurrentAnimationsForProperties(
                               const nsCSSProperty* aProperties,
                               size_t aPropertyCount) const
 {
   for (size_t playerIdx = mPlayers.Length(); playerIdx-- != 0; ) {
-    const AnimationPlayer& player = *mPlayers[playerIdx];
+    const Animation& player = *mPlayers[playerIdx];
     const KeyframeEffectReadonly* effect = player.GetEffect();
     if (effect &&
         effect->IsCurrent(player) &&
         effect->HasAnimationOfProperties(aProperties, aPropertyCount)) {
       return true;
     }
   }
 
--- a/layout/style/AnimationCommon.h
+++ b/layout/style/AnimationCommon.h
@@ -10,17 +10,17 @@
 #include "nsIStyleRule.h"
 #include "nsRefreshDriver.h"
 #include "prclist.h"
 #include "nsChangeHint.h"
 #include "nsCSSProperty.h"
 #include "nsDisplayList.h" // For nsDisplayItem::Type
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/StyleAnimationValue.h"
-#include "mozilla/dom/AnimationPlayer.h"
+#include "mozilla/dom/Animation.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/Nullable.h"
 #include "nsStyleStruct.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/FloatingPoint.h"
 #include "nsCSSPseudoElements.h"
 #include "nsCycleCollectionParticipant.h"
@@ -218,18 +218,17 @@ public:
 private:
   ~AnimValuesStyleRule() {}
 
   InfallibleTArray<PropertyValuePair> mPropertyValuePairs;
 };
 
 } /* end css sub-namespace */
 
-typedef InfallibleTArray<nsRefPtr<dom::AnimationPlayer> >
-  AnimationPlayerPtrArray;
+typedef InfallibleTArray<nsRefPtr<dom::Animation>> AnimationPlayerPtrArray;
 
 enum EnsureStyleRuleFlags {
   EnsureStyleRule_IsThrottled,
   EnsureStyleRule_IsNotThrottled
 };
 
 struct AnimationPlayerCollection : public PRCList
 {
--- a/layout/style/nsAnimationManager.cpp
+++ b/layout/style/nsAnimationManager.cpp
@@ -19,65 +19,65 @@
 #include "nsLayoutUtils.h"
 #include "nsIFrame.h"
 #include "nsIDocument.h"
 #include "nsDOMMutationObserver.h"
 #include <math.h>
 
 using namespace mozilla;
 using namespace mozilla::css;
-using mozilla::dom::AnimationPlayer;
+using mozilla::dom::Animation;
 using mozilla::dom::KeyframeEffectReadonly;
 using mozilla::CSSAnimationPlayer;
 
 mozilla::dom::Promise*
 CSSAnimationPlayer::GetReady(ErrorResult& aRv)
 {
   FlushStyle();
-  return AnimationPlayer::GetReady(aRv);
+  return Animation::GetReady(aRv);
 }
 
 void
 CSSAnimationPlayer::Play(LimitBehavior aLimitBehavior)
 {
   mPauseShouldStick = false;
-  AnimationPlayer::Play(aLimitBehavior);
+  Animation::Play(aLimitBehavior);
 }
 
 void
 CSSAnimationPlayer::Pause()
 {
   mPauseShouldStick = true;
-  AnimationPlayer::Pause();
+  Animation::Pause();
 }
 
 mozilla::dom::AnimationPlayState
 CSSAnimationPlayer::PlayStateFromJS() const
 {
   // Flush style to ensure that any properties controlling animation state
   // (e.g. animation-play-state) are fully updated.
   FlushStyle();
-  return AnimationPlayer::PlayStateFromJS();
+  return Animation::PlayStateFromJS();
 }
 
 void
 CSSAnimationPlayer::PlayFromJS()
 {
   // Note that flushing style below might trigger calls to
   // PlayFromStyle()/PauseFromStyle() on this object.
   FlushStyle();
-  AnimationPlayer::PlayFromJS();
+  Animation::PlayFromJS();
 }
 
 void
 CSSAnimationPlayer::PlayFromStyle()
 {
   mIsStylePaused = false;
   if (!mPauseShouldStick) {
-    DoPlay(AnimationPlayer::LimitBehavior::Continue);
+    DoPlay(Animation::LimitBehavior::Continue);
   }
 }
 
 void
 CSSAnimationPlayer::PauseFromStyle()
 {
   // Check if the pause state is being overridden
   if (mIsStylePaused) {
@@ -322,17 +322,17 @@ nsAnimationManager::CheckAnimationRule(n
     // them.  See
     // http://lists.w3.org/Archives/Public/www-style/2011Apr/0079.html
     // In order to honor what the spec said, we'd copy more data over
     // (or potentially optimize BuildAnimations to avoid rebuilding it
     // in the first place).
     if (!collection->mPlayers.IsEmpty()) {
 
       for (size_t newIdx = newPlayers.Length(); newIdx-- != 0;) {
-        AnimationPlayer* newPlayer = newPlayers[newIdx];
+        Animation* newPlayer = newPlayers[newIdx];
 
         // Find the matching animation with this name in the old list
         // of animations.  We iterate through both lists in a backwards
         // direction which means that if there are more animations in
         // the new list of animations with a given name than in the old
         // list, it will be the animations towards the of the beginning of
         // the list that do not match and are treated as new animations.
         nsRefPtr<CSSAnimationPlayer> oldPlayer;
@@ -502,17 +502,17 @@ nsAnimationManager::BuildAnimations(nsSt
   for (size_t animIdx = 0, animEnd = disp->mAnimationNameCount;
        animIdx != animEnd; ++animIdx) {
     const StyleAnimation& src = disp->mAnimations[animIdx];
 
     // CSS Animations whose animation-name does not match a @keyframes rule do
     // not generate animation events. This includes when the animation-name is
     // "none" which is represented by an empty name in the StyleAnimation.
     // Since such animations neither affect style nor dispatch events, we do
-    // not generate a corresponding AnimationPlayer for them.
+    // not generate a corresponding Animation for them.
     nsCSSKeyframesRule* rule =
       src.GetName().IsEmpty()
       ? nullptr
       : mPresContext->StyleSet()->KeyframesRuleForName(src.GetName());
     if (!rule) {
       continue;
     }
 
@@ -748,17 +748,17 @@ nsAnimationManager::UpdateCascadeResults
   // the compositor
   nsAutoTArray<nsCSSProperty, 2> propertiesToTrack;
 
   {
     nsCSSPropertySet propertiesToTrackAsSet;
 
     for (size_t playerIdx = aElementAnimations->mPlayers.Length();
          playerIdx-- != 0; ) {
-      const AnimationPlayer* player = aElementAnimations->mPlayers[playerIdx];
+      const Animation* player = aElementAnimations->mPlayers[playerIdx];
       const KeyframeEffectReadonly* effect = player->GetEffect();
       if (!effect) {
         continue;
       }
 
       for (size_t propIdx = 0, propEnd = effect->Properties().Length();
            propIdx != propEnd; ++propIdx) {
         const AnimationProperty& prop = effect->Properties()[propIdx];
--- a/layout/style/nsAnimationManager.h
+++ b/layout/style/nsAnimationManager.h
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef nsAnimationManager_h_
 #define nsAnimationManager_h_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/ContentEvents.h"
 #include "AnimationCommon.h"
 #include "nsCSSPseudoElements.h"
-#include "mozilla/dom/AnimationPlayer.h"
+#include "mozilla/dom/Animation.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/TimeStamp.h"
 
 class nsCSSKeyframesRule;
 class nsStyleContext;
 
 namespace mozilla {
 namespace css {
@@ -47,21 +47,21 @@ struct AnimationEventInfo {
     : mElement(aOther.mElement), mEvent(true, aOther.mEvent.message)
   {
     mEvent.AssignAnimationEventData(aOther.mEvent, false);
   }
 };
 
 typedef InfallibleTArray<AnimationEventInfo> EventArray;
 
-class CSSAnimationPlayer final : public dom::AnimationPlayer
+class CSSAnimationPlayer final : public dom::Animation
 {
 public:
  explicit CSSAnimationPlayer(dom::DocumentTimeline* aTimeline)
-    : dom::AnimationPlayer(aTimeline)
+    : dom::Animation(aTimeline)
     , mIsStylePaused(false)
     , mPauseShouldStick(false)
     , mPreviousPhaseOrIteration(PREVIOUS_PHASE_BEFORE)
   {
   }
 
   virtual CSSAnimationPlayer*
   AsCSSAnimationPlayer() override { return this; }
@@ -120,17 +120,17 @@ protected:
   //
   //             A | B | C | D | E
   //   ---------------------------
   //   play()    A | B | A | B | B
   //   pause()   C | D | C | D | D
   //   'running' A | A | C | C | A
   //   'paused'  E | B | D | D | E
   //
-  // The base class, AnimationPlayer already provides a boolean value,
+  // The base class, Animation already provides a boolean value,
   // mIsPaused which gives us two states. To this we add a further two booleans
   // to represent the states as follows.
   //
   // A. Running
   //    (!mIsPaused; !mIsStylePaused; !mPauseShouldStick)
   // B. Running and temporarily overriding animation-play-state: paused
   //    (!mIsPaused; mIsStylePaused; !mPauseShouldStick)
   // C. Paused and sticky overriding animation-play-state: running
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -28,21 +28,20 @@
 #include "nsDisplayList.h"
 #include "nsStyleChangeList.h"
 #include "nsStyleSet.h"
 #include "RestyleManager.h"
 #include "nsDOMMutationObserver.h"
 
 using mozilla::TimeStamp;
 using mozilla::TimeDuration;
-using mozilla::dom::AnimationPlayer;
+using mozilla::dom::Animation;
 using mozilla::dom::KeyframeEffectReadonly;
 
 using namespace mozilla;
-using namespace mozilla::layers;
 using namespace mozilla::css;
 
 const nsString&
 ElementPropertyTransition::Name() const
 {
    if (!mName.Length()) {
      const_cast<ElementPropertyTransition*>(this)->mName =
        NS_ConvertUTF8toUTF16(nsCSSProps::GetStringValue(TransitionProperty()));
@@ -85,24 +84,24 @@ ElementPropertyTransition::CurrentValueP
 /*****************************************************************************
  * CSSTransitionPlayer                                                       *
  *****************************************************************************/
 
 mozilla::dom::AnimationPlayState
 CSSTransitionPlayer::PlayStateFromJS() const
 {
   FlushStyle();
-  return AnimationPlayer::PlayStateFromJS();
+  return Animation::PlayStateFromJS();
 }
 
 void
 CSSTransitionPlayer::PlayFromJS()
 {
   FlushStyle();
-  AnimationPlayer::PlayFromJS();
+  Animation::PlayFromJS();
 }
 
 CommonAnimationManager*
 CSSTransitionPlayer::GetAnimationManager() const
 {
   nsPresContext* context = GetPresContext();
   if (!context) {
     return nullptr;
@@ -315,17 +314,17 @@ nsTransitionManager::StyleContextChanged
     }
 
     AnimationPlayerPtrArray& players = collection->mPlayers;
     size_t i = players.Length();
     MOZ_ASSERT(i != 0, "empty transitions list?");
     StyleAnimationValue currentValue;
     do {
       --i;
-      AnimationPlayer* player = players[i];
+      Animation* player = players[i];
       dom::KeyframeEffectReadonly* effect = player->GetEffect();
       MOZ_ASSERT(effect && effect->Properties().Length() == 1,
                  "Should have one animation property for a transition");
       MOZ_ASSERT(effect && effect->Properties()[0].mSegments.Length() == 1,
                  "Animation property should have one segment for a transition");
       const AnimationProperty& prop = effect->Properties()[0];
       const AnimationPropertySegment& segment = prop.mSegments[0];
           // properties no longer in 'transition-property'
@@ -803,17 +802,17 @@ nsTransitionManager::FlushTransitions(Fl
                  "Element::UnbindFromTree should have "
                  "destroyed the element transitions object");
 
       size_t i = collection->mPlayers.Length();
       MOZ_ASSERT(i != 0, "empty transitions list?");
       bool transitionStartedOrEnded = false;
       do {
         --i;
-        AnimationPlayer* player = collection->mPlayers[i];
+        Animation* player = collection->mPlayers[i];
         if (!player->GetEffect()->IsFinishedTransition()) {
           MOZ_ASSERT(player->GetEffect(),
                      "Transitions should have an effect");
           ComputedTiming computedTiming =
             player->GetEffect()->GetComputedTiming();
           if (computedTiming.mPhase == ComputedTiming::AnimationPhase_After) {
             nsCSSProperty prop =
               player->GetEffect()->AsTransition()->TransitionProperty();
--- a/layout/style/nsTransitionManager.h
+++ b/layout/style/nsTransitionManager.h
@@ -5,17 +5,17 @@
 
 /* Code to start and animate CSS transitions. */
 
 #ifndef nsTransitionManager_h_
 #define nsTransitionManager_h_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/MemoryReporting.h"
-#include "mozilla/dom/AnimationPlayer.h"
+#include "mozilla/dom/Animation.h"
 #include "mozilla/dom/KeyframeEffect.h"
 #include "AnimationCommon.h"
 #include "nsCSSPseudoElements.h"
 
 class nsStyleContext;
 class nsPresContext;
 class nsCSSPropertySet;
 struct ElementDependentRuleProcessorData;
@@ -70,33 +70,33 @@ struct ElementPropertyTransition : publi
   double mReversePortion;
 
   // Compute the portion of the *value* space that we should be through
   // at the current time.  (The input to the transition timing function
   // has time units, the output has value units.)
   double CurrentValuePortion() const;
 };
 
-class CSSTransitionPlayer final : public dom::AnimationPlayer
+class CSSTransitionPlayer final : public dom::Animation
 {
 public:
  explicit CSSTransitionPlayer(dom::DocumentTimeline* aTimeline)
-    : dom::AnimationPlayer(aTimeline)
+    : dom::Animation(aTimeline)
   {
   }
 
   virtual CSSTransitionPlayer*
   AsCSSTransitionPlayer() override { return this; }
 
   virtual dom::AnimationPlayState PlayStateFromJS() const override;
   virtual void PlayFromJS() override;
 
   // A variant of Play() that avoids posting style updates since this method
   // is expected to be called whilst already updating style.
-  void PlayFromStyle() { DoPlay(AnimationPlayer::LimitBehavior::Continue); }
+  void PlayFromStyle() { DoPlay(Animation::LimitBehavior::Continue); }
 
 protected:
   virtual ~CSSTransitionPlayer() { }
 
   virtual css::CommonAnimationManager* GetAnimationManager() const override;
 };
 
 } // namespace mozilla