W3C home > Mailing lists > Public > www-style@w3.org > May 2015

Re: [css-variables] var() for non-custom properties

From: Lea Verou <lea@verou.me>
Date: Sat, 23 May 2015 16:27:16 -0400
Cc: Glen Huang <curvedmark@gmail.com>, François REMY <francois.remy.dev@outlook.com>, Bang Seongbeom <bangseongbeom@hotmail.com>, www-style list <www-style@w3.org>
Message-Id: <0BDBA101-AE37-4639-B006-790FC5F0A70A@verou.me>
To: "Tab Atkins Jr." <jackalmage@gmail.com>

> On May 23, 2015, at 14:35, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> 
> There is a huge difference between an infinite loop in a normal
> programming language, like JS, and a cycle in a declarative
> programming language, like CSS.  The former just has annoying
> behavior; the latter is *undefined*.

There are other declarative languages that do allow cycles. Excel for one [1]. Excel’s model of resolving them is suboptimal — apparently it checks for convergence for a certain number of iterations, which is slow and I would definitely not suggest we do the same. However, allowing cycles in declarative languages is not all that unheard of.

> Cycle checkers are expensive, and so we want to minimize their use.
> Currently we limit the checking to just custom properties, which
> limits their cost.

Last time I checked, cycle checkers were O(N). I might be missing something here, but linear complexity is hardly what I’d call “expensive”…

~Lea

[1]: http://www.jkp-ads.com/articles/circularreferences00.asp
Received on Saturday, 23 May 2015 20:27:40 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:54 UTC