Re: WebKit now supports CSS Variables

On Jun 24, 2008, at 4:12 PM, Håkon Wium Lie wrote:

>
> Also sprach Maciej Stachowiak:
>
>>>>> style sheet 1: @variable { X: 10px }
>>>>> style sheet 2: @variable { X: none }
>>>>> style sheet 3: div { width: var(X) }
>
>> Your above situation is analogous to the following:
>>
>> style sheet 1: div.someclass { width: 30px; }
>> style sheet 2: div#someid { width: 10px; }
>> style sheet 3: div { width: 20px; }
>
> It's different because because the validity of the declarations is
> known at parse-time. Invalid declarations should be dropped, and not
> be visible in the DOM.


Yes, the resolved expression *in a specific medium* may be  
inapplicable, but the medium-independent back-end CSS OM always  
contains an opaque unresolved variable expression (whose cssText will  
just dump the expression with the unresolved variables in it).  It  
isn't invalid.  It is the act of resolution that determines whether  
the expression becomes invalid, and that can only take place when you  
are doing resolution in a specific medium.

dave
(hyatt@apple.com)

Received on Tuesday, 24 June 2008 21:20:37 UTC