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

Re: [css3-selectors] :parent selector

From: L. David Baron <dbaron@dbaron.org>
Date: Sun, 24 Sep 2006 09:55:31 -0700
To: www-style@w3.org
Message-ID: <20060924165531.GA3333@ridley.dbaron.org>
On Sunday 2006-09-24 17:41 +0300, Mihai Sucan wrote:
> The UA searches for all "form" nodes, then goes for all "input" child  
> nodes (not recursively in the tree, only the direct child nodes), then  
> picks all of those input child nodes which are not checked, of type=radio.  
> Having :parent only "asks" the UA to apply the properties to the parent  
> nodes of the picked "input" child nodes. The UA already has the parent  
> nodes (the "form" nodes), since it matched them previously to get to the  
> inputs.
> If this is not how things work now (most likely), then how do they work?

It's not at all the way things work now.

Selectors are processed one *element* at a time.  To style an element,
you find all the selectors that match the element.  Each selector is
processed from end-to-beginning.

You are describing a model where selectors are processed one selector at
a time.  Such a model would require rerunning the entire selection
algorithm every time the document changes.

Your proposals seems to be considerably less useful than previous
parent-selector or ancestor-selector proposals, but no easier to
implement efficiently.


L. David Baron                                <URL: http://dbaron.org/ >
           Technical Lead, Layout & CSS, Mozilla Corporation

Received on Sunday, 24 September 2006 16:55:34 UTC

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