Bug 1148829 - Backport a safer version of part of bug 1061364 to make transitions stop running the refresh driver after they've finished. r=bbirtles, a=sledru
authorL. David Baron <dbaron@dbaron.org>
Thu, 09 Apr 2015 13:38:00 -0400
changeset 258452 4359c16b7f44
parent 258451 7717f3aa4cf6
child 258453 05508ccf3ae8
push id4670
push userryanvm@gmail.com
push date2015-04-13 19:15 +0000
treeherdermozilla-beta@05508ccf3ae8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbirtles, sledru
bugs1148829, 1061364
milestone38.0
Bug 1148829 - Backport a safer version of part of bug 1061364 to make transitions stop running the refresh driver after they've finished. r=bbirtles, a=sledru
layout/style/AnimationCommon.cpp
--- a/layout/style/AnimationCommon.cpp
+++ b/layout/style/AnimationCommon.cpp
@@ -381,20 +381,22 @@ CommonAnimationManager::GetAnimationRule
   // to both be refreshed by this point.
   if (IsAnimationManager()) {
     NS_WARN_IF_FALSE(!collection->mNeedsRefreshes ||
                      collection->mStyleRuleRefreshTime ==
                        mPresContext->RefreshDriver()->MostRecentRefresh(),
                      "should already have refreshed style rule");
   } else {
     // FIXME: Remove this assignment.  See bug 1061364.
-    collection->mNeedsRefreshes = true;
-    collection->EnsureStyleRuleFor(
-      mPresContext->RefreshDriver()->MostRecentRefresh(),
-      EnsureStyleRule_IsNotThrottled);
+    TimeStamp now = mPresContext->RefreshDriver()->MostRecentRefresh();
+    if (collection->mStyleRuleRefreshTime.IsNull() ||
+        collection->mStyleRuleRefreshTime != now) {
+      collection->mNeedsRefreshes = true;
+    }
+    collection->EnsureStyleRuleFor(now, EnsureStyleRule_IsNotThrottled);
   }
 
   return collection->mStyleRule;
 }
 
 /* static */ const CommonAnimationManager::LayerAnimationRecord
   CommonAnimationManager::sLayerAnimationInfo[] =
     { { eCSSProperty_transform,