mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-22 01:08:56 +00:00
LibWeb: Add a test to ensure style invalidations don't reset animations
This commit is contained in:
parent
cf54ba01ac
commit
43b0b3fa80
Notes:
sideshowbarker
2024-07-17 02:06:40 +09:00
Author: https://github.com/mattco98
Commit: 43b0b3fa80
Pull-request: https://github.com/SerenityOS/serenity/pull/23723
Issue: https://github.com/SerenityOS/serenity/issues/23716
2 changed files with 35 additions and 0 deletions
|
@ -0,0 +1 @@
|
|||
finish count: 1
|
|
@ -0,0 +1,34 @@
|
|||
<!-- https://github.com/SerenityOS/serenity/issues/23716 -->
|
||||
<!DOCTYPE html>
|
||||
<style>
|
||||
#foo {
|
||||
animation: anim .025s;
|
||||
}
|
||||
@keyframes anim {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div id="foo"></div>
|
||||
<script src="../../include.js"></script>
|
||||
<script>
|
||||
asyncTest(done => {
|
||||
const foo = document.getElementById("foo");
|
||||
let finishCount = 0;
|
||||
foo.getAnimations()[0].onfinish = () => {
|
||||
finishCount += 1;
|
||||
}
|
||||
|
||||
// Cause a few style invalidations, which shouldn't mess with the animation at all
|
||||
setInterval(() => foo.style = "", 50);
|
||||
|
||||
setTimeout(() => {
|
||||
println(`finish count: ${finishCount}`);
|
||||
done();
|
||||
}, 200);
|
||||
})
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue