Backed out changeset a4fb4e4b1c8b (bug 1180125)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 29 Jul 2015 17:32:19 +0200
changeset 281533 a7d219e6f0a012762f66460160be83a7509cc6a1
parent 281532 cabf79f37ff89b35333756e3044b9b9cbf2285f7
child 281534 fe818bba6c2ff2ce64e847be5cae16e3224aec8d
push id3885
push userbcampen@mozilla.com
push dateWed, 29 Jul 2015 18:32:33 +0000
bugs1180125
milestone42.0a1
backs outa4fb4e4b1c8bc2b7e13ca1e1c2c87413928041fd
Backed out changeset a4fb4e4b1c8b (bug 1180125)
dom/animation/Animation.cpp
dom/animation/Animation.h
dom/animation/KeyframeEffect.cpp
dom/animation/KeyframeEffect.h
layout/base/RestyleManager.cpp
layout/build/nsLayoutStatics.cpp
layout/style/AnimationCommon.cpp
layout/style/AnimationCommon.h
layout/style/nsAnimationManager.cpp
layout/style/nsAnimationManager.h
layout/style/nsTransitionManager.h
--- a/dom/animation/Animation.cpp
+++ b/dom/animation/Animation.cpp
@@ -522,17 +522,17 @@ Animation::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
-Animation::ComposeStyle(nsRefPtr<AnimValuesStyleRule>& aStyleRule,
+Animation::ComposeStyle(nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
                         nsCSSPropertySet& aSetProperties,
                         bool& aNeedsRefreshes)
 {
   if (!mEffect || mEffect->IsFinishedTransition()) {
     return;
   }
 
   AnimationPlayState playState = PlayState();
@@ -1041,17 +1041,17 @@ Animation::GetPresContext() const
     return nullptr;
   }
   return shell->GetPresContext();
 }
 
 AnimationCollection*
 Animation::GetCollection() const
 {
-  CommonAnimationManager* manager = GetAnimationManager();
+  css::CommonAnimationManager* manager = GetAnimationManager();
   if (!manager) {
     return nullptr;
   }
   MOZ_ASSERT(mEffect,
              "An animation with an animation manager must have an effect");
 
   Element* targetElement;
   nsCSSPseudoElements::Type targetPseudoType;
--- a/dom/animation/Animation.h
+++ b/dom/animation/Animation.h
@@ -30,20 +30,21 @@
 #endif
 
 struct JSContext;
 class nsCSSPropertySet;
 class nsIDocument;
 class nsPresContext;
 
 namespace mozilla {
-
 struct AnimationCollection;
+namespace css {
 class AnimValuesStyleRule;
 class CommonAnimationManager;
+} // namespace css
 
 namespace dom {
 
 class CSSAnimation;
 class CSSTransition;
 
 class Animation
   : public nsISupports
@@ -286,17 +287,17 @@ public:
    * Updates |aStyleRule| with the animation values of this animation's effect,
    * if any.
    * Any properties already contained in |aSetProperties| are not changed. Any
    * properties that are changed are added to |aSetProperties|.
    * |aNeedsRefreshes| will be set to true if this animation expects to update
    * the style rule on the next refresh driver tick as well (because it
    * is running and has an effect to sample).
    */
-  void ComposeStyle(nsRefPtr<AnimValuesStyleRule>& aStyleRule,
+  void ComposeStyle(nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
                     nsCSSPropertySet& aSetProperties,
                     bool& aNeedsRefreshes);
 protected:
   void SilentlySetCurrentTime(const TimeDuration& aNewCurrentTime);
   void SilentlySetPlaybackRate(double aPlaybackRate);
   void DoCancel();
   void DoPlay(ErrorResult& aRv, LimitBehavior aLimitBehavior);
   void DoPause(ErrorResult& aRv);
@@ -335,17 +336,17 @@ protected:
    */
   void CancelPendingTasks();
 
   bool IsPossiblyOrphanedPendingAnimation() const;
   StickyTimeDuration EffectEnd() const;
 
   nsIDocument* GetRenderedDocument() const;
   nsPresContext* GetPresContext() const;
-  virtual CommonAnimationManager* GetAnimationManager() const = 0;
+  virtual css::CommonAnimationManager* GetAnimationManager() const = 0;
   AnimationCollection* GetCollection() const;
 
   nsCOMPtr<nsIGlobalObject> mGlobal;
   nsRefPtr<AnimationTimeline> mTimeline;
   nsRefPtr<KeyframeEffectReadOnly> mEffect;
   // The beginning of the delay period.
   Nullable<TimeDuration> mStartTime; // Timeline timescale
   Nullable<TimeDuration> mHoldTime;  // Animation timescale
--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -294,18 +294,19 @@ KeyframeEffectReadOnly::HasAnimationOfPr
     if (HasAnimationOfProperty(aProperties[i])) {
       return true;
     }
   }
   return false;
 }
 
 void
-KeyframeEffectReadOnly::ComposeStyle(nsRefPtr<AnimValuesStyleRule>& aStyleRule,
-                                     nsCSSPropertySet& aSetProperties)
+KeyframeEffectReadOnly::ComposeStyle(
+                          nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
+                          nsCSSPropertySet& aSetProperties)
 {
   ComputedTiming computedTiming = GetComputedTiming();
 
   // If the progress is null, we don't have fill data for the current
   // time so we shouldn't animate.
   if (computedTiming.mProgress == ComputedTiming::kNullProgress) {
     return;
   }
@@ -364,17 +365,17 @@ KeyframeEffectReadOnly::ComposeStyle(nsR
     MOZ_ASSERT(segment->mFromKey < segment->mToKey, "incorrect keys");
     MOZ_ASSERT(segment >= prop.mSegments.Elements() &&
                size_t(segment - prop.mSegments.Elements()) <
                  prop.mSegments.Length(),
                "out of array bounds");
 
     if (!aStyleRule) {
       // Allocate the style rule now that we know we have animation data.
-      aStyleRule = new AnimValuesStyleRule();
+      aStyleRule = new css::AnimValuesStyleRule();
     }
 
     double positionInSegment =
       (computedTiming.mProgress - segment->mFromKey) /
       (segment->mToKey - segment->mFromKey);
     double valuePosition =
       segment->mTimingFunction.GetValue(positionInSegment);
 
--- a/dom/animation/KeyframeEffect.h
+++ b/dom/animation/KeyframeEffect.h
@@ -21,18 +21,19 @@
 #include "mozilla/dom/Nullable.h"
 #include "nsSMILKeySpline.h"
 #include "nsStyleStruct.h" // for nsTimingFunction
 
 struct JSContext;
 class nsCSSPropertySet;
 
 namespace mozilla {
-
+namespace css {
 class AnimValuesStyleRule;
+} // namespace css
 
 /**
  * Input timing parameters.
  *
  * Eventually this will represent all the input timing parameters specified
  * by content but for now it encapsulates just the subset of those
  * parameters passed to GetPositionInIteration.
  */
@@ -313,17 +314,17 @@ public:
   InfallibleTArray<AnimationProperty>& Properties() {
     return mProperties;
   }
 
   // Updates |aStyleRule| with the animation values produced by this
   // Animation for the current time except any properties already contained
   // in |aSetProperties|.
   // Any updated properties are added to |aSetProperties|.
-  void ComposeStyle(nsRefPtr<AnimValuesStyleRule>& aStyleRule,
+  void ComposeStyle(nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
                     nsCSSPropertySet& aSetProperties);
 
 protected:
   virtual ~KeyframeEffectReadOnly() { }
 
   nsCOMPtr<Element> mTarget;
   Nullable<TimeDuration> mParentTime;
 
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -958,17 +958,17 @@ RestyleManager::ProcessRestyledFrames(ns
     aChangeList.ChangeAt(index, &changeData);
     if (changeData->mFrame) {
       propTable->Delete(changeData->mFrame, ChangeListProperty());
     }
 
 #ifdef DEBUG
     // reget frame from content since it may have been regenerated...
     if (changeData->mContent) {
-      if (!CommonAnimationManager::ContentOrAncestorHasAnimation(changeData->mContent)) {
+      if (!css::CommonAnimationManager::ContentOrAncestorHasAnimation(changeData->mContent)) {
         nsIFrame* frame = changeData->mContent->GetPrimaryFrame();
         if (frame) {
           DebugVerifyStyleTree(frame);
         }
       }
     } else if (!changeData->mFrame ||
                changeData->mFrame->GetType() != nsGkAtoms::viewportFrame) {
       NS_WARNING("Unable to test style tree integrity -- no content node "
@@ -2620,17 +2620,17 @@ ElementRestyler::AddLayerChangesForAnima
 {
   // Bug 847286 - We should have separate animation generation counters
   // on layers for transitions and animations and use != comparison below
   // rather than a > comparison.
   uint64_t frameGeneration =
     RestyleManager::GetMaxAnimationGenerationForFrame(mFrame);
 
   nsChangeHint hint = nsChangeHint(0);
-  const auto& layerInfo = CommonAnimationManager::sLayerAnimationInfo;
+  const auto& layerInfo = css::CommonAnimationManager::sLayerAnimationInfo;
   for (size_t i = 0; i < ArrayLength(layerInfo); i++) {
     Layer* layer =
       FrameLayerBuilder::GetDedicatedLayer(mFrame, layerInfo[i].mLayerType);
     if (layer && frameGeneration > layer->GetAnimationGeneration()) {
       // If we have a transform layer but don't have any transform style, we
       // probably just removed the transform but haven't destroyed the layer
       // yet. In this case we will add the appropriate change hint
       // (nsChangeHint_AddOrRemoveTransform) when we compare style contexts
--- a/layout/build/nsLayoutStatics.cpp
+++ b/layout/build/nsLayoutStatics.cpp
@@ -305,17 +305,17 @@ nsLayoutStatics::Initialize()
   ServiceWorkerRegistrar::Initialize();
 
 #ifdef MOZ_B2G
   RequestSyncWifiService::Init();
 #endif
 
 #ifdef DEBUG
   nsStyleContext::Initialize();
-  mozilla::CommonAnimationManager::Initialize();
+  mozilla::css::CommonAnimationManager::Initialize();
 #endif
 
   MediaDecoder::InitStatics();
 
   PromiseDebugging::Init();
 
   layers::CompositorLRU::Init();
 
--- a/layout/style/AnimationCommon.cpp
+++ b/layout/style/AnimationCommon.cpp
@@ -46,16 +46,18 @@ IsGeometricProperty(nsCSSProperty aPrope
     case eCSSProperty_top:
     case eCSSProperty_width:
       return true;
     default:
       return false;
   }
 }
 
+namespace css {
+
 CommonAnimationManager::CommonAnimationManager(nsPresContext *aPresContext)
   : mPresContext(aPresContext)
   , mIsObservingRefreshDriver(false)
 {
   PR_INIT_CLIST(&mElementCollections);
 }
 
 CommonAnimationManager::~CommonAnimationManager()
@@ -433,17 +435,17 @@ CommonAnimationManager::LayerAnimationRe
   }
   return nullptr;
 }
 
 #ifdef DEBUG
 /* static */ void
 CommonAnimationManager::Initialize()
 {
-  const auto& info = CommonAnimationManager::sLayerAnimationInfo;
+  const auto& info = css::CommonAnimationManager::sLayerAnimationInfo;
   for (size_t i = 0; i < ArrayLength(info); i++) {
     auto record = info[i];
     MOZ_ASSERT(nsCSSProps::PropHasFlags(record.mProperty,
                                         CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR),
                "CSS property with entry in sLayerAnimationInfo does not "
                "have the CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR flag");
   }
 
@@ -527,16 +529,18 @@ AnimValuesStyleRule::List(FILE* out, int
     AppendUTF16toUTF8(value, str);
     str.AppendLiteral("; ");
   }
   str.AppendLiteral("}\n");
   fprintf_stderr(out, "%s", str.get());
 }
 #endif
 
+} // namespace css
+
 bool
 AnimationCollection::CanAnimatePropertyOnCompositor(
   const dom::Element *aElement,
   nsCSSProperty aProperty,
   CanAnimateFlags aFlags)
 {
   bool shouldLog = nsLayoutUtils::IsAnimationLoggingEnabled();
   if (!gfxPlatform::OffMainThreadCompositingEnabled()) {
@@ -688,17 +692,17 @@ AnimationCollection::PostUpdateLayerAnim
   for (size_t animIdx = mAnimations.Length(); animIdx-- != 0; ) {
     const auto& properties = mAnimations[animIdx]->GetEffect()->Properties();
     for (size_t propIdx = properties.Length(); propIdx-- != 0; ) {
       nsCSSProperty prop = properties[propIdx].mProperty;
       if (nsCSSProps::PropHasFlags(prop,
                                    CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR) &&
           !propsHandled.HasProperty(prop)) {
         propsHandled.AddProperty(prop);
-        nsChangeHint changeHint = CommonAnimationManager::
+        nsChangeHint changeHint = css::CommonAnimationManager::
           LayerAnimationRecordFor(prop)->mChangeHint;
         dom::Element* element = GetElementToRestyle();
         if (element) {
           mManager->mPresContext->RestyleManager()->
             PostRestyleEvent(element, nsRestyleHint(0), changeHint);
         }
       }
     }
@@ -913,17 +917,17 @@ AnimationCollection::CanThrottleAnimatio
     return false;
   }
   nsIFrame* frame = nsLayoutUtils::GetStyleFrame(element);
   if (!frame) {
     return false;
   }
 
 
-  const auto& info = CommonAnimationManager::sLayerAnimationInfo;
+  const auto& info = css::CommonAnimationManager::sLayerAnimationInfo;
   for (size_t i = 0; i < ArrayLength(info); i++) {
     auto record = info[i];
     if (!HasAnimationOfProperty(record.mProperty)) {
       continue;
     }
 
     Layer* layer = FrameLayerBuilder::GetDedicatedLayer(
                      frame, record.mLayerType);
--- a/layout/style/AnimationCommon.h
+++ b/layout/style/AnimationCommon.h
@@ -30,16 +30,18 @@
 class nsIFrame;
 class nsPresContext;
 
 namespace mozilla {
 
 class RestyleTracker;
 struct AnimationCollection;
 
+namespace css {
+
 bool IsGeometricProperty(nsCSSProperty aProperty);
 
 class CommonAnimationManager : public nsIStyleRuleProcessor,
                                public nsARefreshObserver {
 public:
   explicit CommonAnimationManager(nsPresContext *aPresContext);
 
   // nsIStyleRuleProcessor (parts)
@@ -50,19 +52,19 @@ public:
     HasAttributeDependentStyle(AttributeRuleProcessorData* aData) override;
   virtual bool MediumFeaturesChanged(nsPresContext* aPresContext) override;
   virtual void RulesMatching(ElementRuleProcessorData* aData) override;
   virtual void RulesMatching(PseudoElementRuleProcessorData* aData) override;
   virtual void RulesMatching(AnonBoxRuleProcessorData* aData) override;
 #ifdef MOZ_XUL
   virtual void RulesMatching(XULTreeRuleProcessorData* aData) override;
 #endif
-  virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf)
+  virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf)
     const MOZ_MUST_OVERRIDE override;
-  virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf)
+  virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
     const MOZ_MUST_OVERRIDE override;
 
 #ifdef DEBUG
   static void Initialize();
 #endif
 
   // NOTE:  This can return null after Disconnect().
   nsPresContext* PresContext() const { return mPresContext; }
@@ -70,17 +72,17 @@ public:
   /**
    * Notify the manager that the pres context is going away.
    */
   void Disconnect();
 
   // Tell the restyle tracker about all the styles that we're currently
   // animating, so that it can update the animation rule for these
   // elements.
-  void AddStyleUpdatesTo(RestyleTracker& aTracker);
+  void AddStyleUpdatesTo(mozilla::RestyleTracker& aTracker);
 
   AnimationCollection*
   GetAnimations(dom::Element *aElement,
                 nsCSSPseudoElements::Type aPseudoType,
                 bool aCreateIfNeeded);
 
   // Returns true if aContent or any of its ancestors has an animation
   // or transition.
@@ -99,23 +101,23 @@ public:
   // has been updated.
   void NotifyCollectionUpdated(AnimationCollection& aCollection);
 
   enum FlushFlags {
     Can_Throttle,
     Cannot_Throttle
   };
 
-  nsIStyleRule* GetAnimationRule(dom::Element* aElement,
+  nsIStyleRule* GetAnimationRule(mozilla::dom::Element* aElement,
                                  nsCSSPseudoElements::Type aPseudoType);
 
   static bool ExtractComputedValueForTransition(
                   nsCSSProperty aProperty,
                   nsStyleContext* aStyleContext,
-                  StyleAnimationValue& aComputedValue);
+                  mozilla::StyleAnimationValue& aComputedValue);
 
   // For CSS properties that may be animated on a separate layer, represents
   // a record of the corresponding layer type and change hint.
   struct LayerAnimationRecord {
     nsCSSProperty mProperty;
     nsDisplayItem::Type mLayerType;
     nsChangeHint mChangeHint;
   };
@@ -131,17 +133,17 @@ public:
   // on such properties.
   static const LayerAnimationRecord*
     LayerAnimationRecordFor(nsCSSProperty aProperty);
 
 protected:
   virtual ~CommonAnimationManager();
 
   // For ElementCollectionRemoved
-  friend struct AnimationCollection;
+  friend struct mozilla::AnimationCollection;
 
   void AddElementCollection(AnimationCollection* aCollection);
   void ElementCollectionRemoved() { MaybeStartOrStopObservingRefreshDriver(); }
   void RemoveAllElementCollections();
 
   // We should normally only call MaybeStartOrStopObservingRefreshDriver in
   // situations where we will also queue events since otherwise we may stop
   // getting refresh driver ticks before we queue the necessary events.
@@ -192,60 +194,63 @@ public:
   NS_DECL_ISUPPORTS
 
   // nsIStyleRule implementation
   virtual void MapRuleInfoInto(nsRuleData* aRuleData) override;
 #ifdef DEBUG
   virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override;
 #endif
 
-  void AddValue(nsCSSProperty aProperty, StyleAnimationValue &aStartValue)
+  void AddValue(nsCSSProperty aProperty,
+                mozilla::StyleAnimationValue &aStartValue)
   {
     PropertyValuePair v = { aProperty, aStartValue };
     mPropertyValuePairs.AppendElement(v);
   }
 
   // Caller must fill in returned value.
-  StyleAnimationValue* AddEmptyValue(nsCSSProperty aProperty)
+  mozilla::StyleAnimationValue* AddEmptyValue(nsCSSProperty aProperty)
   {
     PropertyValuePair *p = mPropertyValuePairs.AppendElement();
     p->mProperty = aProperty;
     return &p->mValue;
   }
 
   struct PropertyValuePair {
     nsCSSProperty mProperty;
-    StyleAnimationValue mValue;
+    mozilla::StyleAnimationValue mValue;
   };
 
   void AddPropertiesToSet(nsCSSPropertySet& aSet) const
   {
     for (size_t i = 0, i_end = mPropertyValuePairs.Length(); i < i_end; ++i) {
       const PropertyValuePair &cv = mPropertyValuePairs[i];
       aSet.AddProperty(cv.mProperty);
     }
   }
 
 private:
   ~AnimValuesStyleRule() {}
 
   InfallibleTArray<PropertyValuePair> mPropertyValuePairs;
 };
 
+} // namespace css
+
 typedef InfallibleTArray<nsRefPtr<dom::Animation>> AnimationPtrArray;
 
 enum EnsureStyleRuleFlags {
   EnsureStyleRule_IsThrottled,
   EnsureStyleRule_IsNotThrottled
 };
 
 struct AnimationCollection : public PRCList
 {
   AnimationCollection(dom::Element *aElement, nsIAtom *aElementProperty,
-                      CommonAnimationManager *aManager)
+                      mozilla::css::CommonAnimationManager *aManager)
     : mElement(aElement)
     , mElementProperty(aElementProperty)
     , mManager(aManager)
     , mAnimationGeneration(0)
     , mCheckGeneration(0)
     , mNeedsRefreshes(true)
 #ifdef DEBUG
     , mCalledPropertyDtor(false)
@@ -271,19 +276,19 @@ struct AnimationCollection : public PRCL
 
   static void PropertyDtor(void *aObject, nsIAtom *aPropertyName,
                            void *aPropertyValue, void *aData);
 
   void Tick();
 
   void EnsureStyleRuleFor(TimeStamp aRefreshTime, EnsureStyleRuleFlags aFlags);
 
-  bool CanThrottleTransformChanges(TimeStamp aTime);
+  bool CanThrottleTransformChanges(mozilla::TimeStamp aTime);
 
-  bool CanThrottleAnimation(TimeStamp aTime);
+  bool CanThrottleAnimation(mozilla::TimeStamp aTime);
 
   enum CanAnimateFlags {
     // Testing for width, height, top, right, bottom, or left.
     CanAnimate_HasGeometricProperty = 1,
     // Allow the case where OMTA is allowed in general, but not for the
     // specified property.
     CanAnimate_AllowPartial = 2
   };
@@ -368,20 +373,20 @@ public:
     if (IsForBeforePseudo()) {
       return nsCSSPseudoElements::ePseudo_before;
     }
     MOZ_ASSERT(IsForAfterPseudo(),
                "::before & ::after should be the only pseudo-elements here");
     return nsCSSPseudoElements::ePseudo_after;
   }
 
-  dom::Element* GetElementToRestyle() const;
+  mozilla::dom::Element* GetElementToRestyle() const;
 
   void PostRestyleForAnimation(nsPresContext *aPresContext) {
-    dom::Element* element = GetElementToRestyle();
+    mozilla::dom::Element* element = GetElementToRestyle();
     if (element) {
       nsRestyleHint hint = IsForTransitions() ? eRestyle_CSSTransitions
                                               : eRestyle_CSSAnimations;
       aPresContext->PresShell()->RestyleForAnimation(element, hint);
     }
   }
 
   void NotifyAnimationUpdated();
@@ -390,28 +395,28 @@ public:
                                        const nsIContent* aContent = nullptr);
 
   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;
 
-  CommonAnimationManager *mManager;
+  mozilla::css::CommonAnimationManager *mManager;
 
-  AnimationPtrArray mAnimations;
+  mozilla::AnimationPtrArray 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.
-  nsRefPtr<AnimValuesStyleRule> mStyleRule;
+  nsRefPtr<mozilla::css::AnimValuesStyleRule> mStyleRule;
 
   // RestyleManager keeps track of the number of animation
   // 'mini-flushes' (see nsTransitionManager::UpdateAllThrottledStyles()).
   // mAnimationGeneration is the sequence number of the last flush where a
   // transition/animation changed.  We keep a similar count on the
   // corresponding layer so we can check that the layer is up to date with
   // the animation manager.
   uint64_t mAnimationGeneration;
--- a/layout/style/nsAnimationManager.cpp
+++ b/layout/style/nsAnimationManager.cpp
@@ -1000,17 +1000,17 @@ nsAnimationManager::FlushAnimations(Flus
     nsAutoAnimationMutationBatch mb(collection->mElement);
 
     collection->Tick();
     bool canThrottleTick = aFlags == Can_Throttle &&
       collection->CanPerformOnCompositorThread(
         AnimationCollection::CanAnimateFlags(0)) &&
       collection->CanThrottleAnimation(now);
 
-    nsRefPtr<AnimValuesStyleRule> oldStyleRule = collection->mStyleRule;
+    nsRefPtr<css::AnimValuesStyleRule> oldStyleRule = collection->mStyleRule;
     collection->EnsureStyleRuleFor(now, canThrottleTick
                                         ? EnsureStyleRule_IsThrottled
                                         : EnsureStyleRule_IsNotThrottled);
     if (oldStyleRule != collection->mStyleRule) {
       collection->PostRestyleForAnimation(mPresContext);
     } else {
       didThrottle = true;
     }
--- a/layout/style/nsAnimationManager.h
+++ b/layout/style/nsAnimationManager.h
@@ -158,17 +158,17 @@ public:
   bool mInEffectForCascadeResults;
 
 protected:
   virtual ~CSSAnimation()
   {
     MOZ_ASSERT(!mOwningElement.IsSet(), "Owning element should be cleared "
                                         "before a CSS animation is destroyed");
   }
-  virtual CommonAnimationManager* GetAnimationManager() const override;
+  virtual css::CommonAnimationManager* GetAnimationManager() const override;
 
   void QueueEvents();
 
   static nsString PseudoTypeAsString(nsCSSPseudoElements::Type aPseudoType);
 
   nsString mAnimationName;
 
   // The (pseudo-)element whose computed animation-name refers to this
@@ -235,21 +235,21 @@ protected:
   // whose start we last notified on.
   uint64_t mPreviousPhaseOrIteration;
 };
 
 } /* namespace dom */
 } /* namespace mozilla */
 
 class nsAnimationManager final
-  : public mozilla::CommonAnimationManager
+  : public mozilla::css::CommonAnimationManager
 {
 public:
   explicit nsAnimationManager(nsPresContext *aPresContext)
-    : mozilla::CommonAnimationManager(aPresContext)
+    : mozilla::css::CommonAnimationManager(aPresContext)
   {
   }
 
   NS_DECL_CYCLE_COLLECTION_CLASS(nsAnimationManager)
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   void MaybeUpdateCascadeResults(mozilla::AnimationCollection* aCollection);
 
--- a/layout/style/nsTransitionManager.h
+++ b/layout/style/nsTransitionManager.h
@@ -157,32 +157,32 @@ public:
 
 protected:
   virtual ~CSSTransition()
   {
     MOZ_ASSERT(!mOwningElement.IsSet(), "Owning element should be cleared "
                                         "before a CSS transition is destroyed");
   }
 
-  virtual CommonAnimationManager* GetAnimationManager() const override;
+  virtual css::CommonAnimationManager* GetAnimationManager() const override;
 
   // The (pseudo-)element whose computed transition-property refers to this
   // transition (if any).
   OwningElementRef mOwningElement;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 class nsTransitionManager final
-  : public mozilla::CommonAnimationManager
+  : public mozilla::css::CommonAnimationManager
 {
 public:
   explicit nsTransitionManager(nsPresContext *aPresContext)
-    : mozilla::CommonAnimationManager(aPresContext)
+    : mozilla::css::CommonAnimationManager(aPresContext)
     , mInAnimationOnlyStyleUpdate(false)
   {
   }
 
   NS_DECL_ISUPPORTS
 
   typedef mozilla::AnimationCollection AnimationCollection;