LibWeb: Ensure requestAnimationFrame callbacks run in the proper order

From https://html.spec.whatwg.org/#list-of-animation-frame-callbacks:

    Each target object has a map of animation frame callbacks, which is
    an ordered map that must be initially empty, and an animation frame
    callback identifier, which is a number that must initially be zero.
This commit is contained in:
Matthew Olsson 2024-03-27 18:45:51 -07:00 committed by Andreas Kling
commit c33f6b2ff6
Notes: sideshowbarker 2024-07-17 23:02:37 +09:00
3 changed files with 35 additions and 1 deletions

View file

@ -0,0 +1,14 @@
<!DOCTYPE html>
<div id="foo"></div>
<script src="include.js"></script>
<script>
test(() => {
for (let i = 0; i < 20; i++) {
// FIXME: Workaround for https://github.com/SerenityOS/serenity/issues/23552
let x = i;
requestAnimationFrame(() => {
println(x);
});
}
});
</script>