Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRestyle should reflect animations and transitions #26331
Conversation
highfive
commented
Apr 27, 2020
|
Heads up! This PR modifies the following files:
|
73462ea
to
3321960
|
r? @jdm I don't know anything about animations yet and I'm taking the week off starting tomorrow. |
|
This looks fine but it'd be nice to avoid cloning the style unconditionally. Maybe just wrapping the relevant blocks in an |
| @@ -445,7 +445,10 @@ trait PrivateMatchMethods: TElement { | |||
| let mut animation_state = animation_states.remove(&this_opaque).unwrap_or_default(); | |||
|
|
|||
| if let Some(ref mut old_values) = *old_values { | |||
| animation_state.compute_before_change_style::<Self>( | |||
| // We convert old values into `before-change-style` here. | |||
| let old_values = Arc::make_mut(old_values); | |||
This comment has been minimized.
This comment has been minimized.
emilio
Apr 27, 2020
Member
So, this will copy the style almost surely, right? It'd be nice to not do that if there are no animations running.
This comment has been minimized.
This comment has been minimized.
mrobinson
Apr 27, 2020
Author
Member
Oh, nice catch! I've modified this so that the methods now take an Arc which will ensure that callers don't accidentally clone the style like I did in this version of the change.
| @@ -475,6 +478,20 @@ trait PrivateMatchMethods: TElement { | |||
| .cancel_transitions_with_nontransitioning_properties(&transitioning_properties); | |||
| } | |||
|
|
|||
| { | |||
| let new_values = Arc::make_mut(new_values); | |||
This comment has been minimized.
This comment has been minimized.
emilio
Apr 27, 2020
Member
Same, it seems this will disable all sorts of style sharing optimizations.
This comment has been minimized.
This comment has been minimized.
mrobinson
Apr 27, 2020
Author
Member
Same here. I originally went with an is_empty() check, but ended up doing this in the methods themselves to enable more fine-grained control over when the style is cloned.
3321960
to
08fd1af
|
Thanks for the reviews! I'm about to push a new version of this change which switches back to using |
08fd1af
to
c89f448
|
@bors-servo r=jdm,emilio |
|
|
…milio Restyle should reflect animations and transitions When doing a restyle, we should apply animations and transitions to the new style so that it is reflected in `getComputedStyle()` and the new style information properly cascades. This is the first part of properly ticking animations and transitions. This causes a couple new animations tests failures (along with many new passes), but we currently don't have support for properly handling animations after they have completed, so this isn't totally unexpected. <!-- 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 #20116 <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- 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. -->
|
|
|
So many new passing tests! |
c89f448
to
95adeee
|
@bors-servo r=jdm,emilio Trying this again with updated expectations, but this might take a couple rounds. |
|
There's an ini file with a problem:
|
These are all going to be flaky until we get further along with the transition and animation improvements. The flakiness is due to the fact that it is more likely that these tests pass now.
| @@ -19,20 +19,34 @@ skip: true | |||
| skip: false | |||
| [CSS2] | |||
| skip: false | |||
| [linebox] | |||
| skip:false | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
mrobinson
Apr 29, 2020
Author
Member
Looks like I had an extra level of indentation in the css-align and css-color sections. Should be fixed now.
44f306e
to
fb9c352
|
@bors-servo try=wpt-mac It looked like the tidy precheck passed without issues, so I feel a bit safer about triggering this now. |
Restyle should reflect animations and transitions When doing a restyle, we should apply animations and transitions to the new style so that it is reflected in `getComputedStyle()` and the new style information properly cascades. This is the first part of properly ticking animations and transitions. This causes a couple new animations tests failures (along with many new passes), but we currently don't have support for properly handling animations after they have completed, so this isn't totally unexpected. <!-- 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 #20116 <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- 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 r=jdm,emilio The WPT failure is:
|
|
|
|
@mrobinson For future reference, look at the filtered-wpt-errorsummary.log file instead of the live log. |
…milio Restyle should reflect animations and transitions When doing a restyle, we should apply animations and transitions to the new style so that it is reflected in `getComputedStyle()` and the new style information properly cascades. This is the first part of properly ticking animations and transitions. This causes a couple new animations tests failures (along with many new passes), but we currently don't have support for properly handling animations after they have completed, so this isn't totally unexpected. <!-- 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 #20116 <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- 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 retry |
|
|
mrobinson commentedApr 27, 2020
•
edited
When doing a restyle, we should apply animations and transitions to the
new style so that it is reflected in
getComputedStyle()and the newstyle information properly cascades. This is the first part of properly
ticking animations and transitions.
This causes a couple new animations tests failures (along with many new
passes), but we currently don't have support for properly handling
animations after they have completed, so this isn't totally unexpected.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errors