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