Bug 1379516 - Add descriptions for re-attaching orphaned animation case for stylo. r=birtles

Unlike Gecko, Stylo currently invokes a needless RequestRestyle(Standard)
for this test case (bug 1388560). For this reason, the check right after
re-attaching the orphaned element passes accidentally.

MozReview-Commit-ID: JUG1dgMUQEX

--HG--
extra : rebase_source : a86d72a41c160edc30f83d82179ebe1226b842de
This commit is contained in:
Hiroyuki Ikezoe 2017-08-11 08:43:45 +09:00
parent 6c56c62a1c
commit 94c7df914d

View File

@ -66,10 +66,11 @@ SimpleTest.waitForExplicitFinish();
var omtaEnabled = isOMTAEnabled();
var isAndroid = !!navigator.userAgent.includes("Android");
var isServo = isStyledByServo();
var offscreenThrottlingEnabled =
SpecialPowers.getBoolPref('dom.animations.offscreen-throttling') &&
!isStyledByServo(); // Bug 1303235 : For stylo we don't yet accumulate change
// hints which are used for offscreen throttling.
!isServo; // Bug 1303235 : For stylo we don't yet accumulate change
// hints which are used for offscreen throttling.
function add_task_if_omta_enabled(test) {
if (!omtaEnabled) {
@ -760,11 +761,28 @@ waitForAllPaints(function() {
document.body.appendChild(div);
markers = await observeStyling(1);
// 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');
if (isServo) {
// In Servo, we explicitly set important_rules_change flag to the element
// in compute_style() during the initial normal traversal right after
// re-attaching which leads to invoking a SequentialTask for
// 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');
} 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);
is(markers.length, 5,
'Animation on re-attached to the document begins to update style');