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

Re: Parent Combinator / Parent pseudo-class

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 25 Jul 2008 17:50:59 -0500
Message-ID: <dd0fbad0807251550k10d9377fmd8336e1e87e473b7@mail.gmail.com>
To: "Andrew Fedoniouk" <news@terrainformatica.com>
Cc: "Brad Kemper" <brkemper@comcast.net>, "Francois Remy" <fremycompany_pub@yahoo.fr>, "Boris Zbarsky" <bzbarsky@mit.edu>, "www-style list" <www-style@w3.org>
On Fri, Jul 25, 2008 at 4:30 PM, Andrew Fedoniouk <news@terrainformatica.com>

> Tab Atkins Jr. wrote:
>> On Fri, Jul 25, 2008 at 10:56 AM, Brad Kemper <brkemper@comcast.net<mailto:
>> brkemper@comcast.net>> wrote:
>>    Consider the following:
>>    div:with-child(code) { border:2px solid #999;
>>    background-color:beige; }
>>    div:with-child(code):before { content:"See Code:"; }
>>    I would only want this on DIVs that surrounded the Code block
>>    directly, not on any old DIV that happened to be an ancestor of
>>    the code block.
>> Nod, searching for just children would certainly be useful.  That's why my
>> proposal was for a simple selector preceded by a combinator.  You'd do this:
>> div:matches( > code ) { border:2px solid #999; background-color:beige; }
>> div:matches( > code ):before { content:"See Code:"; }
> That is again subject of :root/:scope debate :)

What?  No it's not.  The :scope debate was about a javascript querySelector
function, and whether we'd ever want to query higher in the document than
the current element.  Within a normal selector, if you want to match against
something higher in the document, *you just put it earlier in the
selector*.  There would never be any need for :matches to query higher up in
the DOM, and so it clearly matches from the 'current node' in the selector.

I don't want to reopen the :scope debate in this thread (if you do, go back
to the thread it appeared in), I just don't understand what relevance :scope
could possible have here.

Received on Friday, 25 July 2008 22:51:35 UTC

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