mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
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.
This commit is contained in:
parent
de02a2680f
commit
15a8baee03
Notes:
sideshowbarker
2024-07-17 10:16:43 +09:00
Author: https://github.com/mattco98
Commit: 15a8baee03
Pull-request: https://github.com/SerenityOS/serenity/pull/24427
Issue: https://github.com/SerenityOS/serenity/issues/24424
5 changed files with 38 additions and 2 deletions
|
@ -0,0 +1,27 @@
|
|||
<!-- 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>
|
Loading…
Add table
Add a link
Reference in a new issue