W3C home > Mailing lists > Public > www-style@w3.org > February 2011

Re: CSS Variables Draft Proposal

From: David Singer <singer@apple.com>
Date: Tue, 15 Feb 2011 11:33:46 +0800
Cc: Boris Zbarsky <bzbarsky@mit.edu>, www-style list <www-style@w3.org>
Message-Id: <BE3FC26A-23D7-40C9-A982-AD499E079B78@apple.com>
To: Tab Atkins Jr. <jackalmage@gmail.com>

On Feb 15, 2011, at 4:46 , Tab Atkins Jr. wrote:

>> What is the expected behavior of this markup:
>> div {
>>  color: red;
>>  color: $foo;
>>  color: $bar;
>> }
>> in a browser that supports variables if $foo and $bar are both not defined?
>>  If $foo then suddenly becomes defined?  If $bar then becomes defined?
> This is defined in the draft now.  An undefined variable computes to
> an always-invalid value.  CSS then proceeds as normal.  So, in this
> case, the color is red at first (as both of the latter two rules
> contain invalid values and so are ignored).  When $foo becomes
> defined, assuming it's defined to a valid color value, then the color
> becomes $foo's value.  Same when $bar is defined.

are there already places where something that has a syntax error can become something that does not, as a result of some other change of state?  I.e. you're saying that the other two color rules can't be discarded at parse time (which is what you might expect from a syntax error) as they may become non-syntax errors later...

David Singer
Multimedia and Software Standards, Apple Inc.
Received on Tuesday, 15 February 2011 03:34:57 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:56 UTC