Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 243e5fe708ed5bbba9f6e7ae34bff9a678907614
      
https://github.com/WebKit/WebKit/commit/243e5fe708ed5bbba9f6e7ae34bff9a678907614
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-03-26 (Thu, 26 Mar 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-animations/responsive/fill-forwards-viewport-units-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-animations/responsive/fill-forwards-viewport-units.html
    A 
LayoutTests/imported/w3c/web-platform-tests/web-animations/responsive/fill-forwards-viewport-units-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/web-animations/responsive/fill-forwards-viewport-units.html
    M Source/WebCore/animation/BlendingKeyframes.cpp
    M Source/WebCore/animation/BlendingKeyframes.h
    M Source/WebCore/style/StyleResolver.cpp
    M Source/WebCore/style/StyleScope.cpp
    M Source/WebCore/style/StyleTreeResolver.cpp
    M Source/WebCore/style/Styleable.cpp
    M Source/WebCore/style/Styleable.h

  Log Message:
  -----------
  animation-fill-mode does not correctly apply viewport-based units
https://bugs.webkit.org/show_bug.cgi?id=227615
rdar://80075191

Reviewed by Antoine Quint.

When an animation with animation-fill-mode: forwards uses viewport units
(vw, vh) in keyframes, the filled values become stale on viewport resize.
The cached BlendingKeyframes are never recomputed because there is no
viewport-unit-aware invalidation for animations.

This mirrors the existing container unit pattern  (usesContainerUnits /
queryContainerDidChange):

- Add BlendingKeyframes::usesViewportUnits() to detect viewport units in
keyframe styles.
- Add Styleable::viewportSizeDidChange() which clears and recomputes
blending keyframes for animations using viewport units.
- Call viewportSizeDidChange() from StyleScope::didChangeViewportSize()
and ensure full style invalidation when animations use viewport units.
- Set the document's hasStyleWithViewportUnits flag when keyframe styles
use viewport units, so didChangeViewportSize() does not early-return.
- Remove the FIXME in StyleTreeResolver.cpp that noted this gap.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-animations/responsive/fill-forwards-viewport-units-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-animations/responsive/fill-forwards-viewport-units.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/web-animations/responsive/fill-forwards-viewport-units-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/web-animations/responsive/fill-forwards-viewport-units.html:
 Added.
* Source/WebCore/animation/BlendingKeyframes.cpp:
(WebCore::BlendingKeyframes::usesContainerUnits const):
(WebCore::BlendingKeyframes::usesViewportUnits const):
* Source/WebCore/animation/BlendingKeyframes.h:
* Source/WebCore/style/StyleResolver.cpp:
(WebCore::Style::Resolver::styleForKeyframe const):
* Source/WebCore/style/StyleScope.cpp:
(WebCore::Style::Scope::didChangeViewportSize):
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
* Source/WebCore/style/Styleable.cpp:
(WebCore::Styleable::viewportSizeDidChange const):
* Source/WebCore/style/Styleable.h:

Canonical link: https://commits.webkit.org/310007@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to