-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
animations: Finish support for fractional iteration counts #27032
Conversation
Heads up! This PR modifies the following files:
|
Opened new PR for upstreamable changes. Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#24283. |
components/style/animation.rs
Outdated
AnimationState::Pending | AnimationState::Canceled | AnimationState::Paused(_) => { | ||
return false | ||
AnimationState::Paused(progress) => { | ||
return self.on_last_iteration() && progress > self.current_iteration_length(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be >=
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've corrected this, which I think was a weird side-effect of the fact that we used to iterate past the last expected iteration when animations finished. I've corrected that and updated to code to reflect it. I think things should be less confusing now. This has also led me to make some improvements to how we calculate elapsedTime
for animation events. It should be correct now for fractional iteration counts.
r? @emilio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty sensible to me.
ab19b5b
to
1bb0796
Compare
Transplanted upstreamable changes to existing PR. Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#24283. |
@emilio Thanks for the review! I've pushed a new version of the branch that adds a few more extra changes to improve the way we handle iteration counts in animations and calculate |
1bb0796
to
d319b3b
Compare
Transplanted upstreamable changes to existing PR. Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#24283. |
@bors-servo r=emilio Thanks again for the reviews! |
📌 Commit d319b3b has been approved by |
animations: Finish support for fractional iteration counts This change also improves support for creating animations with negative delays, as that is necessary to test support for fractional iteration lengths. Fixes: #14858 <!-- 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 - [x] These changes fix #14858 - [x] There are tests for these changes <!-- 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. -->
💔 Test failed - status-taskcluster |
New 2020 passes:
Failures in 2013 on macOS:
|
d319b3b
to
98a4f55
Compare
@bors-servo try=wpt-2020 |
animations: Finish support for fractional iteration counts This change also improves support for creating animations with negative delays, as that is necessary to test support for fractional iteration lengths. Fixes: #14858 <!-- 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 - [x] These changes fix #14858 - [x] There are tests for these changes <!-- 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. -->
💔 Test failed - status-taskcluster |
This change also improves support for creating animations with negative delays, as that is necessary to test support for fractional iteration lengths. This change also adjusts existing Servo animation tests which assumed that advancing to the exact moment of the end of the animation would be considered "before the end." With this change, this moment is "after the end." Fixes: servo#14858
This conversion can lead to floating point errors and extra work when computing animations. Avoiding it allows animation-iteration-count-009.html to pass.
98a4f55
to
cf45100
Compare
Transplanted upstreamable changes to existing PR. Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#24283. |
@bors-servo try=wpt |
animations: Finish support for fractional iteration counts This change also improves support for creating animations with negative delays, as that is necessary to test support for fractional iteration lengths. Fixes: #14858 <!-- 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 - [x] These changes fix #14858 - [x] There are tests for these changes <!-- 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. -->
☀️ Test successful - status-taskcluster |
@bors-servo try=wpt-2020 |
@bors-servo retry |
animations: Finish support for fractional iteration counts This change also improves support for creating animations with negative delays, as that is necessary to test support for fractional iteration lengths. Fixes: #14858 <!-- 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 - [x] These changes fix #14858 - [x] There are tests for these changes <!-- 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. -->
The notification got lost, but all tests passed: https://community-tc.services.mozilla.com/tasks/groups/ObJGefmMTfSS3KTT725Ppg |
@bors-servo r+ |
📌 Commit cf45100 has been approved by |
☀️ Test successful - status-taskcluster |
This change also improves support for creating animations with negative
delays, as that is necessary to test support for fractional iteration
lengths.
Fixes: #14858
./mach build -d
does not report any errors./mach test-tidy
does not report any errors