diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 158728fd0b6..26a5b81abe2 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -3975,6 +3975,11 @@ void Document::update_animations_and_send_events(Optional const& timesta // the previous step. for (auto const& event : events_to_dispatch) event.target->dispatch_event(event.event); + + for (auto& timeline : m_associated_animation_timelines) { + for (auto& animation : timeline->associated_animations()) + dispatch_events_for_animation_if_necessary(animation); + } } // https://www.w3.org/TR/web-animations-1/#remove-replaced-animations @@ -4086,11 +4091,6 @@ void Document::ensure_animation_timer() } update_animations_and_send_events(window()->performance()->now()); - - for (auto& timeline : m_associated_animation_timelines) { - for (auto& animation : timeline->associated_animations()) - dispatch_events_for_animation_if_necessary(animation); - } })); }