WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
308330
JoelWess
@scope'd styles don't affect <slot>'d elements, but they should
https://bugs.webkit.org/show_bug.cgi?id=308330
Summary
@scope'd styles don't affect <slot>'d elements, but they should
joel.wesseling
Reported
2026-02-20 13:41:25 PST
When a CSS style is defined inside a `@scope`, that style has no effect on DOM elements that are passed into the <slot> of a native Custom Element (Web Component). This issue is happening in Safari >= 26.2. It does not happen in Safari 26.1 or 18.x, nor does it happen in Chrome or Firefox. I have created a minimal reproduction in the following CodePen:
https://codepen.io/JoelWess/pen/zxBgpBN
Both <h1> should be purple in the following example, but the first <h1> is green in Safari 26.2: ```html <div class="test-scope"> <x-card> <h1 slot="heading">Slotted H1</h1> <p>Card content</p> </x-card> <h1>Unslotted H1</h1> </div> ``` ```css /* Baseline: should work in every browser even when the <h1> is slotted */ h1 { color: green; } /* The bug: this should ALSO match, because <h1> is in the light DOM and is a child of .test-scope */ @scope (.test-scope) { h1 { color: purple; } } ```
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2026-02-27 13:42:13 PST
<
rdar://problem/171383788
>
Nipun Shukla
Comment 2
2026-04-10 16:43:47 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/62502
EWS
Comment 3
2026-04-15 17:08:45 PDT
Committed
311333@main
(00497eb486c0): <
https://commits.webkit.org/311333@main
> Reviewed commits have been landed. Closing PR #62502 and removing active labels.
Nipun Shukla
Comment 4
2026-04-16 15:46:53 PDT
Submitted web-platform-tests pull request:
https://github.com/web-platform-tests/wpt/pull/59298
Antti Koivisto
Comment 5
2026-05-07 09:14:32 PDT
***
Bug 307982
has been marked as a duplicate of this bug. ***
Onur Gumus
Comment 6
2026-05-12 10:41:47 PDT
***
Bug 307238
has been marked as a duplicate of this bug. ***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug