From 560b07dda3d1105cc5fe8e7cc5b0f10d31919e41 Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Wed, 27 Mar 2024 16:48:32 -0700 Subject: [PATCH] LibWeb: Use the timeline time when saving animation play/pause time --- Userland/Libraries/LibWeb/Animations/Animation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Animations/Animation.cpp b/Userland/Libraries/LibWeb/Animations/Animation.cpp index 8454ea478cd..7b0baf9fc37 100644 --- a/Userland/Libraries/LibWeb/Animations/Animation.cpp +++ b/Userland/Libraries/LibWeb/Animations/Animation.cpp @@ -663,7 +663,7 @@ WebIDL::ExceptionOr Animation::play_an_animation(AutoRewind auto_rewind) // If a user agent determines that animation is immediately ready, it may schedule the above task as a microtask // such that it runs at the next microtask checkpoint, but it must not perform the task synchronously. m_pending_play_task = TaskState::Scheduled; - m_saved_play_time = global_object().performance()->now(); + m_saved_play_time = m_timeline->current_time().value(); // 13. Run the procedure to update an animation’s finished state for animation with the did seek flag set to false, // and the synchronously notify flag set to false. @@ -747,7 +747,7 @@ WebIDL::ExceptionOr Animation::pause() // // Note: This is run_pending_pause_task() m_pending_pause_task = TaskState::Scheduled; - m_saved_pause_time = global_object().performance()->now(); + m_saved_pause_time = m_timeline->current_time().value(); // 11. Run the procedure to update an animation’s finished state for animation with the did seek flag set to false, // and the synchronously notify flag set to false.