зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1237454
- Test for an animation on a visibility:hidden element which has a child. r=boris
MozReview-Commit-ID: AfmQJThhp8d --HG-- extra : rebase_source : ed4abf7fb865cf8459294f086a63b13bf0d57373
This commit is contained in:
Родитель
3f041debf1
Коммит
6b8d6a0897
|
@ -786,6 +786,56 @@ waitForAllPaints(() => {
|
|||
await ensureElementRemoval(parentDiv);
|
||||
});
|
||||
|
||||
add_task(
|
||||
async function restyling_animations_on_visibility_hidden_element_with_visibility_changed_children() {
|
||||
var div = addDiv(null,
|
||||
{ style: 'animation: background-color 100s; visibility: hidden' });
|
||||
var animation = div.getAnimations()[0];
|
||||
|
||||
await animation.ready;
|
||||
var markers = await observeStyling(5);
|
||||
|
||||
todo_is(markers.length, 0,
|
||||
'Animations on visibility hidden element having no visible children ' +
|
||||
'should never cause restyles');
|
||||
|
||||
var childElement = addDiv(null, { style: 'visibility: visible' });
|
||||
div.appendChild(childElement);
|
||||
await waitForNextFrame();
|
||||
|
||||
var markers = await observeStyling(5);
|
||||
is(markers.length, 5,
|
||||
'Animations running on visibility hidden element but the element has ' +
|
||||
'a visible child should not throttle restyling');
|
||||
|
||||
childElement.style.visibility = 'hidden';
|
||||
await waitForNextFrame();
|
||||
|
||||
var markers = await observeStyling(5);
|
||||
todo_is(markers.length, 0,
|
||||
'Animations running on visibility hidden element that a child ' +
|
||||
'has become invisible should throttle restyling');
|
||||
|
||||
childElement.style.visibility = 'visible';
|
||||
await waitForNextFrame();
|
||||
|
||||
var markers = await observeStyling(5);
|
||||
is(markers.length, 5,
|
||||
'Animations running on visibility hidden element should not throttle ' +
|
||||
'restyling after the invisible element changed to visible');
|
||||
|
||||
childElement.remove();
|
||||
await waitForNextFrame();
|
||||
|
||||
var markers = await observeStyling(5);
|
||||
todo_is(markers.length, 0,
|
||||
'Animations running on visibility hidden element should throttle ' +
|
||||
'restyling again after all visible descendants were removed');
|
||||
|
||||
await ensureElementRemoval(div);
|
||||
}
|
||||
);
|
||||
|
||||
add_task_if_omta_enabled(async function no_restyling_compositor_animations_after_pause_is_called() {
|
||||
var div = addDiv(null, { style: 'animation: opacity 100s' });
|
||||
var animation = div.getAnimations()[0];
|
||||
|
|
Загрузка…
Ссылка в новой задаче