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

mrobinson commented Jun 22, 2020

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
  • These changes fix #14858
  • There are tests for these changes
@highfive
Copy link

highfive commented Jun 22, 2020

Heads up! This PR modifies the following files:

  • @emilio: components/style/animation.rs
@servo-wpt-sync
Copy link
Collaborator

servo-wpt-sync commented Jun 22, 2020

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();

This comment has been minimized.

@emilio

emilio Jun 22, 2020

Member

Should it be >=?

This comment has been minimized.

@mrobinson

mrobinson Jun 23, 2020

Author Member

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

Manishearth commented Jun 22, 2020

r? @emilio

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

emilio left a comment

This looks pretty sensible to me.

@mrobinson mrobinson force-pushed the mrobinson:fractional-iteration branch from ab19b5b to 1bb0796 Jun 23, 2020
@servo-wpt-sync
Copy link
Collaborator

servo-wpt-sync commented Jun 23, 2020

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.

@emilio
emilio approved these changes Jun 23, 2020
components/style/animation.rs Outdated Show resolved Hide resolved
@mrobinson mrobinson force-pushed the mrobinson:fractional-iteration branch from 1bb0796 to d319b3b Jun 23, 2020
@servo-wpt-sync
Copy link
Collaborator

servo-wpt-sync commented Jun 23, 2020

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

@bors-servo r=emilio

Thanks again for the reviews!

@bors-servo
Copy link
Contributor

bors-servo commented Jun 23, 2020

📌 Commit d319b3b has been approved by emilio

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

bors-servo commented Jun 23, 2020

Testing commit d319b3b with merge 09c07d0...

@bors-servo
Copy link
Contributor

bors-servo commented Jun 23, 2020

💔 Test failed - status-taskcluster

@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
@mrobinson mrobinson force-pushed the mrobinson:fractional-iteration branch from d319b3b to 98a4f55 Jun 24, 2020
@bors-servo
Copy link
Contributor

bors-servo commented Jun 24, 2020

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

bors-servo commented Jun 24, 2020

💔 Test failed - status-taskcluster

mrobinson added 2 commits Jun 22, 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: #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.
@mrobinson mrobinson force-pushed the mrobinson:fractional-iteration branch from 98a4f55 to cf45100 Jun 24, 2020
@servo-wpt-sync
Copy link
Collaborator

servo-wpt-sync commented Jun 24, 2020

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 24, 2020

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Jun 24, 2020

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

bors-servo commented Jun 24, 2020

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

@mrobinson
Copy link
Member Author

mrobinson commented Jun 24, 2020

@bors-servo try=wpt-2020

@jdm
Copy link
Member

jdm commented Jun 24, 2020

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Jun 24, 2020

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

@jdm
Copy link
Member

jdm commented Jun 24, 2020

@bors-servo
Copy link
Contributor

bors-servo commented Jun 24, 2020

📌 Commit cf45100 has been approved by jdm

@highfive highfive assigned jdm and unassigned emilio Jun 24, 2020
@bors-servo
Copy link
Contributor

bors-servo commented Jun 24, 2020

Testing commit cf45100 with merge 6659e90...

@bors-servo
Copy link
Contributor

bors-servo commented Jun 24, 2020

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

@bors-servo bors-servo merged commit 6659e90 into servo:master Jun 24, 2020
2 checks passed
2 checks passed
Community-TC (pull_request) TaskGroup: success
Details
homu Test successful
Details
@mrobinson mrobinson deleted the mrobinson:fractional-iteration branch Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

7 participants
You can’t perform that action at this time.