From 3d4fd1eeaed2b902fd12d907feccab66296029d1 Mon Sep 17 00:00:00 2001 From: Rune Lillesveen Date: Tue, 6 Aug 2024 12:43:46 +0200 Subject: [PATCH] [css-conditional-5] Container queries use the flat tree #5984 Per resolution in: https://github.com/w3c/csswg-drafts/issues/5984#issuecomment-2112977366 --- css-conditional-5/Overview.bs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/css-conditional-5/Overview.bs b/css-conditional-5/Overview.bs index d5bf0c75fed2..01dc61782259 100644 --- a/css-conditional-5/Overview.bs +++ b/css-conditional-5/Overview.bs @@ -354,7 +354,7 @@ Container Queries for [=container size queries=] by specifying the additional query types using the 'container-type' property (or the 'container' [=shorthand=]). - Style rules applying to a [=query container=]’s shadow-including descendants + Style rules applying to a [=query container=]’s [=flat tree=] descendants can be conditioned by querying against it, using the ''@container'' [=conditional group rule=]. @@ -384,30 +384,25 @@ Container Queries will each respond to their own container context. - For selectors with pseudo elements, query containers can be established by - the shadow-including inclusive ancestors of the ultimate - originating element. + For the ''::part()'' and ''::slotted()'' pseudo-element selectors, + which represent real elements in the DOM tree, query containers can be + established by [=flat tree=] ancestors of those elements. + For other pseudo-elements, query containers can be established by + inclusive [=flat tree=] ancestors of their originating element.
It follows that: - * Pseudo elements themselves can not be query containers * ''::before'', ''::after'', ''::marker'', and ''::backdrop'' query their originating elements * ''::first-letter'' and ''::first-line'' query their originating elements, even if the fictional tag sequence may push the ::first-line past other elements for the purpose of inheritance and rendering - * Multiple pseudo elements do not allow pseudo elements to be query - containers for other pseudo elements. E.g., the host, but not the - ::part(), can be the query container for - ::before in host::part()::before. Similarly, - ::before can not be the query container for the - ::marker in div::before::marker * ''::slotted()'' selectors can query containers inside the shadow tree, including the slot itself - * ''::part()'' selectors can query its originating host, but not internal - query containers inside the shadow tree + * ''::slotted()::before'' selectors can query the slotted shadow host child + * ''::part()'' selectors can query containers inside the shadow tree * ''::placeholder'' and ''::file-selector-button'' can query the input element, but do not expose any internal containers if the input element is implemented using a shadow tree