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
--- 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