[csswg-drafts] [mediaqueries-4][css-cascade-5] Restrict 'layer' from the <media-type> production? (#7225)

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

== [mediaqueries-4][css-cascade-5] Restrict 'layer' from the <media-type> production? ==
@nex3 brought up that the grammar for @import is technically ambiguous at the moment: `@import url(foo) layer` could parse as the `layer` keyword to trigger a Cascade Layer, or as an unknown `<media-type>`, since `<media-type>` is just `<ident>`, with a few restricted keywords.

We could fix this either at the `@import` location, specifying that `layer` cannot match `<media-type>` there, or directly in MQ, restricting `layer` from *ever* being a `<media-type>`.

The *only* effect of restricting it at the `<media-type>` level, fwiw, is that `not layer` will change from matching (because it's negating an unknown media type) to not matching (because it's an invalid keyword, so the whole MQ turns into `not all`). Any other case will be equivalent in matching behavior, but will serialize differently (becoming `not all` rather than preserving the original MQ). I think it's, uh, *exceedingly unlikely* anyone has ever written `layer` for a media type in the first place, tho, so we should be good.

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


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

Received on Tuesday, 19 April 2022 22:14:25 UTC