Bug 960465 patch 6 - Add the new mechanism for avoiding starting spurious transitions as a result of animations: flush animation styles only before doing other restyle processing. r=birtles
authorL. David Baron <dbaron@dbaron.org>
Tue, 17 Feb 2015 11:15:02 +1300
changeset 256497 7d16f2fd83297da151207217a88fae96777d437e
parent 256496 0288ff191edf0ae7be2a2036920d4e777c49174b
child 256498 a92f3bc5ecd39e53ab2ad5cd98d1e9880fefdf2e
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs960465
milestone38.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 960465 patch 6 - Add the new mechanism for avoiding starting spurious transitions as a result of animations: flush animation styles only before doing other restyle processing. r=birtles
layout/base/RestyleManager.cpp
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -1638,22 +1638,20 @@ RestyleManager::ProcessPendingRestyles()
   // Process non-animation restyles...
   MOZ_ASSERT(!mIsProcessingRestyles,
              "Nesting calls to ProcessPendingRestyles?");
 #ifdef DEBUG
   mIsProcessingRestyles = true;
 #endif
 
   // Before we process any restyles, we need to ensure that style
-  // resulting from any throttled animations (animations that we're
-  // running entirely on the compositor thread) is up-to-date, so that
-  // if any style changes we cause trigger transitions, we have the
-  // correct old style for starting the transition.
-  if (nsLayoutUtils::AreAsyncAnimationsEnabled() &&
-      (mPendingRestyles.Count() > 0 || mDoRebuildAllStyleData)) {
+  // resulting from any animations is up-to-date, so that if any style
+  // changes we cause trigger transitions, we have the correct old style
+  // for starting the transition.
+  if (mHavePendingNonAnimationRestyles || mDoRebuildAllStyleData) {
     IncrementAnimationGeneration();
     UpdateOnlyAnimationStyles();
   }
 
   // Until we get rid of these phases in bug 960465, we need to skip
   // animation restyles during the non-animation phase, and post
   // animation restyles so that we restyle those elements again in the
   // animation phase.