Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 1b466cc8629c7894d93d633b1e72c1b062ec3b6e
https://github.com/WebKit/WebKit/commit/1b466cc8629c7894d93d633b1e72c1b062ec3b6e
Author: Ahmad Saleem <[email protected]>
Date: 2026-05-04 (Mon, 04 May 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/tree-scoped-sibling-function-expected.txt
M Source/WebCore/style/StyleBuilderState.cpp
Log Message:
-----------
Tree-counting functions should return 0 for cross-tree ::part() styling
https://bugs.webkit.org/show_bug.cgi?id=313315
rdar://175592607
Reviewed by Antti Koivisto.
Per [1] and [2], tree-counting functions are loosely-matched tree-scoped
references. If the reference fails to match because the element is
in a descendant shadow tree from the stylesheet, the function
returns 0.
When a ::part() rule from an outer tree styles an element inside a
shadow tree, siblingIndex() and siblingCount() now check the style
scope ordinal. If the property originates from a containing host
scope, both functions return 0 instead of counting siblings in the
shadow tree.
[1] https://drafts.csswg.org/css-values-5/#tree-counting
[2] https://drafts.csswg.org/css-shadow-1/#tree-scoped-name-loosely-matched
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/tree-scoped-sibling-function-expected.txt:
Progression
* Source/WebCore/style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::siblingCount):
(WebCore::Style::BuilderState::siblingIndex):
Canonical link: https://commits.webkit.org/312544@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications