New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 4 users

Issue metadata

Status: Fixed
Closed: Feb 1
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug

Sign in to add a comment

Issue 921152: CSS.supports / @supports doesn't consider valid any value with custom property references / env.

Reported by, Jan 11 Project Member

Issue description

Chrome Version       : Trunk
Other browsers tested:
  Add OK or FAIL after other browsers where you have tested this issue:
     Safari: PASS
    Firefox: PASS
    IE/Edge: didn't check

What steps will reproduce the problem?
1. Run on the console CSS.supports("margin: var(--foo) something absolutely pointless")
2. Run on the console CSS.supports("margin: someting-absolutely-pointless(var(--foo))")

What is the expected result?
Both return true, parse, and compute to invalid at computed-value time.

What happens instead of that?
First one correctly returns true, but second one does not. But I don't see what should make them behave differently.

Comment 1 by, Jan 11

Status: Available (was: Unconfirmed)
Confirmed that both should be valid at parse time; the mere *presence* of a var() function in the tokens of a property automatically switch it to "assumed valid at parse time, check it after substitution" behavior.

Source: I wrote the spec.

Comment 2 by, Jan 30

Status: Started (was: Available)
I'll just fix this, I don't really want to deal with compat issues due to this.

Comment 4 by, Jan 30


Comment 5 by, Jan 31

Both return false in current Edge and the same result as Chrome in the next version. So, fixing this in Chrome will make it work.

Comment 6 by, Jan 31

More context from Twitter: bug was introduced while trying to fix  issue 864435  via 113cc2d54f97a1384ecc5c3a0b8bcddbd0c3765f

Comment 7 by, Jan 31

Also jerem@ from the photos team said he'll look at fixing the original issue on their side.

Comment 8 by bugdroid, Jan 31

Project Member
The following revision refers to this bug:

commit 42eb4f28b94d798402c21c0bf239759efe150c95
Author: Emilio Cobos Álvarez <>
Date: Thu Jan 31 18:56:45 2019

Don't skip invalid functions when looking for var references.

This matches the spec, WebKit and Firefox.


> If a property contains one or more var() functions, and those functions are
> syntactically valid, the entire property’s grammar must be assumed to be
> valid at parse time. It is only syntax-checked at computed-value time, after
> var() functions have been substituted.

Bug:  921152 
Change-Id: Ie46268ffae4e01f457f379c674e0cf1a7ccea354
Commit-Queue: Rune Lillesveen <>
Reviewed-by: Rune Lillesveen <>
Reviewed-by: Eric Willigers <>
Cr-Commit-Position: refs/heads/master@{#628023}

Comment 9 by, Feb 1

Status: Fixed (was: Started)

Sign in to add a comment