Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 452ca171058f6b23dfd986c79b8093939c9b32ce
https://github.com/WebKit/WebKit/commit/452ca171058f6b23dfd986c79b8093939c9b32ce
Author: Antoine Quint <[email protected]>
Date: 2023-12-06 (Wed, 06 Dec 2023)
Changed paths:
A
LayoutTests/webanimations/scheduling-of-animation-with-display-contents-expected.txt
A
LayoutTests/webanimations/scheduling-of-animation-with-display-contents.html
A
LayoutTests/webanimations/scheduling-of-animation-without-renderer-expected.txt
A LayoutTests/webanimations/scheduling-of-animation-without-renderer.html
M Source/WebCore/animation/KeyframeEffect.cpp
Log Message:
-----------
[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
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes