mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-20 16:28:54 +00:00
LibWeb: Dispatch animation events before requestAnimationFrame callbacks
Most of the time there won't be any animation frame callbacks, and we can keep our behavior of dispatching events in the animation timer.
This commit is contained in:
parent
4dc8492155
commit
ffc648196a
Notes:
sideshowbarker
2024-07-16 18:26:46 +09:00
Author: https://github.com/mattco98
Commit: ffc648196a
Pull-request: https://github.com/SerenityOS/serenity/pull/23756
1 changed files with 7 additions and 1 deletions
|
@ -253,7 +253,13 @@ void EventLoop::process()
|
|||
});
|
||||
|
||||
// 10. For each fully active Document in docs, update animations and send events for that Document, passing in now as the timestamp. [WEBANIMATIONS]
|
||||
// Note: This is handled by the document's animation timer
|
||||
// Note: This is handled by the document's animation timer, however, if a document has any requestAnimationFrame callbacks, we need
|
||||
// to dispatch events before that happens below. Not dispatching here would be observable.
|
||||
for_each_fully_active_document_in_docs([&](DOM::Document& document) {
|
||||
if (document.window()->animation_frame_callback_driver().has_callbacks()) {
|
||||
document.update_animations_and_send_events(document.window()->performance()->now());
|
||||
}
|
||||
});
|
||||
|
||||
// FIXME: 11. For each fully active Document in docs, run the fullscreen steps for that Document, passing in now as the timestamp. [FULLSCREEN]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue