-
Notifications
You must be signed in to change notification settings - Fork 710
[css-contain] <container-name> in @container ambiguities #7203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
Use a separate definition of container-name in the @container syntax to disallow 'none' and 'not'.
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: [css-contain] <container-name> in @container ambiguities<dael> github: https://github.com//issues/7203 <dael> miriam: The way we have container-name at the start of an @container rule can be confused currently with keyword not <fantasai> +1 to disallowing not <TabAtkins> +1 to disallow "not" <dael> miriam: @container might start with either container-name or not. First part is to disallow 'not' as a container name <jensimmons> +1 seems obvious to me <dael> Rossen_: I see support <dael> Rossen_: Should be straightforward. Other opinions? Or objections? <dael> RESOLVED: disallow 'not' as a container name <dael> miriam: Next part is a question. not clear if you can query multiple names in an @container rule and what happens if you did. and or or condition? <dael> miriam: Container can have multiple names. You can say if you use multiple names you need both or all. Or say this or that. Or disallow multiple names <dael> miriam: Sort of use cases of any of the above. And all can be handled by other naming conventions. no clear reason to go one way or another <dael> miriam: Most obvious to me if we allow multiple names is they're allr equired <Rossen_> ack fantasai <dael> fantasai: I think ligit use cases for AND and OR so logical thing to do is apply bool syntax here. Might not want to do that b/c that's adding a lot. I suggest only 1 container name, disallow not, and, and or. Consider in the future if we want a more powerful syntax <dael> Rossen_: Reserve the bool names for now, only allow 1 container name, and that gives us future extensibility for bool and multi naming <dael> miriam: Makes sense to me <dael> fantasai: miriam you mentioned about disallowing none? <dael> miriam: So none can't be the name of a container. none as a container name just removes container names. I don't think need to explicitly disallow, but could clarify that <dael> fantasai: Makes a difference as to if rule is invalidated. I lean toward invalidating it <dael> miriam: 'none', 'not', 'and', and 'or' would be disallowed. Only a single name allowed in @container rule <dael> Rossen_: Sounds like a good summary. Opinions or objections? <dael> RESOLVED: 'none', 'not', 'and', and 'or' would be disallowed. Only a single name allowed in @container rule |
See resolution: w3c/csswg-drafts#7203 Bug: 1145970 Change-Id: I0309c153354ac5f299ab63562db8a279a24728a1
See resolution: w3c/csswg-drafts#7203 Bug: 1145970 Change-Id: I0309c153354ac5f299ab63562db8a279a24728a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3698402 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012619}
See resolution: w3c/csswg-drafts#7203 Bug: 1145970 Change-Id: I0309c153354ac5f299ab63562db8a279a24728a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3698402 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012619}
See resolution: w3c/csswg-drafts#7203 Bug: 1145970 Change-Id: I0309c153354ac5f299ab63562db8a279a24728a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3698402 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012619}
…20520 [css-contain-3] Exclude 'none' and 'not' from custom-ident. #7203
[css-contain-3] Disallow not/none for container-name in @-rule. #7203
…ontainer-name>, a=testonly Automatic update from web-platform-tests [@container] Disallow and/not/or from <container-name> See resolution: w3c/csswg-drafts#7203 Bug: 1145970 Change-Id: I0309c153354ac5f299ab63562db8a279a24728a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3698402 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012619} -- wpt-commits: 8f01d1edf99d842218f5446b9fd6e0d2dc47c3db wpt-pr: 34360
…ontainer-name>, a=testonly Automatic update from web-platform-tests [@container] Disallow and/not/or from <container-name> See resolution: w3c/csswg-drafts#7203 Bug: 1145970 Change-Id: I0309c153354ac5f299ab63562db8a279a24728a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3698402 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012619} -- wpt-commits: 8f01d1edf99d842218f5446b9fd6e0d2dc47c3db wpt-pr: 34360
Can the specification add examples or other instructions to further clarify the Implementers are still susceptible to misunderstandings or misinterpretations. see: parcel-bundler/lightningcss#158 (comment)
|
The grammar says:
This leads me to believe that Chromium seems to disallow this and require parens around the condition. Is this a bug, or should the grammar be updated to match? Am I misinterpreting the spec somehow? FWIW, Safari TP and Firefox dev edition seem to still treat |
Yes, both of these are valid, with @container not (width <= 500px ) { … }
@container name not (width <= 500px) { … } |
Opened a PR to add a test here: web-platform-tests/wpt#34849. There was also one incorrect test, which might have contributed to implementations getting this wrong. |
Since the spec changed without test changes after the implementation/tests were written, the spec change went unnoticed and the previous syntax is what's currently implemented in both Chrome and Safari. |
Should all be covered by https://wpt.live/css/css-contain/container-queries/at-container-parsing.html |
Two thoughts:
<container-name>
kinda conflicts with<container-condition>
, asnot
can be a valid<container-name>
, how should@container not (width > 300px)
be parsed? There's an obvious answer, but probably that means thatnot
should not be a valid<container-name>
?Per spec
<container-name>
includesnone
and multiple<custom-idents>
, is@container foo bar (width > 300px)
expected to be valid? I don't see any test for multiple container names in the rule, so just checking whether that's intentional or not.cc @andruud @mirisuzanne @anttijk
The text was updated successfully, but these errors were encountered: