Auto merge of #26609 - mrobinson:improve-transition-finishing, r=jdm

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 where
animations are removed from the global list of animating transitions
too soon:

 1. A transitions finishes
 2. Restyle
 3. The transition 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.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] There are tests for these changes
This commit is contained in:
bors-servo 2020-05-25 11:07:50 -04:00 committed by GitHub
commit 2fd427270d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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);
}