Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ef00a2bc79a56bdd9cb2ac27ab3d42662f82deea
      
https://github.com/WebKit/WebKit/commit/ef00a2bc79a56bdd9cb2ac27ab3d42662f82deea
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-05-08 (Fri, 08 May 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-index-keyframe-font-style-dynamic-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-index-keyframe-font-variation-settings-dynamic-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-index-keyframe-font-weight-dynamic-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-index-keyframe-length-value-dynamic-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-index-keyframe-registered-properties-dynamic-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-index-keyframe-rotate-dynamic-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-index-keyframe-scale-dynamic-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-index-keyframe-transform-dynamic-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-index-keyframe-value-dynamic-expected.txt
    M Source/WebCore/animation/BlendingKeyframes.cpp
    M Source/WebCore/animation/BlendingKeyframes.h
    M Source/WebCore/animation/KeyframeEffect.cpp

  Log Message:
  -----------
  sibling-index() in @keyframes doesn't re-resolve when siblings change
https://bugs.webkit.org/show_bug.cgi?id=314376
rdar://176531901

Reviewed by Antoine Quint.

When a keyframe value uses sibling-index() or sibling-count(), the
resolved keyframe style is frozen at the value computed at animation
start. Adding or removing a preceding sibling correctly invalidates
the target's style (via ChildrenAffectedBy{Forward,Backward}PositionalRules),
but KeyframeEffect::recomputeKeyframesIfNecessary() had no signal to
re-run styleForKeyframe, so the blended keyframe kept the stale index.

Track tree-counting usage on the keyframe style and recompute keyframes
when it is set, mirroring the existing handling of usesAnchorFunctions.

* Source/WebCore/animation/BlendingKeyframes.cpp:
(WebCore::BlendingKeyframes::usesTreeCountingFunctions const):
* Source/WebCore/animation/BlendingKeyframes.h:
* Source/WebCore/animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::recomputeKeyframesIfNecessary): Recompute
blending keyframes when they reference tree-counting functions, so the
target's style invalidation on sibling change propagates through to the
animated value.

> Progressions:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-index-keyframe-font-style-dynamic-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-index-keyframe-font-variation-settings-dynamic-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-index-keyframe-font-weight-dynamic-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-index-keyframe-length-value-dynamic-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-index-keyframe-registered-properties-dynamic-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-index-keyframe-rotate-dynamic-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-index-keyframe-scale-dynamic-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-index-keyframe-transform-dynamic-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-index-keyframe-value-dynamic-expected.txt:

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



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

Reply via email to