Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick 452ca17. rdar://119191813
[web-animations] effect targeting an element with `display: none` should not schedule immediate animation resolution (affects reddit.com) https://bugs.webkit.org/show_bug.cgi?id=265934 rdar://119191813 Reviewed by Simon Fraser and Antti Koivisto. Typically, effects that are in their active phase (ie. their current time is changing from frame to frame (see https://drafts.csswg.org/web-animations-1/#animation-effect-active-phase for details) will schedule immediate animation resolution. However there are exceptions, for instance we don't schedule immediate animation resolution if the effect does not affect styles or if the effect is running accelerated. We now also handle the case where an effect's target does not have a renderer, as would be the case if an element has a `display: none` style, making sure to also handle the `display: contents` case where a renderer is not created for the target element, but will for its children. This helps power usage on reddit.com which has JS-originated animations running infinitely that are targeting elements in shadow roots that eventually lose their renderer. * LayoutTests/webanimations/scheduling-of-animation-with-display-contents-expected.txt: Added. * LayoutTests/webanimations/scheduling-of-animation-with-display-contents.html: Added. * LayoutTests/webanimations/scheduling-of-animation-without-renderer-expected.txt: Added. * LayoutTests/webanimations/scheduling-of-animation-without-renderer.html: Added. * Source/WebCore/animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::ticksContinouslyWhileActive const): Canonical link: https://commits.webkit.org/271614@main Identifier: 267815.620@safari-7617-branch
- Loading branch information