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

Re: Suggestion for CSS3 selectors (fwd)

From: fantasai <fantasai.lists@inkedblade.net>
Date: Mon, 28 Apr 2008 16:10:37 -0700
Message-ID: <4816596D.7070307@inkedblade.net>
To: Ian Hickson <ian@hixie.ch>
CC: www-style@w3.org, "Brian J. Fink" <desertowl23@gmail.com>

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. :)


(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.

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

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