Re: CSS Variables Draft Proposal

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