Re: a recall for a missing combinator

On 11/16/11 4:49 AM, Tab Atkins Jr. wrote:
> I approve of this.  Let's call it the "closest descendant" combinator.
>   Perhaps it could look like ">>".

What would it match, exactly?  Recall that the requirement is to have 
something that given this markup:

   <article class=”product>
                 <header>…</header>
                 <div class=”main”>
                                <article class=”review”>
                                                <header>…</header>
                                                …
                                </article>
                 </div>
   </ article>

matches only the first <header>.

Seems to me like that's already possible with the proposed changes to 
:not, by the way:

   article.product header:not(article.review header)

> It's like the descendant
> combinator, except when you're walking up the tree to find the
> ancestor, you *also* look for someone else that matches the
> descendant.

If you just did that then you would match both <header>s in the testcase 
above.  So that doesn't work to address the use case put forward.

-Boris

Received on Tuesday, 15 November 2011 22:06:45 UTC