W3C home > Mailing lists > Public > www-style@w3.org > September 2006

Re: [css3-selectors] :parent selector

From: Steven Pemberton <steven.pemberton@cwi.nl>
Date: Wed, 27 Sep 2006 16:01:52 +0200
To: del@alum.mit.edu, "David Woolley" <david@djwhome.demon.co.uk>
Cc: www-style@w3.org
Message-ID: <op.tgjilemvsmjzpq@acer3010.lan>

On Tue, 26 Sep 2006 14:57:02 +0200, Del Merritt <del@alum.mit.edu> wrote:
> A current (non-optimal) solution to the parent-child problem is to keep  
> the node structure around and chuck the text-only leaf data once it has  
> been rendered.  If the node structure is heavy, though, it still  
> presents a memory burden.  Sibling selectors present a similar problem,  
> compounded by the fact that you can't get rid of the siblings (or some  
> reduced cache of their presence) until you've handled the last one.   
> Think: "<body><p>blah</p><p>blah</p><p>blah</p>...<p>blah</p></body>"

That sounds like O(log n) to me, which isn't what I would call expensive.  
With a tree that is 4 levels deep, with 4 nodes at each level, that is 511  
nodes, of which only 17 would have to be kept open at the worst moment.

With a 10*10 tree with O(100,000,000,000) nodes, only O(100) would have to  
be kept open at the worst moment.

Steven
Received on Wednesday, 27 September 2006 14:02:13 GMT

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