1
0
Fork 0
firefox/layout/reftests/web-animations/cancel-animation-with-selector-matching.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

26 lines
601 B
HTML

<!DOCTYPE html>
<html class="reftest-wait">
<title>Discard cancelled animation styles</title>
<style>
#test {
width: 100px; height: 100px;
background-color: white;
}
.changed {
color: red;
}
</style>
<div id="test"></div>
<script>
var target = document.getElementById("test");
var anim = target.animate({ backgroundColor: [ "red", "red" ] }, 100000);
anim.ready.then(() => {
anim.cancel();
// Add a class name to cause selector matching in a subsequent restyle.
target.classList.add("changed");
document.documentElement.classList.remove("reftest-wait");
});
</script>