Bug 267046

Summary: REGRESSION (Safari 17): Named at-rule container skipped when container named in a :host selector
Product: WebKit Reporter: Egor Kloos <studio>
Component: CSSAssignee: Antti Koivisto <koivisto>
Status: RESOLVED FIXED    
Severity: Normal CC: ahmad.saleem792, karlcow, kizmarh, koivisto, mail, ntim, seemann, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: BrowserCompat, InRadar
Version: Safari 17   
Hardware: Mac (Intel)   
OS: macOS 14   
See Also: https://bugs.webkit.org/show_bug.cgi?id=267793
https://github.com/web-platform-tests/wpt/pull/44383
Bug Depends on: 268683    
Bug Blocks:    

Egor Kloos
Reported 2024-01-03 08:51:47 PST
When a container-name property is added to a `:host` selector, the @container using that name will be skipped. A named @container in Safari 17 fails: `@container hello (width > 400px) {}` A @container without a name in Safari 17 works: `@container (width > 400px) {}` Note that this bug doesn't occur on Safari 16. Moving the container-name property to an element inside the Shadow DOM does work. Example(s) on Codepen: https://codepen.io/dutchcelt/pen/oNVbXPd
Attachments
Radar WebKit Bug Importer
Comment 1 2024-01-03 10:41:23 PST
Ahmad Saleem
Comment 2 2024-01-03 11:00:07 PST
It is broken on WebKit ToT (272613@main) where 'Hello World' is different compared to Firefox Nightly 123 and Chrome Canary 122. Adding 'BrowserCompat' as well.
Semmel
Comment 3 2024-01-06 07:20:31 PST
It had worked up to (including) Safari 17.1. It broke on iOS with Safari 17.2-beta+1 (iOS 17.2 Seed 1 (21C5029g)). I've filed a feedback in November '23 which has been unnoticed up to now. https://feedbackassistant.apple.com/feedback/13348441
Antti Koivisto
Comment 4 2024-02-02 04:27:11 PST
EWS
Comment 5 2024-02-02 07:09:33 PST
Committed 273987@main (14e1048a543f): <https://commits.webkit.org/273987@main> Reviewed commits have been landed. Closing PR #23738 and removing active labels.
Antti Koivisto
Comment 6 2024-02-02 07:18:42 PST
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/44383
Antti Koivisto
Comment 7 2024-02-02 22:48:20 PST
This fix did not fix the ::slotted case that was also demonstrated by the original test case. Filed https://bugs.webkit.org/show_bug.cgi?id=268683 for that.
Note You need to log in before you can comment on or make changes to this bug.