mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
15a8baee03
The if statement in the dispatch implies we are in the idle state, so of course the active time will always be undefined. If this was cancelled via a call to cancel(), we can save the time at that point. Otherwise, just send 0.
27 lines
617 B
HTML
27 lines
617 B
HTML
<!-- https://github.com/SerenityOS/serenity/issues/24424 -->
|
|
<style>
|
|
@keyframes anim {
|
|
to {
|
|
width: 200px;
|
|
}
|
|
}
|
|
|
|
div {
|
|
animation: anim 1s;
|
|
}
|
|
</style>
|
|
<div id="foo"></div>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
asyncTest(done => {
|
|
const foo = document.getElementById("foo");
|
|
const anim = foo.getAnimations()[0];
|
|
foo.addEventListener("animationcancel", () => {
|
|
println("PASS! (Didn't crash)");
|
|
done();
|
|
});
|
|
requestAnimationFrame(() => {
|
|
anim.cancel();
|
|
});
|
|
});
|
|
</script>
|