Bug 310023

Summary: CSS @scope at-rule does not apply to input elements
Product: WebKit Reporter: yukiito
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: akeerthi, annevk, davidm, koivisto, lily_spiniolas
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Safari result showing input not having red border
none
Demo HTML file none

yukiito
Reported 2026-03-16 07:54:31 PDT
Created attachment 478689 [details] Safari result showing input not having red border When an @scope rule specifies a CSS for <input>, it never gets applied. Consider the following HTML which I've also recreated in JSFiddle https://jsfiddle.net/tx0z4kfb/1/: <html> <style> input { border: 1px solid green; } button { border: 1px solid green; } div { border: 1px solid green; } @scope (:root) { input { border-color: red !important; } button { border-color: red !important; } div { border-color: red !important; } } </style> <body> <input placeholder="Input"/> <button>Button</Button> <div>Div</div> </body> </html> The expected result is that all 3 elements to have a green border, and that's how it is in both Firefox and Chrome. However in Safari, the input border stays green as it fails to apply the @scoped CSS rule for the input.
Attachments
Safari result showing input not having red border (9.12 KB, image/png)
2026-03-16 07:54 PDT, yukiito
no flags
Demo HTML file (436 bytes, text/html)
2026-03-16 08:46 PDT, davidm
no flags
yukiito
Comment 1 2026-03-16 07:59:50 PDT
Correction with the expected result, all elements should have a red border while input stays green
davidm
Comment 2 2026-03-16 08:46:00 PDT
Created attachment 478691 [details] Demo HTML file
davidm
Comment 3 2026-03-17 05:42:41 PDT
Anne van Kesteren
Comment 4 2026-03-18 04:03:50 PDT
Thanks davidm! *** This bug has been marked as a duplicate of bug 305369 ***
Note You need to log in before you can comment on or make changes to this bug.