Re: Suggestion for CSS3 selectors (fwd)

Brian J. Fink wrote:
> 
> Hey wait! I have an idea! Why not use the existing descendant
> algorithm and apply the styles to the ancestors at the same time? This
> is how it would work:
> 
> 1. Scan through the document, checking for selector1.
> 2. At each occurence of selector1, check if its direct parent is selector2.
> 3. Apply the style to that parent.
> 
> A similar adaptation of the contextual algorithm could be used for
> Indirect Ancestor:
> 
> 1. Scan through the document, checking for selector1.
> 2. At each occurence, scan up the tree checking for context element selector2.
> 3. Apply the style to selector2.
> 
> That way you could locate the ancestor by finding its descendant
> first! (a lesson taken from genealogy!)

Yeah, that's how I would implement it if I were implementing it. :)

   http://lists.w3.org/Archives/Public/www-style/2007Apr/0180.html

(I think you explained it more understandably. ^^)

Unfortunately HP wants me to focus on printing bugs, so dbaron'll
probably get there first. ;)

I definitely think we should define this for the next version of
Selectors, though. It's on the list. We have a prospective spec
editor (Daniel Glazman). I expect it will be added if there's a
chance it'll live through CR.

~fantasai

Received on Monday, 28 April 2008 23:11:15 UTC