W3C home > Mailing lists > Public > www-style@w3.org > April 2007

Re: Select a parrent node with s CSS selector?

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 24 Apr 2007 16:53:52 -0500
Message-ID: <462E7C70.9010907@mit.edu>
To: Steven Pemberton <steven.pemberton@cwi.nl>
CC: www-style@w3.org

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 

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.

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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:28 UTC