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

Complete animations whether or not cascade needs done #12623

Merged
merged 2 commits into from Jul 28, 2016

Conversation

@notriddle
Copy link
Contributor

notriddle commented Jul 27, 2016

  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • There are tests for these changes
  • These changes fix #12554 (github issue number if applicable).

This change is Reviewable

@highfive
Copy link

highfive commented Jul 27, 2016

Heads up! This PR modifies the following files:

  • @bholley: components/style/traversal.rs
@highfive
Copy link

highfive commented Jul 27, 2016

warning Warning warning

  • These commits modify style code, but no tests are modified. Please consider adding a test!
if let Some(ref animations) = animations_to_expire {
for animation in *animations {
// NB: Expiring a keyframes animation is the same as not
// applying the keyframes style to it, so we're safe.

This comment has been minimized.

Copy link
@emilio

emilio Jul 27, 2016

Member

This is not quite true, could you make a note about supporting animation fill mode?

@emilio
Copy link
Member

emilio commented Jul 28, 2016

Reviewed 2 of 2 files at r2, 2 of 2 files at r3, 1 of 2 files at r5.
Review status: 1 of 4 files reviewed at latest revision, 2 unresolved discussions.


components/style/matching.rs, line 477 [r3] (raw file):

                for animation in *animations {
                    // TODO: support animation-fill-mode
                    if let Animation::Transition(_, _, ref frame, _) = *animation {

Can we factor this code out and use it in both situations?


components/style/traversal.rs, line 239 [r1] (raw file):

    } else {
        // Finish any expired transitions, without performing the cascade.
        let node_opaque = node.opaque();

I'm kind of worried this is a bit overkill in the common case there aren't transitions to expire. Also, I wonder if this will even work now #12563 has landed, where we won't process the nodes that aren't marked as needing a restyle. We also don't construct flows again for every node, so this might be fixed with that patch?

In case it's not: What about just layout marking nodes as dirty once it detects there's an animation to expire, and running the cascade then? Hmm... But layout only knows about OpaqueNodes, and by design these are not convertible back to a node... Maybe they should be from script?

Other way to do it is adding a flag to the node (IS_ANIMATED?) in start_transitions_if_applicable, but then we should have another flag, let's say HAS_ANIMATED_CHILDREN, and keep doing the traversal for these too.

Another solution that may actually work even better is updating the expired animation style from layout (in recalc_style_for_animations)?

We could remove the items in the expired animations map there if it's not needed from the cascade (haven't actually tested it), but even if it's needed, updating the style there should prevent it getting updated again until a proper restyle with cascade is done.


components/style/traversal.rs, line 252 [r1] (raw file):

Previously, emilio (Emilio Cobos Álvarez) wrote…

This is not quite true, could you make a note about supporting animation fill mode?

Thanks!

Comments from Reviewable

@emilio
Copy link
Member

emilio commented Jul 28, 2016

Review status: 1 of 4 files reviewed at latest revision, 2 unresolved discussions.


components/style/traversal.rs, line 239 [r1] (raw file):

Previously, emilio (Emilio Cobos Álvarez) wrote…

I'm kind of worried this is a bit overkill in the common case there aren't transitions to expire. Also, I wonder if this will even work now #12563 has landed, where we won't process the nodes that aren't marked as needing a restyle. We also don't construct flows again for every node, so this might be fixed with that patch?

In case it's not: What about just layout marking nodes as dirty once it detects there's an animation to expire, and running the cascade then? Hmm... But layout only knows about OpaqueNodes, and by design these are not convertible back to a node... Maybe they should be from script?

Other way to do it is adding a flag to the node (IS_ANIMATED?) in start_transitions_if_applicable, but then we should have another flag, let's say HAS_ANIMATED_CHILDREN, and keep doing the traversal for these too.

Another solution that may actually work even better is updating the expired animation style from layout (in recalc_style_for_animations)?

We could remove the items in the expired animations map there if it's not needed from the cascade (haven't actually tested it), but even if it's needed, updating the style there should prevent it getting updated again until a proper restyle with cascade is done.

Actually, thinking about it a bit more, this applies in the case an element isn't restyled, but its children are right? (i.e. the `HAS_DIRTY_DESCENDANTS` flag). In that case, I guess the overhead is not so much.

Comments from Reviewable

@notriddle
Copy link
Contributor Author

notriddle commented Jul 28, 2016

components/style/matching.rs, line 477 [r3] (raw file):

Previously, emilio (Emilio Cobos Álvarez) wrote…

Can we factor this code out and use it in both situations?

I've been thinking about it, and I'm pretty sure I can do that, yeah.

Comments from Reviewable

node.opaque(),
node.mutate_data().unwrap().style.as_mut().unwrap(),
context.shared_context()
);

This comment has been minimized.

Copy link
@emilio

emilio Jul 28, 2016

Member

Aren't we doing this twice now in the cascade case?

@notriddle
Copy link
Contributor Author

notriddle commented Jul 28, 2016

components/style/traversal.rs, line 244 [r7] (raw file):

Previously, emilio (Emilio Cobos Álvarez) wrote…

Aren't we doing this twice now in the cascade case?

Oh, right, oops.

Comments from Reviewable

@emilio
Copy link
Member

emilio commented Jul 28, 2016

@bors-servo: try

Let's check if there's any other transition/animation test that could check this in wpt.

@bors-servo
Copy link
Contributor

bors-servo commented Jul 28, 2016

Trying commit d908d52 with merge 8e3eafb...

bors-servo added a commit that referenced this pull request Jul 28, 2016
Complete animations whether or not cascade needs done

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12554 (github issue number if applicable).
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12623)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 28, 2016

