Bug 1379516 - Update the test where an orphaned element is attached to a document. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Fri, 11 Aug 2017 08:43:45 +0900
changeset 644557 1ebae19a72ddd4074e8ffa313cafac19884e8347
parent 644556 861d7a09950811b04627f20f8fded8b4b8c31c14
child 644558 95f188722f921cac82bf829229d74a39577e674c
push id73463
push userhikezoe@mozilla.com
push dateFri, 11 Aug 2017 02:58:58 +0000
reviewersbirtles
bugs1379516, 1388557, 1193394
milestone57.0a1
Bug 1379516 - Update the test where an orphaned element is attached to a document. r?birtles Actually we have a chance to run styling process when we attach an orphaned element to a document in this test setup. Precisely, we can process a restyle between rAF callbacks and Promise.then() callback for waitForAnimationFrames(). So if we call RequestRestyle(Layer) when we attach the element to the document (bug 1388557), the animation starts restyling in the first frame. *BUT* this behavior will also change once our micro tasks handling becomes the HTML spec compliance (bug 1193394). When the micro tasks handling changes, we should also fix a bunch of test cases and test utilities in bug 1388557. MozReview-Commit-ID: GyH1ofGhXOP
dom/animation/test/chrome/test_restyles.html
--- a/dom/animation/test/chrome/test_restyles.html
+++ b/dom/animation/test/chrome/test_restyles.html
@@ -755,23 +755,21 @@ waitForAllPaints(function() {
 
     var markers = await observeStyling(5);
     is(markers.length, 0,
        'Animation on orphaned element should not cause restyles');
 
     document.body.appendChild(div);
 
     markers = await observeStyling(1);
-    // We are observing restyles in rAF callback which is processed before
-    // restyling process in each frame, so in the first frame there should be
-    // no observed restyle since we don't process restyle while the element
-    // is not attached to the document.
-    is(markers.length, 0,
-       'We observe no restyle in the first frame right after re-atatching ' +
-       'to the document');
+    // 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);
     is(markers.length, 5,
        'Animation on re-attached to the document begins to update style');
 
     await ensureElementRemoval(div);
   });
 
   add_task_if_omta_enabled(