1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:47:45 +00:00

LibWeb: Add Document's pending animation event queue

This is needed for Animation's update finished state procedure
This commit is contained in:
Matthew Olsson 2023-11-04 13:35:30 -07:00 committed by Andreas Kling
parent 8053d40fd5
commit 979b9b942b
2 changed files with 15 additions and 0 deletions

View file

@ -3585,4 +3585,9 @@ void Document::disassociate_with_timeline(JS::NonnullGCPtr<Animations::Animation
m_associated_animation_timelines.remove(timeline);
}
void Document::append_pending_animation_event(Web::DOM::Document::PendingAnimationEvent const& event)
{
m_pending_animation_event_queue.append(event);
}
}

View file

@ -539,6 +539,13 @@ public:
void associate_with_timeline(JS::NonnullGCPtr<Animations::AnimationTimeline>);
void disassociate_with_timeline(JS::NonnullGCPtr<Animations::AnimationTimeline>);
struct PendingAnimationEvent {
JS::NonnullGCPtr<DOM::Event> event;
JS::NonnullGCPtr<Animations::Animation> target;
Optional<double> scheduled_event_time;
};
void append_pending_animation_event(PendingAnimationEvent const&);
protected:
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
@ -751,6 +758,9 @@ private:
// https://www.w3.org/TR/web-animations-1/#document-default-document-timeline
JS::GCPtr<Animations::DocumentTimeline> m_default_timeline;
// https://www.w3.org/TR/web-animations-1/#pending-animation-event-queue
Vector<PendingAnimationEvent> m_pending_animation_event_queue;
};
template<>