Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 00497eb486c0c28266aa0f53c0057cdc548e1a11
https://github.com/WebKit/WebKit/commit/00497eb486c0c28266aa0f53c0057cdc548e1a11
Author: Nipun Shukla <[email protected]>
Date: 2026-04-15 (Wed, 15 Apr 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-slotted-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-slotted-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-slotted.html
M Source/WebCore/style/ElementRuleCollector.cpp
Log Message:
-----------
@scope'd styles don't affect <slot>'d elements, but they should
https://bugs.webkit.org/show_bug.cgi?id=308330
rdar://171383788
Reviewed by Antti Koivisto.
When finding scoping roots in scopeRulesMatch(), the ancestor traversal
stops at a non-UA shadow root. This is correct for elements inside a
shadow tree but wrong for slotted elements. The traversal would stop
at the shadow host, never reaching the scope root above it.
Skip the shadow boundary guard when the styled element is not inside
any shadow root and we are not matching shadow-scoped rules.
Test: imported/w3c/web-platform-tests/css/css-cascade/scope-slotted.html
*
LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-slotted-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-slotted-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-slotted.html:
Added.
* Source/WebCore/style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::scopeRulesMatch):
Canonical link: https://commits.webkit.org/311333@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications