LibWeb: Fix glitchy CSS transitions

`start_needed_transitions()` decides which animations need to be started
based on previous and current style property values. Before this change,
we were using the style value without animations applied as the
"current" value. This caused issues such as starting a new transition
from the animation’s end value when an ongoing animation was
interrupted.
This commit is contained in:
Aliaksandr Kalenik 2025-05-28 15:37:53 +02:00 committed by Tim Ledbetter
commit 36a255eedd
Notes: github-actions[bot] 2025-05-28 16:37:07 +00:00
3 changed files with 4 additions and 15 deletions

View file

@ -150,14 +150,4 @@ double CSSTransition::timing_function_output_at_time(double t) const
return m_keyframe_effect->timing_function().evaluate_at(progress, before_flag);
}
NonnullRefPtr<CSSStyleValue const> CSSTransition::value_at_time(double t, AllowDiscrete allow_discrete) const
{
// https://drafts.csswg.org/css-transitions/#application
auto progress = timing_function_output_at_time(t);
auto result = interpolate_property(*m_keyframe_effect->target(), m_transition_property, m_start_value, m_end_value, progress, allow_discrete);
if (result)
return result.release_nonnull();
return m_start_value;
}
}