Improve ending of transitions

For legacy reasons, transitions were marked as finished after updating the
style. According to the spec, they should be marked as finished when
animations are updated and before restyle. This change does that as well
as preventing replacement of finished transitions.

Having finished transitions survive a full restyle cycle and allowing
the replacement of finished transition, could lead to issues were
removed from the global list of animating transitions too soon:

 1. A transitions finishes
 2. Restyle
 3. Transitions is marked as finished and events are queued
 4. Restyle cancels finished transition and replaces it instead of
    clearing finished transition
 5. Events are sent for the incorrectly canceled transition removing it
    completely from the list of running transitions due to the extra
    event.
This commit is contained in:
Martin Robinson 2020-05-21 18:16:03 +02:00
parent 14464e49be
commit 218beb9218
6 changed files with 296 additions and 3 deletions

View file

@ -55,6 +55,8 @@ impl Animations {
);
}
}
Self::finish_running_animations(set, now, &mut update);
}
update
}
@ -71,7 +73,6 @@ impl Animations {
for set in sets.values_mut() {
Self::handle_canceled_animations(set, now, &mut update);
Self::finish_running_animations(set, now, &mut update);
Self::handle_new_animations(set, &mut update);
}