ladybird/Tests/LibWeb/Text/input/css/sending-animationcancel-event-crash.html
Matthew Olsson 15a8baee03 LibWeb: Save time for animationcancel event before transitioning to idle
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.
2024-05-24 07:25:10 +02:00

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>