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-env-1] Should env() really use <custom-ident>? #3262

Open
emilio opened this issue Oct 29, 2018 · 1 comment
Open

[css-env-1] Should env() really use <custom-ident>? #3262

emilio opened this issue Oct 29, 2018 · 1 comment

Comments

@emilio
Copy link
Collaborator

emilio commented Oct 29, 2018

https://drafts.csswg.org/css-env-1/#env-function says:

env() = env( <custom-ident> , <declaration-value>? )

However both Blink and WebKit use just <ident> for this.

Test-case can be:

<!doctype html>
<style>
div {
    width: 100px;
    height: 100px;
    background-color: green;
    background-color: env(inherit, red);
}
</style>
<div></div>

Which should be green per spec but is red in Blink and WebKit.

Should the spec be changed to use just <ident>, or should bugs be filed on browsers?

I made the same mistake in https://bugzilla.mozilla.org/show_bug.cgi?id=1462233, but @heycam caught it during review.

@tabatkins
Copy link
Member

Ah yeah, that's unfortunate. We exclude the global keywords with the assumption that most custom idents will be used top-level in a declaration, but function arguments don't have to obey that; they're already excluded from triggering the global behavior.

This is similar to the distinction Syntax draws between <declaration-value> and <any-value>; maybe that means we should define a less restrictive <any-ident> production that can be used when appropriate, that doesn't exclude anything by default?

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