Cancel animations that affect nodes that do not participate in layout.

This commit is contained in:
Josh Matthews 2018-12-08 12:33:23 -05:00
parent 8fb1b567fa
commit ed74b898a5
9 changed files with 89 additions and 10 deletions

View file

@ -13458,6 +13458,12 @@
{}
]
],
"mozilla/animation-removed-node.html": [
[
"/_mozilla/mozilla/animation-removed-node.html",
{}
]
],
"mozilla/binding_keyword.html": [
[
"/_mozilla/mozilla/binding_keyword.html",
@ -26613,6 +26619,10 @@
"81de5b389c922067c61effe03208ea740ba8e067",
"testharness"
],
"mozilla/animation-removed-node.html": [
"6ba0318ea1e07b42ef444f838753adbefe9633d6",
"testharness"
],
"mozilla/binding_keyword.html": [
"818d2aa29471026c1b4215dfcd1b9939a052b1ea",
"testharness"

View file

@ -0,0 +1,2 @@
[animation-removed-node.html]
prefs: [css.animations.testing.enabled:true]

View file

@ -0,0 +1,28 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
@keyframes boo {
0% { opacity: 0; }
100% { opacity: 1; }
}
div.test { animation: boo 1s infinite; }
</style>
<div class="test" id="first">hi there!</div>
<div class="test" id="second">hi again!</div>
<script>
async_test(function(t) {
window.onload = t.step_func(function() {
// Verify that there are the expected animations active.
assert_equals(window.runningAnimationCount, 2);
// Cause the animating nodes to become uninvolved with layout.
document.getElementById('first').remove();
document.getElementById('second').style.display = 'none';
// Ensure that we wait until the next layout is complete.
requestAnimationFrame(t.step_func(function() {
// Verify that the previous animations are no longer considered active.
assert_equals(window.runningAnimationCount, 0);
t.done();
}));
});
}, "Animations are no longer active when a node can't be animated.");
</script>