Auto merge of #26214 - mrobinson:animation-eliminate-animation-frame, r=emilio

Eliminate `AnimationFrame`

This intermediate data structure doesn't really buy us anything and is a
bit confusing.

<!-- Please describe your changes on the following line: -->

---
<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they do not change behavior.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
bors-servo 2020-04-18 10:34:44 -04:00 committed by GitHub
commit 3a1531f18f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 62 deletions

View file

@ -80,8 +80,8 @@ pub fn update_animation_state<E>(
for mut running_animation in running_animations.drain(..) {
let still_running = !running_animation.is_expired() &&
match running_animation {
Animation::Transition(_, started_at, ref frame) => {
now < started_at + frame.duration
Animation::Transition(_, started_at, ref property_animation) => {
now < started_at + (property_animation.duration)
},
Animation::Keyframes(_, _, _, ref mut state) => {
// This animation is still running, or we need to keep
@ -100,12 +100,12 @@ pub fn update_animation_state<E>(
continue;
}
if let Animation::Transition(node, _, ref frame) = running_animation {
if let Animation::Transition(node, _, ref property_animation) = running_animation {
script_chan
.send(ConstellationControlMsg::TransitionEnd(
node.to_untrusted_node_address(),
frame.property_animation.property_name().into(),
frame.duration,
property_animation.property_name().into(),
property_animation.duration,
))
.unwrap();
}