Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 06f70dafd01fd79db39f2ba1f0d033dacfb1a516
https://github.com/WebKit/WebKit/commit/06f70dafd01fd79db39f2ba1f0d033dacfb1a516
Author: Brandon Stewart <[email protected]>
Date: 2026-03-18 (Wed, 18 Mar 2026)
Changed paths:
A LayoutTests/printing/animation-fill-forwards-during-print-expected.html
A LayoutTests/printing/animation-fill-forwards-during-print.html
M Source/WebCore/style/StyleTreeResolver.cpp
Log Message:
-----------
[css-animations] animation-fill-mode: forwards not resolved during print
https://bugs.webkit.org/show_bug.cgi?id=310030
rdar://36901701
Reviewed by Antti Koivisto and Antoine Quint.
When printing, CSS animations with animation-fill-mode: forwards don't
resolve to their final state. Elements that animated from opacity: 0 to
opacity: 1 remain invisible in print output.
The updateAnimations lambda in StyleTreeResolver bailed out entirely when
document->printing() was true, which skipped updateCSSAnimations(). This
meant animation objects weren't maintained across the screen-to-print
media type transition, and for test infrastructure paths where
setPrinting() is called before first render, animations were never
created at all.
Restructure the guard so that only transitions and scroll/view timelines
are skipped during print (irrelevant for paginated media), while
updateCSSAnimations() is always called. This is safe because
updateCSSAnimations() is a no-op when the animation list hasn't changed.
Test: printing/animation-fill-forwards-during-print.html
* LayoutTests/printing/animation-fill-forwards-during-print-expected.html:
Added.
* LayoutTests/printing/animation-fill-forwards-during-print.html: Added.
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
Canonical link: https://commits.webkit.org/309488@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications