Bug 1383589 - Process post traversal whenever StyleDocument() or StyleDocumentForThrottledAnimationFlush() returns true. r=emilio
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Tue, 25 Jul 2017 11:49:04 +0900
changeset 419405 e46f1af0d4318b508508a3755a64dd071bbc0845
parent 419404 d133484d4c24a918d5fd8028b9e2f8727e15229b
child 419406 13e18ee3e49a9d49fb66ce6e309fdc329526f96b
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1383589
milestone56.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 1383589 - Process post traversal whenever StyleDocument() or StyleDocumentForThrottledAnimationFlush() returns true. r=emilio The test case in this patch freezes without this fix. MozReview-Commit-ID: 6Rb9XmtAmpM
layout/base/ServoRestyleManager.cpp
layout/style/crashtests/1383589-1.html
layout/style/crashtests/crashtests.list
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -865,21 +865,18 @@ ServoRestyleManager::DoProcessPendingRes
     // Recreate style contexts, and queue up change hints (which also handle
     // lazy frame construction).
     {
       AutoRestyleTimelineMarker marker(
         mPresContext->GetDocShell(), forThrottledAnimationFlush);
       DocumentStyleRootIterator iter(doc);
       while (Element* root = iter.GetNextStyleRoot()) {
         ServoRestyleState state(*styleSet, currentChanges);
-        if (!forThrottledAnimationFlush ||
-            root->HasAnimationOnlyDirtyDescendantsForServo()) {
-          anyStyleChanged |=
-            ProcessPostTraversal(root, nullptr, state, aRestyleBehavior);
-        }
+        anyStyleChanged |=
+          ProcessPostTraversal(root, nullptr, state, aRestyleBehavior);
       }
     }
 
     // Process the change hints.
     //
     // Unfortunately, the frame constructor can generate new change hints while
     // processing existing ones. We redirect those into a secondary queue and
     // iterate until there's nothing left.
new file mode 100644
--- /dev/null
+++ b/layout/style/crashtests/1383589-1.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<script>
+window.addEventListener('load', () => {
+  document.documentElement.animate([{ transform: 'none' }], 10000);
+  requestAnimationFrame(() => {
+    SpecialPowers.getDOMWindowUtils(window)
+                 .sendMouseEvent("mousemove", 100, 100, 1, 0, 1, 0);
+    requestAnimationFrame(() => {
+      document.documentElement.classList.remove('reftest-wait');
+    });
+  });
+});
+</script>
--- a/layout/style/crashtests/crashtests.list
+++ b/layout/style/crashtests/crashtests.list
@@ -180,11 +180,12 @@ load 1377053-1.html
 load 1377256-1.html
 load 1378064-1.html
 load 1378814.html
 load 1380800.html
 load link-transition-before.html
 load 1381682.html
 load 1382672.html
 load 1382710.html
+pref(dom.animations-api.core.enabled,true) load 1383589-1.html
 load 1383001.html
 load 1383001-2.html
 load 1383319.html