Re: Select a parrent node with s CSS selector?

Steven Pemberton wrote:
> Are you sure about this? CSS is currently designed so that you can 
> decide when you are at an element which styles apply, and presumably 
> implementations use that knowledge.

Yes.  Furthermore, the style of a node only depends on its ancestors.  So when 
something about a node changes, you only need to recompute style on its descendants.

> since the selector ">" and the proposed "<" 
> are symmetrical, I would expect at worst only a linear increase in 
> complexity. It would just need a different algorithm.

For computing style on a single node, yes.  But for deciding what nodes to 
restyle when something about a node changes, the presence of both "<" and ">" 
means having to restyle the entire document tree (modulo memory-consuming 
optimizations).

Again, the performance issues with all the "parent" proposals are not in 
computing style for a single node.  They're in handling DOM mutations.  Which 
happen a good bit out there.

-Boris

Received on Tuesday, 24 April 2007 21:54:07 UTC