[mediaqueries-4][css-cascade-5] Restrict 'layer' from the <media-type> production? · Issue #7225 · w3c/csswg-drafts · GitHub
Skip to content
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

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

Closed
tabatkins opened this issue Apr 19, 2022 · 2 comments

Comments

@tabatkins
Copy link
Member

@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.

@tabatkins
Copy link
Member Author

Agenda+ bc it should be a tiny discussion, and we'll need a resolution if we go with my suggestion to fix MQ4.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [mediaqueries-4][css-cascade-5] Restrict 'layer' from the <media-type> production?, and agreed to the following:

  • RESOLVED: In all levels of MQ we will make 'layer' syntactically invalid media type
The full IRC log of that discussion <dael> Topic: [mediaqueries-4][css-cascade-5] Restrict 'layer' from the <media-type> production?
<dael> github: https://github.com//issues/7225
<dael> florian: We have a syntax ambig. When you do @import if you write @import <url> layer it could either mean import layer or it could be a MQ for a media type called layer
<dael> florian: TabAtkins suggests in MQ 4 spec we declare layer cannot be a media type so if you try and parse that way it's a syntax error. When used in MQ it wouldn't work and when in @import it's a layer
<dael> florian: Mostly doesn't change anything b/c layer isn't a valid media type and is not proposed. Error handling is slightly different. if you do @media not-layer it would handle differently. unlikely this is being done
<dael> florian: I think TabAtkins suggestion is good and we should go for it
<dael> Rossen_: Process question- MQ 4 is a CRD. How close are we...would that reset anything in terms of MQ 4 process?
<Rossen_> q?
<dael> florian: I don't think it would. MQ 4 is largely waiting on test and impl. It's not really a new feature, it's error handling. Adding it to 5 would make 5 incompat with 4 and we'd have to patch 4 eventually.
<dael> florian: Poss errata MQ 3
<dael> Rossen_: Yeah, do we need to?
<dael> florian: Probably in ED at first, let it sit to make sure we don't change our mind, then include as a prop correction
<dael> Rossen_: Sounds good. Let's proceed with MQ 4
<dael> Rossen_: Additional suggestions or ideas?
<dael> Rossen_: TabAtkins is trying to join
<dael> florian: We're taking his proposal anyway
<TabAtkins> yeah, no need to comment
<dael> Rossen_: Not hearing anything else
<dael> florian: Prop: In all levels of MQ we will make 'layer' syntactically invalid media type
<dael> Rossen_: Obj?
<dael> RESOLVED: In all levels of MQ we will make 'layer' syntactically invalid media type
<dael> Rossen_: We'll worry about errata later
<dael> florian: I'll put in the ED for now

@frivoal frivoal closed this as completed in e9ab7e2 May 5, 2022
@frivoal frivoal self-assigned this May 5, 2022
frivoal added a commit to web-platform-tests/wpt that referenced this issue May 5, 2022
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue May 16, 2022
…edia type, a=testonly

Automatic update from web-platform-tests
tests for error handling of layer as a media type

Based on w3c/csswg-drafts#7225

--

wpt-commits: bed0261ca3f7826bf56b149be069a38288102082
wpt-pr: 33940
jamienicol pushed a commit to jamienicol/gecko that referenced this issue May 25, 2022
…edia type, a=testonly

Automatic update from web-platform-tests
tests for error handling of layer as a media type

Based on w3c/csswg-drafts#7225

--

wpt-commits: bed0261ca3f7826bf56b149be069a38288102082
wpt-pr: 33940
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@frivoal @tabatkins @css-meeting-bot and others