Re: Parent Combinator / Parent pseudo-class

Tab Atkins Jr. wrote:
>
>
> On Fri, Jul 25, 2008 at 4:30 PM, Andrew Fedoniouk 
> <news@terrainformatica.com <mailto:news@terrainformatica.com>> wrote:
>
>     Tab Atkins Jr. wrote:
>
>         On Fri, Jul 25, 2008 at 10:56 AM, Brad Kemper
>         <brkemper@comcast.net <mailto:brkemper@comcast.net>
>         <mailto: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.
Neither do I.

Just a remainder that for things like
   div:with-child(code)
CSS implementation should have piece that does local (element-as-a-root) 
matches.

Whatever it will use :root or :scope or even :bound-element [1] is 
irrelevant.

Just a desire that it should use something common rather than three 
different entities.
|
--
Andrew Fedoniouk

http://terrainformatica.com

[1] http://www.w3.org/TR/becss/#the-bound-element
"|If the selector is used in a context that is not specific to a 
binding, then it must match any bound element.|"


<http://www.w3.org/TR/becss/#bound-element>|

Received on Saturday, 26 July 2008 00:14:23 UTC