W3C home > Mailing lists > Public > www-style@w3.org > December 2013

[css-variables] cyclic dependencies involving fallback

From: Cameron McCormack <cam@mcc.id.au>
Date: Mon, 16 Dec 2013 09:49:26 +1100
Message-ID: <52AE31F6.8000207@mcc.id.au>
To: www-style list <www-style@w3.org>
The spec currently says:

   Custom properties may use variables in their own values to build up
   composite variables. This can create cyclic dependencies where two or
   more custom properties each attempt to use the variable that the
   other defines; doing so makes all the custom properties involved in
   the cycle compute to their initial value (which is a guaranteed-
   invalid value).

It's not clear exactly what "attempt to use" means here.

   p {
     var-a: var(b, var(a));
     var-b: 1;

Would this result in var-a being invalid since its value includes a 
reference to itself?  Or should it be valid because we don't need to 
evaluate the var(a) fallback?

I interpreted the spec to mean that any occurrences of a variable 
reference on the right hand side would count when looking for cycles, 
and thus var-a would be invalid, but a bug reporter thought otherwise 
Received on Sunday, 15 December 2013 22:50:11 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:17 UTC