Bug 1416966 - Count a remaining animation restyle request when animating element was detached from the document. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Tue, 12 Dec 2017 18:44:04 +0900
changeset 710847 5e7b12660b5e8b21a4402dceba094742b6073010
parent 710846 844c6c4f03e077bbad19b118bce1e7d50be03a04
child 710848 967f935affb32e87d80f4b42f79b57855c78aaf3
push id92911
push userhikezoe@mozilla.com
push dateTue, 12 Dec 2017 10:01:08 +0000
reviewersbirtles
bugs1416966, 1417354
milestone59.0a1
Bug 1416966 - Count a remaining animation restyle request when animating element was detached from the document. r?birtles If element which has script animations is detached between Animation::Tick and styling process, the element persists in EffectCompositor::mElementsToRestyle (bug 1417354). When the element is attached to the document again, the element in mElementsToRestyle is considered as a target element that needs to be traversed in the first animation-only restyling. Thus the remaining restyle request can be observed with the new micro task checkpoint for animations. MozReview-Commit-ID: F6gs2QXcZ8X
dom/animation/test/mozilla/file_restyles.html
--- a/dom/animation/test/mozilla/file_restyles.html
+++ b/dom/animation/test/mozilla/file_restyles.html
@@ -878,19 +878,23 @@ waitForAllPaints(() => {
       // CascadeResults which ends up calling RequestRestyle(Standard). As a
       // result, the animation is restyled during a second animation restyle in
       // the first frame. If we fix the behavior when we attach an orphaned
       // element with script animations to a document so that it requests a
       // layer restyle (bug 1388557) before fixing important_rules_change in
       // compute_style() so that it no longer dispatches a needless standard
       // restyle (bug 1388560), we should add a test case that fails if we
       // continue to unnecessarily request a standard restyle.
-      is(markers.length, 1,
-         'We should observe one restyle in the first frame right after ' +
-         're-attaching to the document');
+      //
+      // Bug 1417354: There will be an additional superfluos restyle request
+      // whichi results when we detach an element from the document between
+      // the Animation tick and styling, and then re-attach it.
+      todo_is(markers.length, 2,
+              'We should observe one restyle in the first frame right after ' +
+              're-attaching to the document');
     } else {
       // Bug 1388557: We should call RequestRestyle(Layer) when an element which
       // has running script animations is attached to a document.
       todo_is(markers.length, 1,
               'Bug 1388557 We should observe one restyle in the first frame ' +
               'right after re-attaching to the document');
     }
     markers = await observeStyling(5);