Re: [csswg-drafts] [css-contain] <container-name> in @container ambiguities (#7203)

The grammar says:

```
@container [ <container-name> ]? <container-condition> {

... 

<container-name> = <custom-ident>
<container-condition> = not <query-in-parens>
                      | <query-in-parens> [ [ and <query-in-parens> ]* | [ or <query-in-parens> ]* ]

...

The keywords none, and, not, and or are excluded from the <custom-ident> above.
```

This leads me to believe that `@container not (width <= 500px )` is valid, with the `not` being interpreted as part of the container condition rather than the name. The `not <query-in-parens>` case doesn't seem to require parentheses. I would also expect `@container name not (width <= 500px)` to be valid based on this grammar.

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 `not` as the name rather than part of the condition. No browser is able to parse `@container name not (width <= 500px)` at all.

-- 
GitHub Notification of comment by devongovett
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7203#issuecomment-1181920477 using your GitHub account


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

Received on Tuesday, 12 July 2022 15:35:42 UTC