diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index e81dbffafaf..75f0645571d 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -4736,8 +4736,11 @@ void Document::update_animations_and_send_events(Optional const& timesta HTML::perform_a_microtask_checkpoint(); // 4. Let events to dispatch be a copy of doc’s pending animation event queue. + auto events_to_dispatch = GC::ConservativeVector { vm().heap() }; + events_to_dispatch.extend(m_pending_animation_event_queue); + // 5. Clear doc’s pending animation event queue. - auto events_to_dispatch = move(m_pending_animation_event_queue); + m_pending_animation_event_queue.clear(); // 6. Perform a stable sort of the animation events in events to dispatch as follows: auto sort_events_by_composite_order = [](auto const& a, auto const& b) {