mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
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:
parent
62739c30d9
commit
36a255eedd
Notes:
github-actions[bot]
2025-05-28 16:37:07 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 36a255eedd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4903
Reviewed-by: https://github.com/tcl3 ✅
3 changed files with 4 additions and 15 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue