Bug 1117603 part 1 - Don't assume style rules have been refreshed in GetAnimationRule; r=dbaron
☠☠ backed out by 5329cda711c8 ☠ ☠
authorBrian Birtles <birtles@gmail.com>
Tue, 24 Mar 2015 09:06:06 +0900
changeset 265484 fe8ba59678a2f1c53e9b2af0f9e8e557429f3e8b
parent 265483 8673899b82297013b9fe75371c0ba4f66b837436
child 265485 67fece2790496af172de79b63ffe9e334e05d279
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1117603
milestone39.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 1117603 part 1 - Don't assume style rules have been refreshed in GetAnimationRule; r=dbaron Typically when GetAnimationRule is called, at least for CSS Animations, the animation style rule will have been refreshed. However, in some cases such as when the Web Animations API is used, the style rule will be marked as needing to be refreshed outside of the usual flow. This rule will be refreshed when nsAnimationManager::WillRefresh flushes animations but if the refresh driver for the chrome document fires first, we will visit GetAnimationRule before this happens. This patch removes the assertion that expects animations to have been refreshed by the time we reach GetAnimationRule causing it to update the animation style rule as necessary.
layout/style/AnimationCommon.cpp
--- a/layout/style/AnimationCommon.cpp
+++ b/layout/style/AnimationCommon.cpp
@@ -371,31 +371,23 @@ CommonAnimationManager::GetAnimationRule
     return nullptr;
   }
 
   RestyleManager* restyleManager = mPresContext->RestyleManager();
   if (restyleManager->SkipAnimationRules()) {
     return nullptr;
   }
 
-  // Animations should already be refreshed, but transitions may not be.
-  // Note that this is temporary, we would like both animations and transitions
-  // 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.
+  // FIXME: Remove this assignment.  See bug 1061364.
+  if (!IsAnimationManager()) {
     collection->mNeedsRefreshes = true;
-    collection->EnsureStyleRuleFor(
-      mPresContext->RefreshDriver()->MostRecentRefresh(),
-      EnsureStyleRule_IsNotThrottled);
   }
+  collection->EnsureStyleRuleFor(
+    mPresContext->RefreshDriver()->MostRecentRefresh(),
+    EnsureStyleRule_IsNotThrottled);
 
   return collection->mStyleRule;
 }
 
 /* static */ const CommonAnimationManager::LayerAnimationRecord
   CommonAnimationManager::sLayerAnimationInfo[] =
     { { eCSSProperty_transform,
         nsDisplayItem::TYPE_TRANSFORM,