Skip to content

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

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

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

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 , since is just , with a few restricted keywords.

We could fix this either at the @import location, specifying that layer cannot match there, or directly in MQ, restricting layer from ever being a .

The only effect of restricting it at the 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 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 Topic: [mediaqueries-4][css-cascade-5] Restrict 'layer' from the production?
github: https://github.com//issues/7225
florian: We have a syntax ambig. When you do @import if you write @import layer it could either mean import layer or it could be a MQ for a media type called layer
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
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
florian: I think TabAtkins suggestion is good and we should go for it
Rossen_: Process question- MQ 4 is a CRD. How close are we...would that reset anything in terms of MQ 4 process?
q?
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.
florian: Poss errata MQ 3
Rossen_: Yeah, do we need to?
florian: Probably in ED at first, let it sit to make sure we don't change our mind, then include as a prop correction
Rossen_: Sounds good. Let's proceed with MQ 4
Rossen_: Additional suggestions or ideas?
Rossen_: TabAtkins is trying to join
florian: We're taking his proposal anyway
yeah, no need to comment
Rossen_: Not hearing anything else
florian: Prop: In all levels of MQ we will make 'layer' syntactically invalid media type
Rossen_: Obj?
RESOLVED: In all levels of MQ we will make 'layer' syntactically invalid media type
Rossen_: We'll worry about errata later
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