Repository navigation
[web-animations] account for display animations when resolving style - #26248
webkit-commit-queue merged 1 commit into
Conversation
|
EWS run on current version of this PR (hash 71f32c7) Details |
anttijk
left a comment
There was a problem hiding this comment.
This seems reasonable but you might want to A/B it for perf. I'm not entirely sure what the effect is.
There was a problem hiding this comment.
does affectsRenderedSubtree ever return false now?
There was a problem hiding this comment.
It does since making that function return true yielded a couple of test failures in the subset of tests I've tried this with locally:
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-display-none-001.html → one new PASS result
imported/w3c/web-platform-tests/css/css-transitions/starting-style-cascade.html → one new FAIL result
https://bugs.webkit.org/show_bug.cgi?id=271386 Reviewed by Antti Koivisto. While we added animation support for the `display` property in bug 271372 / 276464@main, we are not yet fully accounting for the possibility that the `display` property is animated when resolving styles in Style::TreeResolver. There are some subtleties there since, historically, transitions could not be started on an element with `display: none` and setting `display: none` on an element with running style-originated animations would cancel those animations. In this patch we now call `createAnimatedElementUpdate()` under `Style::TreeResolver::resolveElement()` even when the non-animated style has `display: none`. Within `createAnimatedElementUpdate()`, we now keep track of the non-animated `display` value prior to updating animations, and when we're done compare this value to its animated counterpart to determine whether animations affected `display`. If after updating animations `display: none` is set and that value was not affected by animations, we cancel any animation created in the process silently (see bug 271365 / 276453@main) such that Web content may not observe that those animations ever were created. We also make sure to keep track of whether `display` was affected by updating animations as a new member of the `ElementUpdate` struct such that when updating renderers in `RenderTreeUpdater::updateElementRenderer()` we only cancel style-originated animations with a `display: none` style if that that `display` value did not come from an animation. Otherwise, style-originated animations setting `display: none` would cancel themselves. These changes allow us to pass the remainder of the WPT test coverage for animating `display`. * LayoutTests/imported/w3c/web-platform-tests/css/css-animations/display-interpolation-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-animations/display-none-dont-cancel.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-display/animations/display-interpolation-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/display.tentative-expected.txt: * Source/WebCore/animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::ticksContinuouslyWhileActive const): * Source/WebCore/rendering/updating/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::updateElementRenderer): * Source/WebCore/style/StyleTreeResolver.cpp: (WebCore::Style::affectsRenderedSubtree): (WebCore::Style::TreeResolver::resolveElement): (WebCore::Style::TreeResolver::createAnimatedElementUpdate): * Source/WebCore/style/StyleUpdate.h: * Source/WebCore/style/Styleable.cpp: (WebCore::Styleable::updateCSSAnimations const): (WebCore::Styleable::updateCSSTransitions const): Canonical link: https://commits.webkit.org/276531@main
71f32c7 to
6778ef1
Compare
|
Committed 276531@main (6778ef1): https://commits.webkit.org/276531@main Reviewed commits have been landed. Closing PR #26248 and removing active labels. |
6778ef1
71f32c7