💔 Test failed - linux-rel

@notriddle
Copy link
Contributor Author

notriddle commented Jul 28, 2016

  ▶ Unexpected subtest result in /_mozilla/mozilla/mozbrowser/iframe_visibility.html:
  │ FAIL [expected PASS] Requesting animation frame composites only when frame is visible
  │   → assert_true: expected true got false
  │ 
  │ iframe.onload</<@http://web-platform.test:8000/_mozilla/mozilla/mozbrowser/iframe_visibility.html:58:13
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1402:20
  └ Test.prototype.step_func/<@http://web-platform.test:8000/resources/testharness.js:1426:20

Other than that, no unexpected test results, including passes.

@emilio
Copy link
Member

emilio commented Jul 28, 2016

Cool, r=me then.

@bors-servo: r+

On 07/28/2016 11:14 AM, Michael Howell wrote:

| Unexpected subtest result in
/_mozilla/mozilla/mozbrowser/iframe_visibility.html: │ FAIL [expected
PASS] Requesting animation frame composites only when frame is visible │
→ assert_true: expected true got false │ │
iframe.onload</<@http://web-platform.test:8000/_mozilla/mozilla/mozbrowser/iframe_visibility.html:58:13

Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1402:20

Test.prototype.step_func/<@http://web-platform.test:8000/resources/testharness.js:1426:20
|

Other than that, no unexpected test results, including passes.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#12623 (comment), or
mute the thread
https://github.com/notifications/unsubscribe-auth/ABQwuhcySOSOPd1ueQRC0SJ9sW6JTyzqks5qaPGbgaJpZM4JWcsF.

@bors-servo
Copy link
Contributor

bors-servo commented Jul 28, 2016

📌 Commit d908d52 has been approved by emilio

@emilio
Copy link
Member

emilio commented Jul 28, 2016

@bors-servo: r-

Could you squash before, please?

@bors-servo: delegate+

@bors-servo
Copy link
Contributor

bors-servo commented Jul 28, 2016

✌️ @notriddle can now approve this pull request

@notriddle
Copy link
Contributor Author

notriddle commented Jul 28, 2016

Is iframe_visibliity.html a known intermittent? Because there's no issue for it.

@jdm
Copy link
Member

jdm commented Jul 28, 2016

@notriddle
Copy link
Contributor Author

notriddle commented Jul 28, 2016

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

bors-servo commented Jul 28, 2016

📌 Commit f70b8c7 has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Jul 28, 2016

Testing commit f70b8c7 with merge 27d8fb3...

bors-servo added a commit that referenced this pull request Jul 28, 2016
Complete animations whether or not cascade needs done

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12554 (github issue number if applicable).
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12623)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 28, 2016

@bors-servo bors-servo merged commit f70b8c7 into servo:master Jul 28, 2016
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
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.

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