mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Consider cancelled (idle) transitions as "completed"
This commit is contained in:
parent
b2b889e1da
commit
67a3d0f1aa
Notes:
github-actions[bot]
2025-11-23 08:44:31 +00:00
Author: https://github.com/Calme1709
Commit: 67a3d0f1aa
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6854
Reviewed-by: https://github.com/gmta ✅
2 changed files with 8 additions and 8 deletions
|
|
@ -1305,8 +1305,8 @@ void StyleComputer::start_needed_transitions(ComputedProperties const& previous_
|
|||
auto const& after_change_value = new_style.property(property_id, ComputedProperties::WithAnimationsApplied::No);
|
||||
|
||||
auto existing_transition = element.property_transition(pseudo_element, property_id);
|
||||
bool has_running_transition = existing_transition && !existing_transition->is_finished();
|
||||
bool has_completed_transition = existing_transition && existing_transition->is_finished();
|
||||
bool has_running_transition = existing_transition && !existing_transition->is_finished() && !existing_transition->is_idle();
|
||||
bool has_completed_transition = existing_transition && (existing_transition->is_finished() || existing_transition->is_idle());
|
||||
|
||||
auto start_a_transition = [&](auto delay, auto start_time, auto end_time, auto const& start_value, auto const& end_value, auto const& reversing_adjusted_start_value, auto reversing_shortening_factor) {
|
||||
dbgln_if(CSS_TRANSITIONS_DEBUG, "Starting a transition of {} from {} to {}", string_from_property_id(property_id), start_value.to_string(SerializationMode::Normal), end_value.to_string(SerializationMode::Normal));
|
||||
|
|
@ -1483,7 +1483,7 @@ void StyleComputer::start_needed_transitions(ComputedProperties const& previous_
|
|||
auto const& existing_transition = element.property_transition(pseudo_element, property_id);
|
||||
|
||||
dbgln_if(CSS_TRANSITIONS_DEBUG, "Transition step 3.");
|
||||
if (!existing_transition->is_finished())
|
||||
if (!existing_transition->is_finished() && !existing_transition->is_idle())
|
||||
existing_transition->cancel();
|
||||
else
|
||||
element.remove_transition(pseudo_element, property_id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue