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

Re: Suggestion for CSS3 selectors (fwd)

From: Andrei Polushin <polushin@gmail.com>
Date: Thu, 01 May 2008 18:35:36 +0700
Message-ID: <4819AB08.8080508@gmail.com>
To: Andrew Fedoniouk <news@terrainformatica.com>
CC: fantasai <fantasai.lists@inkedblade.net>, "Brian J. Fink" <desertowl23@gmail.com>, dbaron@dbaron.org, www-style@w3.org

Andrew Fedoniouk wrote:
> People, are you serious about all this?
> 
> What CPU would you use to process this:
> 
> :root < a:hover { color:sisyphean; font:boulder; }
> 
> ?
> 
> This simply means recalculation of styles and layout of all DOM elements 
> on simple a:hover. So is my question above.

How your example differs from the example below:

   :root:hover { color:sisyphean; font:boulder; }

?

This example is valid in present CSS, and it will hang your browser in an 
equivalent manner. So the "recalculation" is the problem, but it is a 
completely *different* problem.


> Complexity of style resolution for *single* element using
> containment selector is O(n), where n is a number of DOM elements in the 
> whole tree. So resolving the whole DOM against single containment rule 
> is O(n*n). This will not fly.

Yes, in certain computation models, style *resolution* would be an obvious 
problem. But the proposal is about how to change the computation model, 
isn't it? In particular, it was proposed not to match the ancestor node, and 
not to scan the tree into depth, but to match the most descendant node, and 
update the certain properties of the ancestor node.

This model would require us to store something in each node on the path from 
ancestor to descendant, thus I'm still not sure whether it's viable, but the 
model is completely different from the present model you describe.

-- 
Andrei Polushin
Received on Thursday, 1 May 2008 11:36:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:06 GMT