Skip to content

Conversation

@graouts
Copy link
Contributor

@graouts graouts commented Oct 14, 2025

1fab171

Animation not updated when Container Query units are used
https://bugs.webkit.org/show_bug.cgi?id=299952
rdar://162194744

Reviewed by Antti Koivisto and Anne van Kesteren.

Recompute keyframes when container query units are used for all types of animations,
not just CSS Animations.

* LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/container-units-animation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/container-units-animation.html:
* Source/WebCore/animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::keyframesRuleDidChange):
* Source/WebCore/animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::recomputeKeyframesAtNextOpportunity):
(WebCore::KeyframeEffect::keyframesRuleDidChange): Deleted.
* Source/WebCore/animation/KeyframeEffect.h:
* Source/WebCore/style/Styleable.cpp:
(WebCore::Styleable::queryContainerDidChange const):

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

142e675

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win loading 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 🧪 win-tests ✅ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ❌ 🧪 api-wpe ✅ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 loading-orange 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 🧪 unsafe-merge ✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@graouts graouts self-assigned this Oct 14, 2025
@graouts graouts added the Animations Bugs related to CSS + SVG animations and transitions label Oct 14, 2025
@graouts graouts force-pushed the eng/Animation-not-updated-when-Container-Query-units-are-used branch from 07ab8b8 to 76497b2 Compare October 14, 2025 14:22
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 14, 2025
@graouts graouts removed the merging-blocked Applied to prevent a change from being merged label Oct 15, 2025
@graouts graouts force-pushed the eng/Animation-not-updated-when-Container-Query-units-are-used branch from 76497b2 to 142e675 Compare October 15, 2025 15:38
@graouts graouts requested review from annevk and anttijk and removed request for anttijk October 15, 2025 15:38
@graouts graouts requested review from anttijk, heycam and nt1m October 15, 2025 15:38
@graouts graouts marked this pull request as ready for review October 15, 2025 15:39
if (keyframeEffect && keyframeEffect->blendingKeyframes().usesContainerUnits())
cssAnimation->keyframesRuleDidChange();
for (auto& animation : *animations) {
RefPtr keyframeEffect = dynamicDowncast<KeyframeEffect>(animation->effect());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be sure, effect() here can return a variety of types? (We always seem to dynamicDowncast to KeyframeEffect.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The effect() method returns an AnimationEffect, current subclasses are KeyframeEffect and CustomEffect (experimental at this stage).

@graouts graouts added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Oct 15, 2025
https://bugs.webkit.org/show_bug.cgi?id=299952
rdar://162194744

Reviewed by Antti Koivisto and Anne van Kesteren.

Recompute keyframes when container query units are used for all types of animations,
not just CSS Animations.

* LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/container-units-animation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/container-units-animation.html:
* Source/WebCore/animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::keyframesRuleDidChange):
* Source/WebCore/animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::recomputeKeyframesAtNextOpportunity):
(WebCore::KeyframeEffect::keyframesRuleDidChange): Deleted.
* Source/WebCore/animation/KeyframeEffect.h:
* Source/WebCore/style/Styleable.cpp:
(WebCore::Styleable::queryContainerDidChange const):

Canonical link: https://commits.webkit.org/301584@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Animation-not-updated-when-Container-Query-units-are-used branch from 142e675 to 1fab171 Compare October 15, 2025 22:10
@webkit-commit-queue
Copy link
Collaborator

Committed 301584@main (1fab171): https://commits.webkit.org/301584@main

Reviewed commits have been landed. Closing PR #52296 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 1fab171 into WebKit:main Oct 15, 2025
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Oct 15, 2025
@graouts graouts deleted the eng/Animation-not-updated-when-Container-Query-units-are-used branch October 16, 2025 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Animations Bugs related to CSS + SVG animations and transitions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants