Skip to content

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

Closed
@tabatkins

Description

@tabatkins

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions