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

[css-cascade-5] browsers do not disallow CSS-wide keywords in layer names #10067

Closed
mayank99 opened this issue Mar 13, 2024 · 4 comments
Closed

Comments

@mayank99
Copy link

mayank99 commented Mar 13, 2024

The spec clearly notes the following:

The CSS-wide keywords are reserved for future use, and cause the rule to be invalid at parse time if used as an <ident> in the <layer-name>

I found some existing discussion in #6323, which is where the spec decision was made originally.

However, it seems like browsers do not currently respect it. (Open this playground in all three browsers and click "Run").

This is a problem because it defeats the purpose of reserving keywords for future use.

Maybe this is really a WPT issue, but I think it warrants some discussion here? My main concern is that any websites outside there depending on current browser behavior could break if we start using these "reserved" keywords for new features.

@Loirooriol
Copy link
Contributor

Have you filed issues to the various browsers? This issue tracker is for the spec, so unless you want to argue that the spec should allow CSS-wide keywords to reflect reality, there isn't much to do here.

@mayank99
Copy link
Author

I'm not sure that I should file issues with browsers. Is it really a bug if that's how it works in all browsers for the last two years?

I'm certainly not a fan of the "the browsers didn't follow the spec, so lets change the spec" way of doing things (especially when browser makers are also involved in making the spec). However, I'm trying to be pragmatic here. If browsers change the behavior, there is a risk of breakage.

@Loirooriol
Copy link
Contributor

OK sorry, I understood the opposite, that you wanted to change browsers before people start relying on their behavior.

Anyways 2 years is not that much, and I guess most authors aren't naming their layers as CSS-wide keywords, so I suspect it's still possible to change browsers.

I would prefer to not change the spec until it's clear that it's not web compatible.

@tabatkins
Copy link
Member

While this assumption varies issue-by-issue, I think it's fairly unlikely that anyone is depending on the CSS-wide keywords being usable layer names. Pursuing this as browser bugs first, and only revisiting the spec if there's compat pushback, is the right way forward here.

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

3 participants