From 360082544c556fb4317773a20052e07bad8980f5 Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Sun, 4 Feb 2024 17:23:01 -0700 Subject: [PATCH] LibWeb: Fix incorrect Animation active_time in the after phase --- Userland/Libraries/LibWeb/Animations/AnimationEffect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Animations/AnimationEffect.cpp b/Userland/Libraries/LibWeb/Animations/AnimationEffect.cpp index 3c965debe3..c9fa8f5ba3 100644 --- a/Userland/Libraries/LibWeb/Animations/AnimationEffect.cpp +++ b/Userland/Libraries/LibWeb/Animations/AnimationEffect.cpp @@ -240,8 +240,8 @@ Optional AnimationEffect::active_time_using_fill(Bindings::FillMode fill // -> If the fill mode is forwards or both, if (fill_mode == Bindings::FillMode::Forwards || fill_mode == Bindings::FillMode::Both) { - // Return the result of evaluating max(local time - start delay - active duration, 0). - return max(local_time().value() - m_start_delay - active_duration(), 0.0); + // Return the result of evaluating max(min(local time - start delay, active duration), 0). + return max(min(local_time().value() - m_start_delay, active_duration()), 0.0); } // -> Otherwise,