LibWeb: Consider cancelled (idle) transitions as "completed"

This commit is contained in:
Callum Law 2025-11-18 23:22:42 +13:00 committed by Jelle Raaijmakers
parent b2b889e1da
commit 67a3d0f1aa
Notes: github-actions[bot] 2025-11-23 08:44:31 +00:00
2 changed files with 8 additions and 8 deletions

View file

@ -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 const& after_change_value = new_style.property(property_id, ComputedProperties::WithAnimationsApplied::No);
auto existing_transition = element.property_transition(pseudo_element, property_id); auto existing_transition = element.property_transition(pseudo_element, property_id);
bool has_running_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(); 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) { 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)); 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); auto const& existing_transition = element.property_transition(pseudo_element, property_id);
dbgln_if(CSS_TRANSITIONS_DEBUG, "Transition step 3."); 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(); existing_transition->cancel();
else else
element.remove_transition(pseudo_element, property_id); element.remove_transition(pseudo_element, property_id);

View file

@ -2,8 +2,8 @@ Harness status: OK
Found 96 tests Found 96 tests
41 Pass 44 Pass
55 Fail 52 Fail
Pass Animation of font in ::marker Pass Animation of font in ::marker
Pass Animation of font-family in ::marker Pass Animation of font-family in ::marker
Fail Animation of font-feature-settings in ::marker Fail Animation of font-feature-settings in ::marker
@ -56,9 +56,9 @@ Pass Transition of font in ::marker
Pass Transition of font-family in ::marker Pass Transition of font-family in ::marker
Pass Transition of font-feature-settings in ::marker Pass Transition of font-feature-settings in ::marker
Pass Transition of font-kerning in ::marker Pass Transition of font-kerning in ::marker
Fail Transition of font-size in ::marker Pass Transition of font-size in ::marker
Fail Transition of font-size-adjust in ::marker Fail Transition of font-size-adjust in ::marker
Fail Transition of font-stretch in ::marker Pass Transition of font-stretch in ::marker
Pass Transition of font-style in ::marker Pass Transition of font-style in ::marker
Fail Transition of font-synthesis in ::marker Fail Transition of font-synthesis in ::marker
Fail Transition of font-synthesis-small-caps in ::marker Fail Transition of font-synthesis-small-caps in ::marker
@ -71,7 +71,7 @@ Pass Transition of font-variant-ligatures in ::marker
Pass Transition of font-variant-numeric in ::marker Pass Transition of font-variant-numeric in ::marker
Pass Transition of font-variant-position in ::marker Pass Transition of font-variant-position in ::marker
Fail Transition of font-weight in ::marker Fail Transition of font-weight in ::marker
Fail Transition of line-height in ::marker Pass Transition of line-height in ::marker
Pass Transition of white-space in ::marker Pass Transition of white-space in ::marker
Pass Transition of color in ::marker Pass Transition of color in ::marker
Fail Transition of text-combine-upright in ::marker Fail Transition of text-combine-upright in ::marker