[csswg-drafts] [css-conditional-5] Clarify behavior of named container queries in shadow trees (#12090)

frehner has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-conditional-5] Clarify behavior of named container queries in shadow trees ==
The spec currently says

>Style rules applying to a query container’s [flat tree](https://drafts.csswg.org/css-scoping-1/#flat-tree) descendants can be conditioned by querying against it, using the [@container](https://www.w3.org/TR/css-conditional-5/#at-ruledef-container) [conditional group rule](https://www.w3.org/TR/css-conditional-3/#conditional-group-rule).

Which was aligned here https://github.com/w3c/csswg-drafts/issues/5984#issuecomment-2112977366

The spec also does not carve out an exception for _named_ container queries, so my assumption would be that they should also follow the same rule.

However, WPT [has tests](https://github.com/web-platform-tests/wpt/blob/749f1c06278884b506f49f541185af96791af02f/css/css-conditional/container-queries/container-for-shadow-dom.html#L414-L447) specifying that named container queries set inside of a shadow tree do _not_ behave this same way, and currently [all browsers are compliant with those tests](https://wpt.fyi/results/css/css-conditional/container-queries/container-for-shadow-dom.html?label=experimental&label=master&aligned).

If this carve-out was intentional for named container queries, I think it would be nice for the spec to be updated to reflect that. If it's not intentional, then perhaps the WPTs should be reversed. 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12090 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 16 April 2025 16:39:59 UTC