Repository navigation
Add @keyframes and animation-* support. - #11766
Conversation
|
Heads up! This PR modifies the following files:
|
|
@bors-servo: try |
Add `@keyframes` and `animation-*` rule parsing - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] There are tests for these changes <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> This adds support for parsing `@keyframes` rules, and animation properties. Stylo will need it sometime soonish, plus I want to make animations work in Servo. The remaining part is doin the math and trigger the animations correctly from servo. I don't expect it to be *that* hard, but probaby I'll need to learn a bit more about the current animation infra (e.g. why the heck is the `new_animations_sender` guarded by a `Mutex`?). I'd expect to land this, since this is already a bunch of work, this is the part exclusively required by stylo (at least if we don't use Servo's machinery), the media query parsing is tested, and the properties land after a flag, but if you prefer to wait until I finish this up it's fine for me too. r? @SimonSapin cc @pcwalton @bholley
|
💔 Test failed - android |
|
@bors-servo: retry
|
Add `@keyframes` and `animation-*` rule parsing - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] There are tests for these changes <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> This adds support for parsing `@keyframes` rules, and animation properties. Stylo will need it sometime soonish, plus I want to make animations work in Servo. The remaining part is doin the math and trigger the animations correctly from servo. I don't expect it to be *that* hard, but probaby I'll need to learn a bit more about the current animation infra (e.g. why the heck is the `new_animations_sender` guarded by a `Mutex`?). I'd expect to land this, since this is already a bunch of work, this is the part exclusively required by stylo (at least if we don't use Servo's machinery), the media query parsing is tested, and the properties land after a flag, but if you prefer to wait until I finish this up it's fine for me too. r? @SimonSapin cc @pcwalton @bholley <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11766) <!-- Reviewable:end -->
|
💔 Test failed - android |
|
@bors-servo: retry
|
Add `@keyframes` and `animation-*` rule parsing - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] There are tests for these changes <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> This adds support for parsing `@keyframes` rules, and animation properties. Stylo will need it sometime soonish, plus I want to make animations work in Servo. The remaining part is doin the math and trigger the animations correctly from servo. I don't expect it to be *that* hard, but probaby I'll need to learn a bit more about the current animation infra (e.g. why the heck is the `new_animations_sender` guarded by a `Mutex`?). I'd expect to land this, since this is already a bunch of work, this is the part exclusively required by stylo (at least if we don't use Servo's machinery), the media query parsing is tested, and the properties land after a flag, but if you prefer to wait until I finish this up it's fine for me too. r? @SimonSapin cc @pcwalton @bholley <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11766) <!-- Reviewable:end -->
|
The android builder is out of space. We won't be able to merge anything until that's fixed. |
|
@pcwalton: Do you know if there's a specific reason to have |
|
I assume because it can be used from multiple worker threads, and Senders aren't Sync. |
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows |
|
@jdm: but you can clone it and move it, right? |
|
The last commit won't pass tidy, but it's a large-ish refactor of how computed properties are calculated, so I thought it could be worth it to push it for now, since I won't be able to work on it more today. |
|
The latest commits actually get keyframes working to a decent extent \o/. Probably part of the approach could/should be reviewed by @pcwalton. Regarding the There are a few known shortcomings that must be solved before merging, read the last commit for details, but I think this approach is decent enough that I can get some feedback on it. Also, a huge cleanup is needed, but with the following html file: <!doctype html>
<meta charset="utf-8">
<style>
@keyframes foo {
from { transform: scale(0.5); }
to { transform: scale(1.5) }
}
div {
animation-name: foo;
animation-duration: 1.5s;
animation-timing-function: ease;
animation-iteration-count: infinite;
border-radius: 100px;
width: 200px;
height: 200px;
line-height: 200px;
margin: 100px;
background-color: red;
text-align: center;
font-family: sans-serif;
font-weight: bold;
color: white;
}
/* See the last commit message to see why */
div:hover { }
</style>
<div>Hello Servo!</div>This is the output (after hovering the element), and sorry for the bad quality of the gif: |
@keyframes and animation-* rule parsing@keyframes and animation-* support.
798807d to
39973df
Compare
|
☔ The latest upstream changes (presumably #11804) made this pull request unmergeable. Please resolve the merge conflicts. |
39973df to
8f1cc1a
Compare
Although we don't generate a "computed" keyframe animation, we're required to shadow others.
d7424af to
9fe0fdd
Compare
|
Let’s call it r=SimonSapin+pcwalton with a rebase. |
eab682b to
d7e535a
Compare
|
Ok, rebased and squashed wip commits. @bors-servo: r=SimonSapin,pcwalton |
|
📌 Commit d7e535a has been approved by |
d7e535a to
392f243
Compare
|
@bors-servo: r=SimonSapin,pcwalton Fixed geckolib build that was complaining after the rustup for a private type alias of a public type in a public member: |
|
📌 Commit 392f243 has been approved by |
|
💡 This pull request was already approved, no need to approve it again.
|
|
📌 Commit 392f243 has been approved by |
Add `@keyframes` and `animation-*` support. - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] There are tests for these changes <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> This adds support for parsing `@keyframes` rules, and animation properties. Stylo will need it sometime soonish, plus I want to make animations work in Servo. The remaining part is doin the math and trigger the animations correctly from servo. I don't expect it to be *that* hard, but probaby I'll need to learn a bit more about the current animation infra (e.g. why the heck is the `new_animations_sender` guarded by a `Mutex`?). I'd expect to land this, since this is already a bunch of work, this is the part exclusively required by stylo (at least if we don't use Servo's machinery), the media query parsing is tested, and the properties land after a flag, but if you prefer to wait until I finish this up it's fine for me too. r? @SimonSapin cc @pcwalton @bholley <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11766) <!-- Reviewable:end -->
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows |

./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis adds support for parsing
@keyframesrules, and animation properties. Stylo will need it sometime soonish, plus I want to make animations work in Servo.The remaining part is doin the math and trigger the animations correctly from servo. I don't expect it to be that hard, but probaby I'll need to learn a bit more about the current animation infra (e.g. why the heck is the
new_animations_senderguarded by aMutex?).I'd expect to land this, since this is already a bunch of work, this is the part exclusively required by stylo (at least if we don't use Servo's machinery), the media query parsing is tested, and the properties land after a flag, but if you prefer to wait until I finish this up it's fine for me too.
r? @SimonSapin
cc @pcwalton @bholley
This change is