Bug 1075137 patch 6 - Convert remaining IsProcessingAnimationStyleChange calls to call the method on the RestyleManager. r=birtles
authorL. David Baron <dbaron@dbaron.org>
Thu, 02 Oct 2014 21:53:24 -0700
changeset 223962 9ad680392072419fff1d28d18672a15d28998759
parent 223961 40a25cf2bcfb543191822a3a660d2c6d9960cf65
child 223963 de4f6c938b6aa464dfa739a89ed1b3284d0e33f0
push id7107
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 17:43:31 +0000
treeherdermozilla-aurora@b4b34e0acc75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1075137
milestone35.0a1
Bug 1075137 patch 6 - Convert remaining IsProcessingAnimationStyleChange calls to call the method on the RestyleManager. r=birtles
layout/base/RestyleManager.h
layout/base/RestyleTracker.cpp
layout/style/nsAnimationManager.cpp
layout/style/nsTransitionManager.cpp
--- a/layout/base/RestyleManager.h
+++ b/layout/base/RestyleManager.h
@@ -315,17 +315,17 @@ public:
 
   // See PostRestyleEventCommon below.
   void PostRestyleEvent(Element* aElement,
                         nsRestyleHint aRestyleHint,
                         nsChangeHint aMinChangeHint)
   {
     if (mPresContext) {
       PostRestyleEventCommon(aElement, aRestyleHint, aMinChangeHint,
-                             mPresContext->IsProcessingAnimationStyleChange());
+                             IsProcessingAnimationStyleChange());
     }
   }
 
   // See PostRestyleEventCommon below.
   void PostAnimationRestyleEvent(Element* aElement,
                                  nsRestyleHint aRestyleHint,
                                  nsChangeHint aMinChangeHint)
   {
@@ -392,17 +392,18 @@ public:
   }
 
   /**
    * Returns whether a restyle event currently being processed for the
    * document with the specified nsPresContext should be logged.
    */
   static bool ShouldLogRestyle(nsPresContext* aPresContext) {
     return aPresContext->RestyleLoggingEnabled() &&
-           (!aPresContext->IsProcessingAnimationStyleChange() ||
+           (!aPresContext->RestyleManager()->
+               IsProcessingAnimationStyleChange() ||
             AnimationRestyleLoggingEnabled());
   }
 
   static bool RestyleLoggingInitiallyEnabled() {
     static bool enabled = getenv("MOZ_DEBUG_RESTYLE") != 0;
     return enabled;
   }
 
--- a/layout/base/RestyleTracker.cpp
+++ b/layout/base/RestyleTracker.cpp
@@ -190,17 +190,17 @@ RestyleTracker::DoProcessRestyles()
 {
   PROFILER_LABEL("RestyleTracker", "ProcessRestyles",
     js::ProfileEntry::Category::CSS);
 
   mRestyleManager->BeginProcessingRestyles();
 
   LOG_RESTYLE("Processing %d pending %srestyles with %d restyle roots for %s",
               mPendingRestyles.Count(),
-              mRestyleManager->PresContext()->IsProcessingAnimationStyleChange()
+              mRestyleManager->IsProcessingAnimationStyleChange()
                 ? (const char*) "animation " : (const char*) "",
               static_cast<int>(mRestyleRoots.Length()),
               GetDocumentURI(Document()).get());
   LOG_RESTYLE_INDENT();
 
   // loop so that we process any restyle events generated by processing
   while (mPendingRestyles.Count()) {
     if (mHaveLaterSiblingRestyles) {
--- a/layout/style/nsAnimationManager.cpp
+++ b/layout/style/nsAnimationManager.cpp
@@ -221,17 +221,18 @@ nsAnimationManager::SizeOfIncludingThis(
 {
   return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
 }
 
 nsIStyleRule*
 nsAnimationManager::CheckAnimationRule(nsStyleContext* aStyleContext,
                                        mozilla::dom::Element* aElement)
 {
-  if (!mPresContext->IsProcessingAnimationStyleChange()) {
+  // FIXME (bug 960465): This test should go away.
+  if (!mPresContext->RestyleManager()->IsProcessingAnimationStyleChange()) {
     if (!mPresContext->IsDynamic()) {
       // For print or print preview, ignore animations.
       return nullptr;
     }
 
     // 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
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -170,17 +170,19 @@ nsTransitionManager::StyleContextChanged
   if (!collection &&
       disp->mTransitionPropertyCount == 1 &&
       disp->mTransitions[0].GetDelay() == 0.0f &&
       disp->mTransitions[0].GetDuration() == 0.0f) {
     return nullptr;
   }
 
 
-  if (aNewStyleContext->PresContext()->IsProcessingAnimationStyleChange()) {
+  // FIXME (bug 960465): This test should go away.
+  if (aNewStyleContext->PresContext()->RestyleManager()->
+        IsProcessingAnimationStyleChange()) {
     return nullptr;
   }
 
   if (aNewStyleContext->GetParent() &&
       aNewStyleContext->GetParent()->HasPseudoElementData()) {
     // Ignore transitions on things that inherit properties from
     // pseudo-elements.
     // FIXME (Bug 522599): Add tests for this.