Bug 1240646 - Do not unthrottle animations if RestyleType::Throttled is specified. r=bbirtles
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Mon, 18 Jan 2016 20:54:00 +0100
changeset 317729 c206156920e79194ae28b902fe9727f26786c1ae
parent 317728 a818b21e184ffca8f770923b0459c0082f2837fd
child 317730 d2adcec32a25a9d3bdc0764ef47c2e25c88d36db
push id1079
push userjlund@mozilla.com
push dateFri, 15 Apr 2016 21:02:33 +0000
treeherdermozilla-release@575fbf6786d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbirtles
bugs1240646
milestone46.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 1240646 - Do not unthrottle animations if RestyleType::Throttled is specified. r=bbirtles
dom/animation/EffectCompositor.cpp
--- a/dom/animation/EffectCompositor.cpp
+++ b/dom/animation/EffectCompositor.cpp
@@ -138,19 +138,20 @@ EffectCompositor::RequestRestyle(dom::El
   if (!mPresContext) {
     // Pres context will be null after the effect compositor is disconnected.
     return;
   }
 
   auto& elementsToRestyle = mElementsToRestyle[aCascadeLevel];
   PseudoElementHashKey key = { aElement, aPseudoType };
 
-  if (aRestyleType == RestyleType::Throttled &&
-      !elementsToRestyle.Contains(key)) {
-    elementsToRestyle.Put(key, false);
+  if (aRestyleType == RestyleType::Throttled) {
+    if (!elementsToRestyle.Contains(key)) {
+      elementsToRestyle.Put(key, false);
+    }
     mPresContext->Document()->SetNeedStyleFlush();
   } else {
     // Get() returns 0 if the element is not found. It will also return
     // false if the element is found but does not have a pending restyle.
     bool hasPendingRestyle = elementsToRestyle.Get(key);
     if (!hasPendingRestyle) {
       PostRestyleForAnimation(aElement, aPseudoType, aCascadeLevel);
     }