LibWeb/DOM: Conserve references to pending animations

This fixes a crash in:
 - css/css-animations/CSSAnimation-effect.tentative.html
This commit is contained in:
Lucas CHOLLET 2024-12-27 16:03:28 -05:00 committed by Andreas Kling
parent db24440403
commit 906b7bf4e3
Notes: github-actions[bot] 2024-12-30 10:06:02 +00:00

View file

@ -4736,8 +4736,11 @@ void Document::update_animations_and_send_events(Optional<double> const& timesta
HTML::perform_a_microtask_checkpoint();
// 4. Let events to dispatch be a copy of docs pending animation event queue.
auto events_to_dispatch = GC::ConservativeVector<Document::PendingAnimationEvent> { vm().heap() };
events_to_dispatch.extend(m_pending_animation_event_queue);
// 5. Clear docs 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) {