Re: WebKit now supports CSS Variables

On Jun 26, 2008, at 11:12 PM, Andrew Fedoniouk wrote:

> So you have in runtime following:
> 1) global collection (name/value map) of variables and


> 2) background: non-parsed("var(ThemeSomething) green");

Semi-parsed.  You can at least build up a list of parsed terms.

> This means that you should interpret (parse/evaluate) that
> non-parsed() thing each time when you need background attributes.

No.  You do it once and then cache it.

> Am I correct in my understanding how it works?

Pretty much yeah.

> Otherwise you would need to maintain list of all attributes in all  
> rules
> where this variable is participating and while changing that value
> to walk through the list and re-parse that non-parsed thing again.

WebKit just rebuilds all of its front end style information when  
variables change (we do the same thing when style rules in a sheet  
change).  Not the best thing to do performance-wise, so we'll probably  
improve it in the future (possibly by maintaining such a list yes).


Received on Friday, 27 June 2008 07:25:09 UTC