LibWeb: Ensure all DocumentTimeline objects have the same time value

The DocumentTimeline constructor used the current millisecond time to
initialize its currentTime, but that means that a newly created timeline
would always have a different time value than other timelines that have
been through the update_animations_and_send_events function.
This commit is contained in:
Matthew Olsson 2024-06-02 06:48:36 -07:00 committed by Andreas Kling
commit 37322baf54
Notes: sideshowbarker 2024-07-17 05:02:35 +09:00
5 changed files with 32 additions and 3 deletions

View file

@ -596,6 +596,7 @@ public:
void restore_the_history_object_state(JS::NonnullGCPtr<HTML::SessionHistoryEntry> entry);
JS::NonnullGCPtr<Animations::DocumentTimeline> timeline();
auto const& last_animation_frame_timestamp() const { return m_last_animation_frame_timestamp; }
void associate_with_timeline(JS::NonnullGCPtr<Animations::AnimationTimeline>);
void disassociate_with_timeline(JS::NonnullGCPtr<Animations::AnimationTimeline>);
@ -889,6 +890,7 @@ private:
// https://www.w3.org/TR/web-animations-1/#document-default-document-timeline
JS::GCPtr<Animations::DocumentTimeline> m_default_timeline;
Optional<double> m_last_animation_frame_timestamp;
// https://www.w3.org/TR/web-animations-1/#pending-animation-event-queue
Vector<PendingAnimationEvent> m_pending_animation_event_queue;