Skip to content

Commit 4eaa7c2

Browse files
authored
[css-contain-3] Tweak the spec for style() queries w3c#8127 (w3c#8756)
* [css-contain-3] Tweak the spec for style() queries w3c#8127 Remove the recently added grammar part for style-feature that was inaccurate. Do not accept invalid declarations or unsupported property names as a style-feature. The effect of that is that we do not need to store invalid declarations, but merely fall back to parse the style() query with the invalid declaration as a general-enclosed, which will evaluate to unknown. * Reformulate and add general-enclosed evaluation --------- Co-authored-by: Rune Lillesveen <futhark@chromium.org>
1 parent f0a6cd7 commit 4eaa7c2

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

css-contain-3/Overview.bs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,6 @@ Container Queries: the ''@container'' rule</h3>
602602
<dfn><<style-in-parens>></dfn> = ( <<style-query>> )
603603
| ( <<style-feature>> )
604604
| <<general-enclosed>>
605-
<dfn><<style-feature>></dfn> = <<ident>> : <<declaration-value>> | <<ident>>
606605
</pre>
607606

608607
The keywords ''container-name/none'', ''and'', ''not'', and ''or''
@@ -622,7 +621,8 @@ Container Queries: the ''@container'' rule</h3>
622621
each [=container feature=] in the <<container-query>>
623622
is evaluated against that [=query container=].
624623
If no ancestor is an eligible [=query container=],
625-
then the [=container query=] is ''unknown'' for that element.
624+
then the [=container query=] is ''unknown'' for that element. As for media queries,
625+
<<general-enclosed>> evaluates to ''unknown''.
626626

627627
<div class=example>
628628
As with [=media queries=],
@@ -903,18 +903,15 @@ Style Container Features</h3>
903903
It is a boolean combination of
904904
individual <dfn>style features</dfn> (<<style-feature>>)
905905
that each query a single, specific property of the [=query container=].
906-
The syntax of a <dfn><<style-feature>></dfn> is the same as for a [=declaration=]
907-
[[!CSS-SYNTAX-3]],
908-
and its query is true if
909-
the [=computed value=] of the given property on the [=query container=]
910-
matches the given value
911-
(which is also [=computed value|computed=] with respect to the [=query container=]),
912-
unknown if the property or its value is invalid or unsupported,
913-
and false otherwise.
906+
The syntax of a <dfn><<style-feature>></dfn> is either the same as for a valid [=declaration=]
907+
[[!CSS-SYNTAX-3]], a [=supported CSS property=], or a <<custom-property-name>>.
908+
909+
Its query evaluates to true if the [=computed value=] of the given property on the
910+
[=query container=] matches the given value (which is also [=computed value|computed=]
911+
with respect to the [=query container=]), and false otherwise.
914912

915-
A [=style feature=] can also be a property name without a value. Such
916-
features evaluate to true if the [=computed value=] is different from the [=initial=]
917-
value for the given [=property=].
913+
A [=style feature=] without a value evaluates to true if the [=computed value=]
914+
is different from the [=initial=] value for the given [=property=].
918915

919916
The boolean syntax and logic combining [=style features=] into a [=container style query|style query=]
920917
is the same as for [=CSS feature queries=].

0 commit comments

Comments
 (0)