Skip to content
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

Merged
merged 2 commits into from
Jun 24, 2020

Conversation

mrobinson
Copy link
Member

This change also improves support for creating animations with negative
delays, as that is necessary to test support for fractional iteration
lengths.

Fixes: #14858


@highfive
Copy link

Heads up! This PR modifies the following files:

  • @emilio: components/style/animation.rs

@servo-wpt-sync
Copy link
Collaborator

Opened new PR for upstreamable changes.

Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#24283.

AnimationState::Pending | AnimationState::Canceled | AnimationState::Paused(_) => {
return false
AnimationState::Paused(progress) => {
return self.on_last_iteration() && progress > self.current_iteration_length();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be >=?

Copy link
Member Author

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.

components/style/animation.rs Outdated Show resolved Hide resolved
@Manishearth
Copy link
Member

r? @emilio

@highfive highfive assigned emilio and unassigned Manishearth Jun 22, 2020
Copy link
Member

@emilio emilio left a 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.

@servo-wpt-sync
Copy link
Collaborator

Transplanted upstreamable changes to existing PR.

Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#24283.

@mrobinson
Copy link
Member Author

mrobinson commented Jun 23, 2020

@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 elapsedTime in animation events. If these look good to you, I can land this change.

components/style/animation.rs Outdated Show resolved Hide resolved
@servo-wpt-sync
Copy link
Collaborator

Transplanted upstreamable changes to existing PR.

Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#24283.

@mrobinson
Copy link
Member Author

@bors-servo r=emilio

Thanks again for the reviews!

@bors-servo
Copy link
Contributor

📌 Commit d319b3b has been approved by emilio

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jun 23, 2020
bors-servo added a commit that referenced this pull request Jun 23, 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. -->
@bors-servo
Copy link
Contributor

⌛ Testing commit d319b3b with merge 09c07d0...

@bors-servo
Copy link
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jun 23, 2020
@jdm
Copy link
Member

jdm commented Jun 23, 2020

New 2020 passes:

  ▶ Unexpected subtest result in /css/css-ui/outline-017.html:
  └ PASS [expected FAIL] outline-color is animated as a color
  ▶ Unexpected subtest result in /css/css-ui/outline-017.html:
  └ PASS [expected FAIL] outline-width is animated as a length
  ▶ Unexpected subtest result in /css/css-ui/outline-017.html:
  └ PASS [expected FAIL] outline-offset is animated as a length
  ▶ Unexpected subtest result in /css/css-ui/outline-018.html:
  └ PASS [expected FAIL] outline-style is animated as a discrete type

Failures in 2013 on macOS:

  â–¶ Unexpected subtest result in /css/css-animations/animation-iteration-count-009.html:
  │ FAIL [expected PASS] Floating point iteration count during first iteration
  │   → assert_equals: expected "75px" but got "74.9951px"
  │ 
  │ @http://web-platform.test:8000/css/css-animations/animation-iteration-count-009.html:38:16
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1977:25
  │ promise_test/tests.promise_tests</<@http://web-platform.test:8000/resources/testharness.js:592:36
  â”” promise_test/tests.promise_tests<@http://web-platform.test:8000/resources/testharness.js:591:20

  â–¶ Unexpected subtest result in /css/css-animations/animation-iteration-count-009.html:
  │ FAIL [expected PASS] Floating point iteration count after multiple iterations
  │   → assert_equals: expected "25px" but got "25.0049px"
  │ 
  │ @http://web-platform.test:8000/css/css-animations/animation-iteration-count-009.html:32:16
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1977:25
  │ promise_test/tests.promise_tests</<@http://web-platform.test:8000/resources/testharness.js:592:36
  â”” promise_test/tests.promise_tests<@http://web-platform.test:8000/resources/testharness.js:591:20

  â–¶ Unexpected subtest result in /css/css-animations/animation-iteration-count-009.html:
  │ FAIL [expected PASS] Floating point iteration count with alternating directions
  │   → assert_equals: expected "25px" but got "25.0049px"
  │ 
  │ @http://web-platform.test:8000/css/css-animations/animation-iteration-count-009.html:44:16
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1977:25
  │ promise_test/tests.promise_tests</<@http://web-platform.test:8000/resources/testharness.js:592:36
  â”” promise_test/tests.promise_tests<@http://web-platform.test:8000/resources/testharness.js:591:20

  â–¶ Unexpected subtest result in /_mozilla/css/animations/animation-fill-mode.html:
  │ FAIL [expected PASS] animation-fill-mode: backwards should function correctly
  │   → assert_equals: expected "500px" but got "50px"
  │ 
  │ runThroughAnimation@http://web-platform.test:8000/_mozilla/css/animations/animation-fill-mode.html:52:16
  │ @http://web-platform.test:8000/_mozilla/css/animations/animation-fill-mode.html:84:22
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1977:25
  │ test@http://web-platform.test:8000/resources/testharness.js:535:30
  â”” @http://web-platform.test:8000/_mozilla/css/animations/animation-fill-mode.html:78:5


  â–¶ Unexpected subtest result in /_mozilla/css/animations/animation-delay.html:
  │ FAIL [expected PASS] animation-delay should function correctly
  │   → assert_equals: expected "500px" but got "50px"
  │ 
  │ @http://web-platform.test:8000/_mozilla/css/animations/animation-delay.html:48:16
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1977:25
  │ test@http://web-platform.test:8000/resources/testharness.js:535:30
  â”” @http://web-platform.test:8000/_mozilla/css/animations/animation-delay.html:24:5

  â–¶ Unexpected subtest result in /_mozilla/css/animations/animation-delay.html:
  │ FAIL [expected PASS] animation-delay should function correctly with multiple iterations
  │   → assert_equals: expected "500px" but got "50px"
  │ 
  │ @http://web-platform.test:8000/_mozilla/css/animations/animation-delay.html:85:16
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1977:25
  │ test@http://web-platform.test:8000/resources/testharness.js:535:30
  â”” @http://web-platform.test:8000/_mozilla/css/animations/animation-delay.html:54:5


  â–¶ PASS [expected FAIL] /css/css-animations/animation-delay-011.html

@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Jun 24, 2020
@mrobinson
Copy link
Member Author

@bors-servo try=wpt-2020

@bors-servo
Copy link
Contributor

⌛ Trying commit 98a4f55 with merge 5b3ede2...

bors-servo added a commit that referenced this pull request Jun 24, 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. -->
@bors-servo
Copy link
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jun 24, 2020
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.
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Jun 24, 2020
@servo-wpt-sync
Copy link
Collaborator

Transplanted upstreamable changes to existing PR.

Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#24283.

@mrobinson
Copy link
Member Author

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

⌛ Trying commit cf45100 with merge eb56ac0...

bors-servo added a commit that referenced this pull request Jun 24, 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. -->
@bors-servo
Copy link
Contributor

☀️ Test successful - status-taskcluster
State: approved= try=True

@mrobinson
Copy link
Member Author

@bors-servo try=wpt-2020

@jdm
Copy link
Member

jdm commented Jun 24, 2020

@bors-servo retry

@bors-servo
Copy link
Contributor

⌛ Trying commit cf45100 with merge c3a1b47...

bors-servo added a commit that referenced this pull request Jun 24, 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. -->
@jdm
Copy link
Member

jdm commented Jun 24, 2020

The notification got lost, but all tests passed: https://community-tc.services.mozilla.com/tasks/groups/ObJGefmMTfSS3KTT725Ppg

@jdm
Copy link
Member

jdm commented Jun 24, 2020

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit cf45100 has been approved by jdm

@highfive highfive assigned jdm and unassigned emilio Jun 24, 2020
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jun 24, 2020
@bors-servo
Copy link
Contributor

⌛ Testing commit cf45100 with merge 6659e90...

@bors-servo
Copy link
Contributor

☀️ Test successful - status-taskcluster
Approved by: jdm
Pushing 6659e90 to master...

@bors-servo bors-servo merged commit 6659e90 into servo:master Jun 24, 2020
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jun 24, 2020
@mrobinson mrobinson deleted the fractional-iteration branch June 24, 2020 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need to adjust end of iteration check for decimal animation-iteration-count
7 participants