Bug 1383589 - Process post traversal whenever StyleDocument() or StyleDocumentForThrottledAnimationFlush() returns true. r?emilio draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Tue, 25 Jul 2017 11:49:04 +0900
changeset 614849 5080dcffc835327bf659cdd937d21ea4cd1b454a
parent 614848 91727c7a6f5bb08ea5297e6b82690ece6ca2cd38
child 638981 4f71b08280cd5f1c38e3e502a11930159815cabb
push id70141
push userhikezoe@mozilla.com
push dateTue, 25 Jul 2017 02:49:27 +0000
reviewersemilio
bugs1383589
milestone56.0a1
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