[css-houdini-drafts] [css-properties-values-api] [css-variables] Should the spec document invalid variables and fallback more explicitly? (#849)

justinmichaud-2 has just created a new issue for https://github.com/w3c/css-houdini-drafts:

== [css-properties-values-api] [css-variables] Should the spec document invalid variables and fallback more explicitly? ==
Specs:
CSS Properties and Values: https://drafts.css-houdini.org/css-properties-values-api/#dependency-cycles-via-relative-units
CSS Variables: https://drafts.csswg.org/css-variables/#invalid-variables

Related spec bugs:
https://github.com/w3c/css-houdini-drafts/issues/821

Chromium recently changed their behaviour for fallback of registered custom properties (https://github.com/web-platform-tests/wpt/pull/14039). 

It seems to me that the spec is not clear enough about when values should act as initial vs unset. For example, in Chromium, if an unregistered property has a cycle, it is reset to its initial (known-invalid) value. If that variable is registered, it is set to an invalid value regardless of its initial value or its parent's value. 

If an undefined or invalid variable is substituted into a property, it is treated as unset. Unless that property is a registered custom property, in which case it is treated as unset but when substituting it, it seems to act like invalid. Relative dependency cycles are treated as unset, however.

Here is a fiddle to demonstrate: <https://jsfiddle.net/nzyfu1td/13/>. This might be Chrome-specific and I am probably missing something here, but I think it would be nice if the spec could clarify all of these cases explicitly.

Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/849 using your GitHub account

Received on Saturday, 22 December 2018 00:49:45 UTC