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

Add support for remaining animation and transition events #26659

Merged
merged 2 commits into from May 27, 2020

Conversation

@mrobinson
Copy link
Member

mrobinson commented May 26, 2020

This PR adds support for remaining animation and transitions events.
There are two commits here. The first is a bit more complicated: it reworks
how rooting is done for animating nodes. Instead of having the ScriptThread
try to track which animations are active via events (which can be inaccurate),
it just maintains roots for nodes that are actually present in the animations-
-related data structures. The second commit adds support for the new events.

Unfortunately, the existing events tests either rely on the Web Animations API
or other behavior (for example, that changing animation delay restarts
an animation). Since those two things are out-of-scope for this change,
I've forked some of the WPT tests, removed the reliance on the Web
Animations API, and added them to Servo's internal tests.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #21564.
  • There are tests for these changes OR
@highfive
Copy link

highfive commented May 26, 2020

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/window.rs, components/script/dom/document.rs, components/script/animations.rs, components/script/script_thread.rs
  • @KiChjang: components/script/dom/window.rs, components/script/dom/document.rs, components/script/animations.rs, components/script/script_thread.rs
  • @emilio: components/style/animation.rs
@highfive
Copy link

highfive commented May 26, 2020

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
Copy link
Member

jdm left a comment

Great work!

components/script/animations.rs Outdated Show resolved Hide resolved
components/script/animations.rs Outdated Show resolved Hide resolved
components/script/dom/document.rs Outdated Show resolved Hide resolved
components/script/animations.rs Outdated Show resolved Hide resolved
components/script/animations.rs Outdated Show resolved Hide resolved
mrobinson added 2 commits May 23, 2020
Instead of having `ScriptThread` handle rooting nodes, do this in
`Animations`. This makes it easier to know when it is appropriate to
root and unroot nodes instead of relying on a certain order of events.
This also allows reducing quite a bit the amount of unsafe code.
@mrobinson mrobinson force-pushed the mrobinson:events branch from bf6f949 to 77aa372 May 26, 2020
@mrobinson
Copy link
Member Author

mrobinson commented May 26, 2020

Thanks for the review. I've pushed a new version taking into account your suggestions.

@jdm
Copy link
Member

jdm commented May 26, 2020

@bors-servo
Copy link
Contributor

bors-servo commented May 26, 2020

📌 Commit 77aa372 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented May 27, 2020

Testing commit 77aa372 with merge 22ef2e7...

bors-servo added a commit that referenced this pull request May 27, 2020
Add support for remaining animation and transition events

This PR adds support for remaining animation and transitions events.
There are two commits here. The first is a bit more complicated: it reworks
how rooting is done for animating nodes. Instead of having the `ScriptThread`
try to track which animations are active via events (which can be inaccurate),
it just maintains roots for nodes that are actually present in the animations-
-related data structures. The second commit adds support for the new events.

Unfortunately, the existing events tests either rely on the Web Animations API
or other behavior (for example, that changing animation delay restarts
an animation). Since those two things are out-of-scope for this change,
I've forked some of the WPT tests, removed the reliance on the Web
Animations API, and added them to Servo's internal tests.

---
<!-- 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 #21564.
- [x] There are tests for these changes OR

<!-- 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 May 27, 2020

💔 Test failed - status-taskcluster

@CYBAI
Copy link
Collaborator

CYBAI commented May 27, 2020

@bors-servo
Copy link
Contributor

bors-servo commented May 27, 2020

Testing commit 77aa372 with merge 93a6c37...

@bors-servo
Copy link
Contributor

bors-servo commented May 27, 2020

☀️ Test successful - status-taskcluster
Approved by: jdm
Pushing 93a6c37 to master...

@bors-servo bors-servo merged commit 93a6c37 into servo:master May 27, 2020
2 checks passed
2 checks passed
Community-TC (pull_request) TaskGroup: success
Details
homu Test successful
Details
@mrobinson mrobinson deleted the mrobinson:events branch May 27, 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.

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