Bug 1040543 part 2 - Rename ElementAnimationCollection to AnimationPlayerCollection; r=bz
authorBrian Birtles <birtles@gmail.com>
Sun, 10 Aug 2014 17:06:46 +1000
changeset 198784 daca3c0d2c85d6deaa0c9332150d9937988067be
parent 198783 414eb2e950575e99de58028c2010e6eca236c19e
child 198785 cc995232033eb474ca0ce46f27c2f43a849cdff1
push id27286
push usernigelbabu@gmail.com
push dateMon, 11 Aug 2014 06:26:45 +0000
treeherdermozilla-central@8c4a1b3a2a8b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1040543
milestone34.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 1040543 part 2 - Rename ElementAnimationCollection to AnimationPlayerCollection; r=bz
content/base/src/Element.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/nsStyleSet.cpp
layout/style/nsTransitionManager.cpp
layout/style/nsTransitionManager.h
--- a/content/base/src/Element.cpp
+++ b/content/base/src/Element.cpp
@@ -2867,18 +2867,18 @@ Element::MozRequestPointerLock()
 
 void
 Element::GetAnimationPlayers(nsTArray<nsRefPtr<AnimationPlayer> >& aPlayers)
 {
   nsIAtom* properties[] = { nsGkAtoms::transitionsProperty,
                             nsGkAtoms::animationsProperty };
   for (size_t propIdx = 0; propIdx < MOZ_ARRAY_LENGTH(properties);
        propIdx++) {
-    ElementAnimationCollection* collection =
-      static_cast<ElementAnimationCollection*>(
+    AnimationPlayerCollection* collection =
+      static_cast<AnimationPlayerCollection*>(
         GetProperty(properties[propIdx]));
     if (!collection) {
       continue;
     }
     for (size_t animIdx = 0;
          animIdx < collection->mAnimations.Length();
          animIdx++) {
       AnimationPlayer* anim = collection->mAnimations[animIdx];
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -382,17 +382,17 @@ AddAnimationForProperty(nsIFrame* aFrame
       animSegment->endPortion() = segment->mToKey;
       animSegment->sampleFn() = ToTimingFunction(segment->mTimingFunction);
     }
   }
 }
 
 static void
 AddAnimationsForProperty(nsIFrame* aFrame, nsCSSProperty aProperty,
-                         ElementAnimationPtrArray& aAnimations,
+                         AnimationPlayerPtrArray& aAnimations,
                          Layer* aLayer, AnimationData& aData,
                          bool aPending) {
   for (uint32_t animIdx = 0; animIdx < aAnimations.Length(); animIdx++) {
     AnimationPlayer* anim = aAnimations[animIdx];
     if (!(anim->HasAnimationOfProperty(aProperty) && anim->IsRunning())) {
       continue;
     }
     AddAnimationForProperty(aFrame, aProperty, anim, aLayer, aData, aPending);
@@ -423,19 +423,19 @@ nsDisplayListBuilder::AddAnimationsAndTr
   } else {
     aLayer->ClearAnimations();
   }
 
   nsIContent* content = aFrame->GetContent();
   if (!content) {
     return;
   }
-  ElementAnimationCollection* transitions =
+  AnimationPlayerCollection* transitions =
     nsTransitionManager::GetAnimationsForCompositor(content, aProperty);
-  ElementAnimationCollection* animations =
+  AnimationPlayerCollection* animations =
     nsAnimationManager::GetAnimationsForCompositor(content, aProperty);
 
   if (!animations && !transitions) {
     return;
   }
 
   // If the frame is not prerendered, bail out.
   // Do this check only during layer construction; during updating the
@@ -4692,18 +4692,18 @@ nsDisplayOpacity::CanUseAsyncAnimations(
 {
   if (ActiveLayerTracker::IsStyleAnimated(mFrame, eCSSProperty_opacity)) {
     return true;
   }
 
   if (nsLayoutUtils::IsAnimationLoggingEnabled()) {
     nsCString message;
     message.AppendLiteral("Performance warning: Async animation disabled because frame was not marked active for opacity animation");
-    ElementAnimationCollection::LogAsyncAnimationFailure(message,
-                                                         Frame()->GetContent());
+    AnimationPlayerCollection::LogAsyncAnimationFailure(message,
+                                                        Frame()->GetContent());
   }
   return false;
 }
 
 bool
 nsDisplayTransform::CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder)
 {
   if (mPrerender) {
@@ -4725,18 +4725,18 @@ nsDisplayTransform::ShouldPrerenderTrans
   // the ActiveLayerManager may not have been notified yet.
   if (!ActiveLayerTracker::IsStyleAnimated(aFrame, eCSSProperty_transform) &&
       (!aFrame->GetContent() ||
        !nsLayoutUtils::HasAnimationsForCompositor(aFrame->GetContent(),
                                                   eCSSProperty_transform))) {
     if (aLogAnimations) {
       nsCString message;
       message.AppendLiteral("Performance warning: Async animation disabled because frame was not marked active for transform animation");
-      ElementAnimationCollection::LogAsyncAnimationFailure(message,
-                                                           aFrame->GetContent());
+      AnimationPlayerCollection::LogAsyncAnimationFailure(message,
+                                                          aFrame->GetContent());
     }
     return false;
   }
 
   nsSize refSize = aBuilder->RootReferenceFrame()->GetSize();
   // Only prerender if the transformed frame's size is <= the
   // reference frame size (~viewport), allowing a 1/8th fuzz factor
   // for shadows, borders, etc.
@@ -4752,18 +4752,18 @@ nsDisplayTransform::ShouldPrerenderTrans
     message.AppendInt(nsPresContext::AppUnitsToIntCSSPixels(frameSize.width));
     message.AppendLiteral(", ");
     message.AppendInt(nsPresContext::AppUnitsToIntCSSPixels(frameSize.height));
     message.AppendLiteral(") is bigger than the viewport (");
     message.AppendInt(nsPresContext::AppUnitsToIntCSSPixels(refSize.width));
     message.AppendLiteral(", ");
     message.AppendInt(nsPresContext::AppUnitsToIntCSSPixels(refSize.height));
     message.Append(')');
-    ElementAnimationCollection::LogAsyncAnimationFailure(message,
-                                                         aFrame->GetContent());
+    AnimationPlayerCollection::LogAsyncAnimationFailure(message,
+                                                        aFrame->GetContent());
   }
   return false;
 }
 
 /* If the matrix is singular, or a hidden backface is shown, the frame won't be visible or hit. */
 static bool IsFrameVisible(nsIFrame* aFrame, const Matrix4x4& aMatrix)
 {
   if (aMatrix.IsSingular()) {
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -326,29 +326,29 @@ TextAlignTrueEnabledPrefChangeCallback(c
   MOZ_ASSERT(sIndexOfTrueInTextAlignTable >= 0);
   nsCSSProps::kTextAlignKTable[sIndexOfTrueInTextAlignTable] =
     isTextAlignTrueEnabled ? eCSSKeyword_true : eCSSKeyword_UNKNOWN;
   MOZ_ASSERT(sIndexOfTrueInTextAlignLastTable >= 0);
   nsCSSProps::kTextAlignLastKTable[sIndexOfTrueInTextAlignLastTable] =
     isTextAlignTrueEnabled ? eCSSKeyword_true : eCSSKeyword_UNKNOWN;
 }
 
-static ElementAnimationCollection*
+static AnimationPlayerCollection*
 GetAnimationsOrTransitionsForCompositor(nsIContent* aContent,
                                         nsIAtom* aAnimationProperty,
                                         nsCSSProperty aProperty)
 {
-  ElementAnimationCollection* collection =
-    static_cast<ElementAnimationCollection*>(
+  AnimationPlayerCollection* collection =
+    static_cast<AnimationPlayerCollection*>(
       aContent->GetProperty(aAnimationProperty));
   if (collection) {
     bool propertyMatches = collection->HasAnimationOfProperty(aProperty);
     if (propertyMatches &&
         collection->CanPerformOnCompositorThread(
-          ElementAnimationCollection::CanAnimate_AllowPartial)) {
+          AnimationPlayerCollection::CanAnimate_AllowPartial)) {
       return collection;
     }
   }
 
   return nullptr;
 }
 
 bool
@@ -358,23 +358,23 @@ nsLayoutUtils::HasAnimationsForComposito
   if (!aContent->MayHaveAnimations())
     return false;
   return GetAnimationsOrTransitionsForCompositor(
            aContent, nsGkAtoms::animationsProperty, aProperty) ||
          GetAnimationsOrTransitionsForCompositor(
            aContent, nsGkAtoms::transitionsProperty, aProperty);
 }
 
-static ElementAnimationCollection*
+static AnimationPlayerCollection*
 GetAnimationsOrTransitions(nsIContent* aContent,
                            nsIAtom* aAnimationProperty,
                            nsCSSProperty aProperty)
 {
-  ElementAnimationCollection* collection =
-    static_cast<ElementAnimationCollection*>(aContent->GetProperty(
+  AnimationPlayerCollection* collection =
+    static_cast<AnimationPlayerCollection*>(aContent->GetProperty(
         aAnimationProperty));
   if (collection) {
     bool propertyMatches = collection->HasAnimationOfProperty(aProperty);
     if (propertyMatches) {
       return collection;
     }
   }
   return nullptr;
@@ -395,18 +395,18 @@ nsLayoutUtils::HasAnimations(nsIContent*
 bool
 nsLayoutUtils::HasCurrentAnimations(nsIContent* aContent,
                                     nsIAtom* aAnimationProperty,
                                     nsPresContext* aPresContext)
 {
   if (!aContent->MayHaveAnimations())
     return false;
 
-  ElementAnimationCollection* collection =
-    static_cast<ElementAnimationCollection*>(
+  AnimationPlayerCollection* collection =
+    static_cast<AnimationPlayerCollection*>(
       aContent->GetProperty(aAnimationProperty));
   return (collection && collection->HasCurrentAnimations());
 }
 
 static gfxSize
 GetScaleForValue(const StyleAnimationValue& aValue, nsIFrame* aFrame)
 {
   if (!aFrame) {
@@ -459,17 +459,17 @@ GetSuitableScale(float aMaxScale, float 
 }
 
 static void
 GetMinAndMaxScaleForAnimationProperty(nsIContent* aContent,
                                       nsIAtom* aAnimationProperty,
                                       gfxSize& aMaxScale,
                                       gfxSize& aMinScale)
 {
-  ElementAnimationCollection* collection =
+  AnimationPlayerCollection* collection =
     GetAnimationsOrTransitionsForCompositor(aContent, aAnimationProperty,
                                             eCSSProperty_transform);
   if (!collection)
     return;
 
   for (uint32_t animIdx = collection->mAnimations.Length(); animIdx-- != 0; ) {
     AnimationPlayer* anim = collection->mAnimations[animIdx];
     if (anim->IsFinishedTransition()) {
--- a/layout/style/AnimationCommon.cpp
+++ b/layout/style/AnimationCommon.cpp
@@ -68,37 +68,37 @@ CommonAnimationManager::Disconnect()
 
   mPresContext = nullptr;
 }
 
 void
 CommonAnimationManager::RemoveAllElementCollections()
 {
   while (!PR_CLIST_IS_EMPTY(&mElementCollections)) {
-    ElementAnimationCollection* head =
-      static_cast<ElementAnimationCollection*>(
+    AnimationPlayerCollection* head =
+      static_cast<AnimationPlayerCollection*>(
         PR_LIST_HEAD(&mElementCollections));
     head->Destroy();
   }
 }
 
-ElementAnimationCollection*
+AnimationPlayerCollection*
 CommonAnimationManager::GetAnimationsForCompositor(nsIContent* aContent,
                                                    nsIAtom* aElementProperty,
                                                    nsCSSProperty aProperty)
 {
   if (!aContent->MayHaveAnimations())
     return nullptr;
-  ElementAnimationCollection* collection =
-    static_cast<ElementAnimationCollection*>(
+  AnimationPlayerCollection* collection =
+    static_cast<AnimationPlayerCollection*>(
       aContent->GetProperty(aElementProperty));
   if (!collection ||
       !collection->HasAnimationOfProperty(aProperty) ||
       !collection->CanPerformOnCompositorThread(
-        ElementAnimationCollection::CanAnimate_AllowPartial)) {
+        AnimationPlayerCollection::CanAnimate_AllowPartial)) {
     return nullptr;
   }
 
   // This animation can be done on the compositor.
   // Mark the frame as active, in case we are able to throttle this animation.
   nsIFrame* frame = nsLayoutUtils::GetStyleFrame(collection->mElement);
   if (frame) {
     if (aProperty == eCSSProperty_opacity) {
@@ -166,17 +166,18 @@ CommonAnimationManager::SizeOfIncludingT
   return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
 }
 
 void
 CommonAnimationManager::AddStyleUpdatesTo(RestyleTracker& aTracker)
 {
   PRCList* next = PR_LIST_HEAD(&mElementCollections);
   while (next != &mElementCollections) {
-    ElementAnimationCollection* collection = static_cast<ElementAnimationCollection*>(next);
+    AnimationPlayerCollection* collection =
+      static_cast<AnimationPlayerCollection*>(next);
     next = PR_NEXT_LINK(next);
 
     if (!collection->IsForElement()) {
       // We don't support compositor-driven animation of :before/:after
       // transitions or animations, so at least skip those.
       // FIXME: We'll need to handle this before using this for the
       // transitions redesign.
       continue;
@@ -252,17 +253,17 @@ AnimValuesStyleRule::List(FILE* out, int
   }
   fputs("}\n", out);
 }
 #endif
 
 } /* end sub-namespace css */
 
 bool
-ElementAnimationCollection::CanAnimatePropertyOnCompositor(
+AnimationPlayerCollection::CanAnimatePropertyOnCompositor(
   const dom::Element *aElement,
   nsCSSProperty aProperty,
   CanAnimateFlags aFlags)
 {
   bool shouldLog = nsLayoutUtils::IsAnimationLoggingEnabled();
   if (!gfxPlatform::OffMainThreadCompositingEnabled()) {
     if (shouldLog) {
       nsCString message;
@@ -318,25 +319,25 @@ ElementAnimationCollection::CanAnimatePr
   }
   bool propertyAllowed = (aProperty == eCSSProperty_transform) ||
                          (aProperty == eCSSProperty_opacity) ||
                          (aFlags & CanAnimate_AllowPartial);
   return enabled && propertyAllowed;
 }
 
 /* static */ bool
-ElementAnimationCollection::IsCompositorAnimationDisabledForFrame(
+AnimationPlayerCollection::IsCompositorAnimationDisabledForFrame(
   nsIFrame* aFrame)
 {
   void* prop = aFrame->Properties().Get(nsIFrame::RefusedAsyncAnimation());
   return bool(reinterpret_cast<intptr_t>(prop));
 }
 
 bool
-ElementAnimationCollection::CanPerformOnCompositorThread(
+AnimationPlayerCollection::CanPerformOnCompositorThread(
   CanAnimateFlags aFlags) const
 {
   nsIFrame* frame = nsLayoutUtils::GetStyleFrame(mElement);
   if (!frame) {
     return false;
   }
 
   if (mElementProperty != nsGkAtoms::transitionsProperty &&
@@ -390,31 +391,31 @@ ElementAnimationCollection::CanPerformOn
   if (!existsProperty) {
     return false;
   }
 
   return true;
 }
 
 bool
-ElementAnimationCollection::HasAnimationOfProperty(
+AnimationPlayerCollection::HasAnimationOfProperty(
   nsCSSProperty aProperty) const
 {
   for (uint32_t animIdx = mAnimations.Length(); animIdx-- != 0; ) {
     const AnimationPlayer* anim = mAnimations[animIdx];
     if (anim->HasAnimationOfProperty(aProperty) &&
         !anim->IsFinishedTransition()) {
       return true;
     }
   }
   return false;
 }
 
 /* static */ void
-ElementAnimationCollection::LogAsyncAnimationFailure(nsCString& aMessage,
+AnimationPlayerCollection::LogAsyncAnimationFailure(nsCString& aMessage,
                                                      const nsIContent* aContent)
 {
   if (aContent) {
     aMessage.AppendLiteral(" [");
     aMessage.Append(nsAtomCString(aContent->Tag()));
 
     nsIAtom* id = aContent->GetID();
     if (id) {
@@ -424,31 +425,31 @@ ElementAnimationCollection::LogAsyncAnim
     }
     aMessage.Append(']');
   }
   aMessage.Append('\n');
   printf_stderr(aMessage.get());
 }
 
 /*static*/ void
-ElementAnimationCollection::PropertyDtor(void *aObject, nsIAtom *aPropertyName,
+AnimationPlayerCollection::PropertyDtor(void *aObject, nsIAtom *aPropertyName,
                                          void *aPropertyValue, void *aData)
 {
-  ElementAnimationCollection* collection =
-    static_cast<ElementAnimationCollection*>(aPropertyValue);
+  AnimationPlayerCollection* collection =
+    static_cast<AnimationPlayerCollection*>(aPropertyValue);
 #ifdef DEBUG
   NS_ABORT_IF_FALSE(!collection->mCalledPropertyDtor, "can't call dtor twice");
   collection->mCalledPropertyDtor = true;
 #endif
   delete collection;
 }
 
 void
-ElementAnimationCollection::EnsureStyleRuleFor(TimeStamp aRefreshTime,
-                                               EnsureStyleRuleFlags aFlags)
+AnimationPlayerCollection::EnsureStyleRuleFor(TimeStamp aRefreshTime,
+                                              EnsureStyleRuleFlags aFlags)
 {
   if (!mNeedsRefreshes) {
     mStyleRuleRefreshTime = aRefreshTime;
     return;
   }
 
   // If we're performing animations on the compositor thread, then we can skip
   // most of the work in this method. But even if we are throttled, then we
@@ -597,17 +598,17 @@ ElementAnimationCollection::EnsureStyleR
         NS_ABORT_IF_FALSE(result, "interpolate must succeed now");
       }
     }
   }
 }
 
 
 bool
-ElementAnimationCollection::CanThrottleTransformChanges(TimeStamp aTime)
+AnimationPlayerCollection::CanThrottleTransformChanges(TimeStamp aTime)
 {
   if (!nsLayoutUtils::AreAsyncAnimationsEnabled()) {
     return false;
   }
 
   // If we know that the animation cannot cause overflow,
   // we can just disable flushes for this animation.
 
@@ -635,17 +636,17 @@ ElementAnimationCollection::CanThrottleT
       scrollable->GetLogicalScrollPosition() == nsPoint(0, 0)) {
     return true;
   }
 
   return false;
 }
 
 bool
-ElementAnimationCollection::CanThrottleAnimation(TimeStamp aTime)
+AnimationPlayerCollection::CanThrottleAnimation(TimeStamp aTime)
 {
   nsIFrame* frame = nsLayoutUtils::GetStyleFrame(mElement);
   if (!frame) {
     return false;
   }
 
   bool hasTransform = HasAnimationOfProperty(eCSSProperty_transform);
   bool hasOpacity = HasAnimationOfProperty(eCSSProperty_opacity);
@@ -666,25 +667,25 @@ ElementAnimationCollection::CanThrottleA
   if (!layer || mAnimationGeneration > layer->GetAnimationGeneration()) {
     return false;
   }
 
   return CanThrottleTransformChanges(aTime);
 }
 
 void
-ElementAnimationCollection::UpdateAnimationGeneration(
+AnimationPlayerCollection::UpdateAnimationGeneration(
   nsPresContext* aPresContext)
 {
   mAnimationGeneration =
     aPresContext->RestyleManager()->GetAnimationGeneration();
 }
 
 bool
-ElementAnimationCollection::HasCurrentAnimations()
+AnimationPlayerCollection::HasCurrentAnimations()
 {
   for (uint32_t animIdx = mAnimations.Length(); animIdx-- != 0; ) {
     if (mAnimations[animIdx]->IsCurrent()) {
       return true;
     }
   }
 
   return false;
--- a/layout/style/AnimationCommon.h
+++ b/layout/style/AnimationCommon.h
@@ -24,17 +24,17 @@
 
 class nsIFrame;
 class nsPresContext;
 class nsStyleChangeList;
 
 namespace mozilla {
 
 class RestyleTracker;
-struct ElementAnimationCollection;
+struct AnimationPlayerCollection;
 
 namespace css {
 
 bool IsGeometricProperty(nsCSSProperty aProperty);
 
 class CommonAnimationManager : public nsIStyleRuleProcessor,
                                public nsARefreshObserver {
 public:
@@ -73,26 +73,26 @@ public:
   static bool ExtractComputedValueForTransition(
                   nsCSSProperty aProperty,
                   nsStyleContext* aStyleContext,
                   mozilla::StyleAnimationValue& aComputedValue);
 protected:
   virtual ~CommonAnimationManager();
 
   // For ElementCollectionRemoved
-  friend struct mozilla::ElementAnimationCollection;
+  friend struct mozilla::AnimationPlayerCollection;
 
   virtual void
-  AddElementCollection(ElementAnimationCollection* aCollection) = 0;
+  AddElementCollection(AnimationPlayerCollection* aCollection) = 0;
   virtual void ElementCollectionRemoved() = 0;
   void RemoveAllElementCollections();
 
   // When this returns a value other than nullptr, it also,
   // as a side-effect, notifies the ActiveLayerTracker.
-  static ElementAnimationCollection*
+  static AnimationPlayerCollection*
   GetAnimationsForCompositor(nsIContent* aContent,
                              nsIAtom* aElementProperty,
                              nsCSSProperty aProperty);
 
   PRCList mElementCollections;
   nsPresContext *mPresContext; // weak (non-null from ctor to Disconnect)
 };
 
@@ -135,45 +135,45 @@ private:
   ~AnimValuesStyleRule() {}
 
   InfallibleTArray<PropertyValuePair> mPropertyValuePairs;
 };
 
 } /* end css sub-namespace */
 
 typedef InfallibleTArray<nsRefPtr<dom::AnimationPlayer> >
-  ElementAnimationPtrArray;
+  AnimationPlayerPtrArray;
 
 enum EnsureStyleRuleFlags {
   EnsureStyleRule_IsThrottled,
   EnsureStyleRule_IsNotThrottled
 };
 
-struct ElementAnimationCollection : public PRCList
+struct AnimationPlayerCollection : public PRCList
 {
-  ElementAnimationCollection(dom::Element *aElement, nsIAtom *aElementProperty,
-                             mozilla::css::CommonAnimationManager *aManager,
-                             TimeStamp aNow)
+  AnimationPlayerCollection(dom::Element *aElement, nsIAtom *aElementProperty,
+                            mozilla::css::CommonAnimationManager *aManager,
+                            TimeStamp aNow)
     : mElement(aElement)
     , mElementProperty(aElementProperty)
     , mManager(aManager)
     , mAnimationGeneration(0)
     , mNeedsRefreshes(true)
 #ifdef DEBUG
     , mCalledPropertyDtor(false)
 #endif
   {
-    MOZ_COUNT_CTOR(ElementAnimationCollection);
+    MOZ_COUNT_CTOR(AnimationPlayerCollection);
     PR_INIT_CLIST(this);
   }
-  ~ElementAnimationCollection()
+  ~AnimationPlayerCollection()
   {
     NS_ABORT_IF_FALSE(mCalledPropertyDtor,
                       "must call destructor through element property dtor");
-    MOZ_COUNT_DTOR(ElementAnimationCollection);
+    MOZ_COUNT_DTOR(AnimationPlayerCollection);
     PR_REMOVE_LINK(this);
     mManager->ElementCollectionRemoved();
   }
 
   void Destroy()
   {
     // This will call our destructor.
     mElement->DeleteProperty(mElementProperty);
@@ -263,17 +263,17 @@ struct ElementAnimationCollection : publ
   dom::Element *mElement;
 
   // the atom we use in mElement's prop table (must be a static atom,
   // i.e., in an atom list)
   nsIAtom *mElementProperty;
 
   mozilla::css::CommonAnimationManager *mManager;
 
-  mozilla::ElementAnimationPtrArray mAnimations;
+  mozilla::AnimationPlayerPtrArray mAnimations;
 
   // This style rule contains the style data for currently animating
   // values.  It only matches when styling with animation.  When we
   // style without animation, we need to not use it so that we can
   // detect any new changes; if necessary we restyle immediately
   // afterwards with animation.
   // NOTE: If we don't need to apply any styles, mStyleRule will be
   // null, but mStyleRuleRefreshTime will still be valid.
--- a/layout/style/nsAnimationManager.cpp
+++ b/layout/style/nsAnimationManager.cpp
@@ -22,28 +22,28 @@
 #include "nsIDocument.h"
 #include <math.h>
 
 using namespace mozilla;
 using namespace mozilla::css;
 using mozilla::dom::AnimationPlayer;
 
 void
-nsAnimationManager::UpdateStyleAndEvents(ElementAnimationCollection*
+nsAnimationManager::UpdateStyleAndEvents(AnimationPlayerCollection*
                                            aCollection,
                                          TimeStamp aRefreshTime,
                                          EnsureStyleRuleFlags aFlags)
 {
   aCollection->EnsureStyleRuleFor(aRefreshTime, aFlags);
   GetEventsForCurrentTime(aCollection, mPendingEvents);
   CheckNeedsRefresh();
 }
 
 void
-nsAnimationManager::GetEventsForCurrentTime(ElementAnimationCollection*
+nsAnimationManager::GetEventsForCurrentTime(AnimationPlayerCollection*
                                               aCollection,
                                             EventArray& aEventsToDispatch)
 {
   for (uint32_t animIdx = aCollection->mAnimations.Length(); animIdx-- != 0; ) {
     AnimationPlayer* anim = aCollection->mAnimations[animIdx];
 
     ComputedTiming computedTiming = anim->GetComputedTiming(anim->mTiming);
 
@@ -104,20 +104,20 @@ nsAnimationManager::GetEventsForCurrentT
                                 aCollection->PseudoElement());
           aEventsToDispatch.AppendElement(ei);
         }
         break;
     }
   }
 }
 
-ElementAnimationCollection*
-nsAnimationManager::GetElementAnimations(dom::Element *aElement,
-                                         nsCSSPseudoElements::Type aPseudoType,
-                                         bool aCreateIfNeeded)
+AnimationPlayerCollection*
+nsAnimationManager::GetAnimationPlayers(dom::Element *aElement,
+                                        nsCSSPseudoElements::Type aPseudoType,
+                                        bool aCreateIfNeeded)
 {
   if (!aCreateIfNeeded && PR_CLIST_IS_EMPTY(&mElementCollections)) {
     // Early return for the most common case.
     return nullptr;
   }
 
   nsIAtom *propName;
   if (aPseudoType == nsCSSPseudoElements::ePseudo_NotPseudoElement) {
@@ -127,26 +127,26 @@ nsAnimationManager::GetElementAnimations
   } else if (aPseudoType == nsCSSPseudoElements::ePseudo_after) {
     propName = nsGkAtoms::animationsOfAfterProperty;
   } else {
     NS_ASSERTION(!aCreateIfNeeded,
                  "should never try to create transitions for pseudo "
                  "other than :before or :after");
     return nullptr;
   }
-  ElementAnimationCollection* collection =
-    static_cast<ElementAnimationCollection*>(aElement->GetProperty(propName));
+  AnimationPlayerCollection* collection =
+    static_cast<AnimationPlayerCollection*>(aElement->GetProperty(propName));
   if (!collection && aCreateIfNeeded) {
     // FIXME: Consider arena-allocating?
     collection =
-      new ElementAnimationCollection(aElement, propName, this,
+      new AnimationPlayerCollection(aElement, propName, this,
         mPresContext->RefreshDriver()->MostRecentRefresh());
     nsresult rv =
       aElement->SetProperty(propName, collection,
-                            &ElementAnimationCollection::PropertyDtor, false);
+                            &AnimationPlayerCollection::PropertyDtor, false);
     if (NS_FAILED(rv)) {
       NS_WARNING("SetProperty failed");
       delete collection;
       return nullptr;
     }
     if (propName == nsGkAtoms::animationsProperty) {
       aElement->SetMayHaveAnimations();
     }
@@ -228,27 +228,27 @@ nsAnimationManager::CheckAnimationRule(n
     }
 
     // Everything that causes our animation data to change triggers a
     // style change, which in turn triggers a non-animation restyle.
     // Likewise, when we initially construct frames, we're not in a
     // style change, but also not in an animation restyle.
 
     const nsStyleDisplay* disp = aStyleContext->StyleDisplay();
-    ElementAnimationCollection* collection =
-      GetElementAnimations(aElement, aStyleContext->GetPseudoType(), false);
+    AnimationPlayerCollection* collection =
+      GetAnimationPlayers(aElement, aStyleContext->GetPseudoType(), false);
     if (!collection &&
         disp->mAnimationNameCount == 1 &&
         disp->mAnimations[0].GetName().IsEmpty()) {
       return nullptr;
     }
 
     // build the animations list
     dom::AnimationTimeline* timeline = aElement->OwnerDoc()->Timeline();
-    ElementAnimationPtrArray newAnimations;
+    AnimationPlayerPtrArray newAnimations;
     BuildAnimations(aStyleContext, timeline, newAnimations);
 
     if (newAnimations.IsEmpty()) {
       if (collection) {
         collection->Destroy();
       }
       return nullptr;
     }
@@ -325,17 +325,17 @@ nsAnimationManager::CheckAnimationRule(n
           // iterating over the list of old iterations.
           newAnim = nullptr;
           newAnimations.ReplaceElementAt(newIdx, oldAnim);
           collection->mAnimations.RemoveElementAt(oldIdx);
         }
       }
     } else {
       collection =
-        GetElementAnimations(aElement, aStyleContext->GetPseudoType(), true);
+        GetAnimationPlayers(aElement, aStyleContext->GetPseudoType(), true);
     }
     collection->mAnimations.SwapElements(newAnimations);
     collection->mNeedsRefreshes = true;
 
     TimeStamp refreshTime = mPresContext->RefreshDriver()->MostRecentRefresh();
     UpdateStyleAndEvents(collection, refreshTime,
                          EnsureStyleRule_IsNotThrottled);
     // We don't actually dispatch the mPendingEvents now.  We'll either
@@ -399,17 +399,17 @@ ResolvedStyleCache::Get(nsPresContext *a
     result = resultStrong;
   }
   return result;
 }
 
 void
 nsAnimationManager::BuildAnimations(nsStyleContext* aStyleContext,
                                     dom::AnimationTimeline* aTimeline,
-                                    ElementAnimationPtrArray& aAnimations)
+                                    AnimationPlayerPtrArray& aAnimations)
 {
   NS_ABORT_IF_FALSE(aAnimations.IsEmpty(), "expect empty array");
 
   ResolvedStyleCache resolvedStyles;
 
   const nsStyleDisplay *disp = aStyleContext->StyleDisplay();
   TimeStamp now = aTimeline->GetCurrentTimeStamp();
 
@@ -642,18 +642,18 @@ nsAnimationManager::GetAnimationRule(moz
     aPseudoType == nsCSSPseudoElements::ePseudo_after,
     "forbidden pseudo type");
 
   if (!mPresContext->IsDynamic()) {
     // For print or print preview, ignore animations.
     return nullptr;
   }
 
-  ElementAnimationCollection* collection =
-    GetElementAnimations(aElement, aPseudoType, false);
+  AnimationPlayerCollection* collection =
+    GetAnimationPlayers(aElement, aPseudoType, false);
   if (!collection) {
     return nullptr;
   }
 
   if (mPresContext->IsProcessingRestyles() &&
       !mPresContext->IsProcessingAnimationStyleChange()) {
     // During the non-animation part of processing restyles, we don't
     // add the animation rule.
@@ -688,37 +688,37 @@ nsAnimationManager::WillRefresh(mozilla:
     return;
   }
 
   FlushAnimations(Can_Throttle);
 }
 
 void
 nsAnimationManager::AddElementCollection(
-  ElementAnimationCollection* aCollection)
+  AnimationPlayerCollection* aCollection)
 {
   if (!mObservingRefreshDriver) {
     NS_ASSERTION(
-      static_cast<ElementAnimationCollection*>(aCollection)->mNeedsRefreshes,
+      static_cast<AnimationPlayerCollection*>(aCollection)->mNeedsRefreshes,
       "Added data which doesn't need refreshing?");
     // We need to observe the refresh driver.
     mPresContext->RefreshDriver()->AddRefreshObserver(this, Flush_Style);
     mObservingRefreshDriver = true;
   }
 
   PR_INSERT_BEFORE(aCollection, &mElementCollections);
 }
 
 void
 nsAnimationManager::CheckNeedsRefresh()
 {
   for (PRCList *l = PR_LIST_HEAD(&mElementCollections);
        l != &mElementCollections;
        l = PR_NEXT_LINK(l)) {
-    if (static_cast<ElementAnimationCollection*>(l)->mNeedsRefreshes) {
+    if (static_cast<AnimationPlayerCollection*>(l)->mNeedsRefreshes) {
       if (!mObservingRefreshDriver) {
         mPresContext->RefreshDriver()->AddRefreshObserver(this, Flush_Style);
         mObservingRefreshDriver = true;
       }
       return;
     }
   }
   if (mObservingRefreshDriver) {
@@ -733,21 +733,21 @@ nsAnimationManager::FlushAnimations(Flus
   // FIXME: check that there's at least one style rule that's not
   // in its "done" state, and if there isn't, remove ourselves from
   // the refresh driver (but leave the animations!).
   TimeStamp now = mPresContext->RefreshDriver()->MostRecentRefresh();
   bool didThrottle = false;
   for (PRCList *l = PR_LIST_HEAD(&mElementCollections);
        l != &mElementCollections;
        l = PR_NEXT_LINK(l)) {
-    ElementAnimationCollection* collection =
-      static_cast<ElementAnimationCollection*>(l);
+    AnimationPlayerCollection* collection =
+      static_cast<AnimationPlayerCollection*>(l);
     bool canThrottleTick = aFlags == Can_Throttle &&
       collection->CanPerformOnCompositorThread(
-        ElementAnimationCollection::CanAnimateFlags(0)) &&
+        AnimationPlayerCollection::CanAnimateFlags(0)) &&
       collection->CanThrottleAnimation(now);
 
     nsRefPtr<css::AnimValuesStyleRule> oldStyleRule = collection->mStyleRule;
     UpdateStyleAndEvents(collection, now, canThrottleTick
                                           ? EnsureStyleRule_IsThrottled
                                           : EnsureStyleRule_IsNotThrottled);
     if (oldStyleRule != collection->mStyleRule) {
       collection->PostRestyleForAnimation(mPresContext);
--- a/layout/style/nsAnimationManager.h
+++ b/layout/style/nsAnimationManager.h
@@ -53,17 +53,17 @@ class nsAnimationManager MOZ_FINAL
 {
 public:
   nsAnimationManager(nsPresContext *aPresContext)
     : mozilla::css::CommonAnimationManager(aPresContext)
     , mObservingRefreshDriver(false)
   {
   }
 
-  static mozilla::ElementAnimationCollection*
+  static mozilla::AnimationPlayerCollection*
   GetAnimationsForCompositor(nsIContent* aContent, nsCSSProperty aProperty)
   {
     return mozilla::css::CommonAnimationManager::GetAnimationsForCompositor(
       aContent, nsGkAtoms::animationsProperty, aProperty);
   }
 
   // Returns true if aContent or any of its ancestors has an animation.
   static bool ContentOrAncestorHasAnimation(nsIContent* aContent) {
@@ -71,20 +71,20 @@ public:
       if (aContent->GetProperty(nsGkAtoms::animationsProperty)) {
         return true;
       }
     } while ((aContent = aContent->GetParent()));
 
     return false;
   }
 
-  void UpdateStyleAndEvents(mozilla::ElementAnimationCollection* aEA,
+  void UpdateStyleAndEvents(mozilla::AnimationPlayerCollection* aEA,
                             mozilla::TimeStamp aRefreshTime,
                             mozilla::EnsureStyleRuleFlags aFlags);
-  void GetEventsForCurrentTime(mozilla::ElementAnimationCollection* aEA,
+  void GetEventsForCurrentTime(mozilla::AnimationPlayerCollection* aEA,
                                EventArray &aEventsToDispatch);
 
   // nsIStyleRuleProcessor (parts)
   virtual void RulesMatching(ElementRuleProcessorData* aData) MOZ_OVERRIDE;
   virtual void RulesMatching(PseudoElementRuleProcessorData* aData) MOZ_OVERRIDE;
   virtual void RulesMatching(AnonBoxRuleProcessorData* aData) MOZ_OVERRIDE;
 #ifdef MOZ_XUL
   virtual void RulesMatching(XULTreeRuleProcessorData* aData) MOZ_OVERRIDE;
@@ -122,38 +122,38 @@ public:
    */
   void DispatchEvents() {
     // Fast-path the common case: no events
     if (!mPendingEvents.IsEmpty()) {
       DoDispatchEvents();
     }
   }
 
-  mozilla::ElementAnimationCollection*
-  GetElementAnimations(mozilla::dom::Element *aElement,
-                       nsCSSPseudoElements::Type aPseudoType,
-                       bool aCreateIfNeeded);
+  mozilla::AnimationPlayerCollection*
+  GetAnimationPlayers(mozilla::dom::Element *aElement,
+                      nsCSSPseudoElements::Type aPseudoType,
+                      bool aCreateIfNeeded);
 
 protected:
   virtual void ElementCollectionRemoved() MOZ_OVERRIDE
   {
     CheckNeedsRefresh();
   }
   virtual void
-  AddElementCollection(mozilla::ElementAnimationCollection* aData) MOZ_OVERRIDE;
+  AddElementCollection(mozilla::AnimationPlayerCollection* aData) MOZ_OVERRIDE;
 
   /**
    * Check to see if we should stop or start observing the refresh driver
    */
   void CheckNeedsRefresh();
 
 private:
   void BuildAnimations(nsStyleContext* aStyleContext,
                        mozilla::dom::AnimationTimeline* aTimeline,
-                       mozilla::ElementAnimationPtrArray& aAnimations);
+                       mozilla::AnimationPlayerPtrArray& aAnimations);
   bool BuildSegment(InfallibleTArray<mozilla::AnimationPropertySegment>&
                       aSegments,
                     nsCSSProperty aProperty,
                     const mozilla::StyleAnimation& aAnimation,
                     float aFromKey, nsStyleContext* aFromContext,
                     mozilla::css::Declaration* aFromDeclaration,
                     float aToKey, nsStyleContext* aToContext);
   nsIStyleRule* GetAnimationRule(mozilla::dom::Element* aElement,
--- a/layout/style/nsStyleSet.cpp
+++ b/layout/style/nsStyleSet.cpp
@@ -1370,35 +1370,35 @@ nsStyleSet::RuleNodeWithReplacement(Elem
     if (doReplace) {
       switch (level->mLevelReplacementHint) {
         case eRestyle_CSSAnimations: {
           // FIXME: This should probably be more similar to what
           // FileRules does; this feels like too much poking into the
           // internals of nsAnimationManager.
           nsAnimationManager* animationManager =
             PresContext()->AnimationManager();
-          ElementAnimationCollection* collection = animationManager->GetElementAnimations(
-            aElement, aPseudoType, false);
+          AnimationPlayerCollection* collection =
+            animationManager->GetAnimationPlayers(aElement, aPseudoType, false);
 
           if (collection) {
             animationManager->UpdateStyleAndEvents(
               collection, PresContext()->RefreshDriver()->MostRecentRefresh(),
               EnsureStyleRule_IsNotThrottled);
             if (collection->mStyleRule) {
               ruleWalker.ForwardOnPossiblyCSSRule(collection->mStyleRule);
             }
           }
           break;
         }
         case eRestyle_CSSTransitions: {
           // FIXME: This should probably be more similar to what
           // FileRules does; this feels like too much poking into the
           // internals of nsTransitionManager.
           nsPresContext* presContext = PresContext();
-          ElementAnimationCollection* collection =
+          AnimationPlayerCollection* collection =
             presContext->TransitionManager()->GetElementTransitions(
               aElement, aPseudoType, false);
 
           if (collection) {
             collection->EnsureStyleRuleFor(
               presContext->RefreshDriver()->MostRecentRefresh(),
               EnsureStyleRule_IsNotThrottled);
             if (collection->mStyleRule) {
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -79,17 +79,17 @@ nsTransitionManager::ElementCollectionRe
   // the refresh driver.
   if (PR_CLIST_IS_EMPTY(&mElementCollections)) {
     mPresContext->RefreshDriver()->RemoveRefreshObserver(this, Flush_Style);
   }
 }
 
 void
 nsTransitionManager::AddElementCollection(
-  ElementAnimationCollection* aCollection)
+  AnimationPlayerCollection* aCollection)
 {
   if (PR_CLIST_IS_EMPTY(&mElementCollections)) {
     // We need to observe the refresh driver.
     nsRefreshDriver *rd = mPresContext->RefreshDriver();
     rd->AddRefreshObserver(this, Flush_Style);
   }
 
   PR_INSERT_BEFORE(aCollection, &mElementCollections);
@@ -145,17 +145,17 @@ nsTransitionManager::StyleContextChanged
                   aElement->Tag() == nsGkAtoms::mozgeneratedcontentafter),
                  "Unexpected aElement coming through");
 
     // Else the element we want to use from now on is the element the
     // :before or :after is attached to.
     aElement = aElement->GetParent()->AsElement();
   }
 
-  ElementAnimationCollection* collection =
+  AnimationPlayerCollection* collection =
     GetElementTransitions(aElement, pseudoType, false);
   if (!collection &&
       disp->mTransitionPropertyCount == 1 &&
       disp->mTransitions[0].GetDelay() == 0.0f &&
       disp->mTransitions[0].GetDuration() == 0.0f) {
     return nullptr;
   }
 
@@ -249,17 +249,17 @@ nsTransitionManager::StyleContextChanged
             allTransitionProperties.AddProperty(*subprop);
           }
         } else {
           allTransitionProperties.AddProperty(property);
         }
       }
     }
 
-    ElementAnimationPtrArray& animations = collection->mAnimations;
+    AnimationPlayerPtrArray& animations = collection->mAnimations;
     uint32_t i = animations.Length();
     NS_ABORT_IF_FALSE(i != 0, "empty transitions list?");
     StyleAnimationValue currentValue;
     do {
       --i;
       AnimationPlayer* animation = animations[i];
       MOZ_ASSERT(animation->mProperties.Length() == 1,
                  "Should have one animation property for a transition");
@@ -306,17 +306,17 @@ nsTransitionManager::StyleContextChanged
   // descendants don't start their own transitions.  (In the case of
   // negative transition delay, this covering rule produces different
   // results than applying the transition rule immediately would).
   // Our caller is responsible for restyling again using this covering
   // rule.
 
   nsRefPtr<css::AnimValuesStyleRule> coverRule = new css::AnimValuesStyleRule;
 
-  ElementAnimationPtrArray& animations = collection->mAnimations;
+  AnimationPlayerPtrArray& animations = collection->mAnimations;
   for (uint32_t i = 0, i_end = animations.Length(); i < i_end; ++i) {
     AnimationPlayer* animation = animations[i];
     MOZ_ASSERT(animation->mProperties.Length() == 1,
                "Should have one animation property for a transition");
     MOZ_ASSERT(animation->mProperties[0].mSegments.Length() == 1,
                "Animation property should have one segment for a transition");
     AnimationProperty& prop = animation->mProperties[0];
     AnimationPropertySegment& segment = prop.mSegments[0];
@@ -330,17 +330,17 @@ nsTransitionManager::StyleContextChanged
   return coverRule.forget();
 }
 
 void
 nsTransitionManager::ConsiderStartingTransition(
   nsCSSProperty aProperty,
   const StyleTransition& aTransition,
   dom::Element* aElement,
-  ElementAnimationCollection*& aElementTransitions,
+  AnimationPlayerCollection*& aElementTransitions,
   nsStyleContext* aOldStyleContext,
   nsStyleContext* aNewStyleContext,
   bool* aStartedAny,
   nsCSSPropertySet* aWhichStarted)
 {
   // IsShorthand itself will assert if aProperty is not a property.
   NS_ABORT_IF_FALSE(!nsCSSProps::IsShorthand(aProperty),
                     "property out of range");
@@ -380,17 +380,17 @@ nsTransitionManager::ConsiderStartingTra
     // CanInterpolate method, but it seems fine for now.)
     StyleAnimationValue::Interpolate(aProperty, startValue, endValue,
                                      0.5, dummyValue);
 
   bool haveCurrentTransition = false;
   size_t currentIndex = nsTArray<ElementPropertyTransition>::NoIndex;
   const ElementPropertyTransition *oldPT = nullptr;
   if (aElementTransitions) {
-    ElementAnimationPtrArray& animations = aElementTransitions->mAnimations;
+    AnimationPlayerPtrArray& animations = aElementTransitions->mAnimations;
     for (size_t i = 0, i_end = animations.Length(); i < i_end; ++i) {
       MOZ_ASSERT(animations[i]->mProperties.Length() == 1,
                  "Should have one animation property for a transition");
       if (animations[i]->mProperties[0].mProperty == aProperty) {
         haveCurrentTransition = true;
         currentIndex = i;
         oldPT =
           aElementTransitions->mAnimations[currentIndex]->AsTransition();
@@ -421,17 +421,17 @@ nsTransitionManager::ConsiderStartingTra
   if (!shouldAnimate) {
     if (haveCurrentTransition) {
       // We're in the middle of a transition, and just got a non-transition
       // style change to something that we can't animate.  This might happen
       // because we got a non-transition style change changing to the current
       // in-progress value (which is particularly easy to cause when we're
       // currently in the 'transition-delay').  It also might happen because we
       // just got a style change to a value that can't be interpolated.
-      ElementAnimationPtrArray& animations = aElementTransitions->mAnimations;
+      AnimationPlayerPtrArray& animations = aElementTransitions->mAnimations;
       animations.RemoveElementAt(currentIndex);
       aElementTransitions->UpdateAnimationGeneration(mPresContext);
 
       if (animations.IsEmpty()) {
         aElementTransitions->Destroy();
         // |aElementTransitions| is now a dangling pointer!
         aElementTransitions = nullptr;
       }
@@ -513,17 +513,17 @@ nsTransitionManager::ConsiderStartingTra
       GetElementTransitions(aElement, aNewStyleContext->GetPseudoType(),
                             true);
     if (!aElementTransitions) {
       NS_WARNING("allocating CommonAnimationManager failed");
       return;
     }
   }
 
-  ElementAnimationPtrArray &animations = aElementTransitions->mAnimations;
+  AnimationPlayerPtrArray &animations = aElementTransitions->mAnimations;
 #ifdef DEBUG
   for (uint32_t i = 0, i_end = animations.Length(); i < i_end; ++i) {
     NS_ABORT_IF_FALSE(animations[i]->mProperties.Length() == 1,
                       "Should have one animation property for a transition");
     NS_ABORT_IF_FALSE(i == currentIndex ||
                       animations[i]->mProperties[0].mProperty != aProperty,
                       "duplicate transitions for property");
   }
@@ -538,17 +538,17 @@ nsTransitionManager::ConsiderStartingTra
   }
   aElementTransitions->UpdateAnimationGeneration(mPresContext);
   aElementTransitions->PostRestyleForAnimation(presContext);
 
   *aStartedAny = true;
   aWhichStarted->AddProperty(aProperty);
 }
 
-ElementAnimationCollection*
+AnimationPlayerCollection*
 nsTransitionManager::GetElementTransitions(
   dom::Element *aElement,
   nsCSSPseudoElements::Type aPseudoType,
   bool aCreateIfNeeded)
 {
   if (!aCreateIfNeeded && PR_CLIST_IS_EMPTY(&mElementCollections)) {
     // Early return for the most common case.
     return nullptr;
@@ -562,25 +562,25 @@ nsTransitionManager::GetElementTransitio
   } else if (aPseudoType == nsCSSPseudoElements::ePseudo_after) {
     propName = nsGkAtoms::transitionsOfAfterProperty;
   } else {
     NS_ASSERTION(!aCreateIfNeeded,
                  "should never try to create transitions for pseudo "
                  "other than :before or :after");
     return nullptr;
   }
-  ElementAnimationCollection* collection =
-    static_cast<ElementAnimationCollection*>(aElement->GetProperty(propName));
+  AnimationPlayerCollection* collection =
+    static_cast<AnimationPlayerCollection*>(aElement->GetProperty(propName));
   if (!collection && aCreateIfNeeded) {
     // FIXME: Consider arena-allocating?
-    collection = new ElementAnimationCollection(aElement, propName, this,
+    collection = new AnimationPlayerCollection(aElement, propName, this,
       mPresContext->RefreshDriver()->MostRecentRefresh());
     nsresult rv =
       aElement->SetProperty(propName, collection,
-                            &ElementAnimationCollection::PropertyDtor, false);
+                            &AnimationPlayerCollection::PropertyDtor, false);
     if (NS_FAILED(rv)) {
       NS_WARNING("SetProperty failed");
       delete collection;
       return nullptr;
     }
     if (propName == nsGkAtoms::transitionsProperty) {
       aElement->SetMayHaveAnimations();
     }
@@ -595,17 +595,17 @@ nsTransitionManager::GetElementTransitio
  * nsIStyleRuleProcessor implementation
  */
 
 void
 nsTransitionManager::WalkTransitionRule(
   ElementDependentRuleProcessorData* aData,
   nsCSSPseudoElements::Type aPseudoType)
 {
-  ElementAnimationCollection* collection =
+  AnimationPlayerCollection* collection =
     GetElementTransitions(aData->mElement, aPseudoType, false);
   if (!collection) {
     return;
   }
 
   if (!mPresContext->IsDynamic()) {
     // For print or print preview, ignore animations.
     return;
@@ -734,23 +734,23 @@ nsTransitionManager::FlushTransitions(Fl
   nsTArray<TransitionEventInfo> events;
   TimeStamp now = mPresContext->RefreshDriver()->MostRecentRefresh();
   bool didThrottle = false;
   // Trim transitions that have completed, post restyle events for frames that
   // are still transitioning, and start transitions with delays.
   {
     PRCList *next = PR_LIST_HEAD(&mElementCollections);
     while (next != &mElementCollections) {
-      ElementAnimationCollection* collection =
-        static_cast<ElementAnimationCollection*>(next);
+      AnimationPlayerCollection* collection =
+        static_cast<AnimationPlayerCollection*>(next);
       next = PR_NEXT_LINK(next);
 
       bool canThrottleTick = aFlags == Can_Throttle &&
         collection->CanPerformOnCompositorThread(
-          ElementAnimationCollection::CanAnimateFlags(0)) &&
+          AnimationPlayerCollection::CanAnimateFlags(0)) &&
         collection->CanThrottleAnimation(now);
 
       NS_ABORT_IF_FALSE(collection->mElement->GetCrossShadowCurrentDoc() ==
                           mPresContext->Document(),
                         "Element::UnbindFromTree should have "
                         "destroyed the element transitions object");
 
       uint32_t i = collection->mAnimations.Length();
--- a/layout/style/nsTransitionManager.h
+++ b/layout/style/nsTransitionManager.h
@@ -67,36 +67,36 @@ class nsTransitionManager MOZ_FINAL
 {
 public:
   nsTransitionManager(nsPresContext *aPresContext)
     : mozilla::css::CommonAnimationManager(aPresContext)
     , mInAnimationOnlyStyleUpdate(false)
   {
   }
 
-  typedef mozilla::ElementAnimationCollection ElementAnimationCollection;
+  typedef mozilla::AnimationPlayerCollection AnimationPlayerCollection;
 
-  static ElementAnimationCollection*
+  static AnimationPlayerCollection*
   GetTransitions(nsIContent* aContent) {
-    return static_cast<ElementAnimationCollection*>
+    return static_cast<AnimationPlayerCollection*>
       (aContent->GetProperty(nsGkAtoms::transitionsProperty));
   }
 
   // Returns true if aContent or any of its ancestors has a transition.
   static bool ContentOrAncestorHasTransition(nsIContent* aContent) {
     do {
       if (GetTransitions(aContent)) {
         return true;
       }
     } while ((aContent = aContent->GetParent()));
 
     return false;
   }
 
-  static ElementAnimationCollection*
+  static AnimationPlayerCollection*
   GetAnimationsForCompositor(nsIContent* aContent, nsCSSProperty aProperty)
   {
     return mozilla::css::CommonAnimationManager::GetAnimationsForCompositor(
       aContent, nsGkAtoms::transitionsProperty, aProperty);
   }
 
   /**
    * StyleContextChanged
@@ -135,32 +135,32 @@ public:
   virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
     MOZ_MUST_OVERRIDE MOZ_OVERRIDE;
 
   // nsARefreshObserver
   virtual void WillRefresh(mozilla::TimeStamp aTime) MOZ_OVERRIDE;
 
   void FlushTransitions(FlushFlags aFlags);
 
-  ElementAnimationCollection* GetElementTransitions(
+  AnimationPlayerCollection* GetElementTransitions(
     mozilla::dom::Element *aElement,
     nsCSSPseudoElements::Type aPseudoType,
     bool aCreateIfNeeded);
 
 protected:
   virtual void ElementCollectionRemoved() MOZ_OVERRIDE;
   virtual void
-  AddElementCollection(ElementAnimationCollection* aCollection) MOZ_OVERRIDE;
+  AddElementCollection(AnimationPlayerCollection* aCollection) MOZ_OVERRIDE;
 
 private:
   void
   ConsiderStartingTransition(nsCSSProperty aProperty,
                              const mozilla::StyleTransition& aTransition,
                              mozilla::dom::Element* aElement,
-                             ElementAnimationCollection*& aElementTransitions,
+                             AnimationPlayerCollection*& aElementTransitions,
                              nsStyleContext* aOldStyleContext,
                              nsStyleContext* aNewStyleContext,
                              bool* aStartedAny,
                              nsCSSPropertySet* aWhichStarted);
   void WalkTransitionRule(ElementDependentRuleProcessorData* aData,
                           nsCSSPseudoElements::Type aPseudoType);
 
   bool mInAnimationOnlyStyleUpdate;