W3C home > Mailing lists > Public > www-style@w3.org > January 2010

Re: [css3-selectors] Grouping

From: Brad Kemper <brad.kemper@gmail.com>
Date: Sun, 10 Jan 2010 10:31:56 -0800
Cc: François REMY <fremycompany_pub@yahoo.fr>, fantasai <fantasai.lists@inkedblade.net>, Nikita Popov <privat@ni-po.com>, news <news@terrainformatica.com>, www-style list <www-style@w3.org>
Message-Id: <2390D785-6C21-4D12-9991-DCDB8C9E458C@gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>

On Jan 9, 2010, at 9:13 PM, Tab Atkins Jr. wrote:

> On Sat, Jan 9, 2010 at 6:56 PM, Brad Kemper <brad.kemper@gmail.com> wrote:
>> On Jan 9, 2010, at 3:55 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:
>> 
>>>> So, for instance, to "select a P tag that contains an element matching
>>>> 'a:hover' in it", you would add a space after the p:
>>>> 
>>>> p :matches(a:hover)
>>> 
>>> No, that selects something different.
>>> 
>>> p :matches(a:hover)
>>> is equivalent to
>>> p a:hover
>> 
>> How is that different? The 'a' is an element inside the 'p' element. What
>> you wrote (with the space) is the same as what was described in the prose.
> 
> "p :matches(a:hover)" does not "select a P tag that contains an
> element matching 'a:hover' in it".  It matches an a:hover with a <p>
> ancestor.  The two are very different.
> 
> To select a <p> containing an a:hover, you have to use :has, like
> "p:has(a:hover)".

OK, then I misunderstood Fremy's objection. I guess I read it too fast and thought that it was the a:hover he was trying to match AND select. The concept of how :matches() is supposed to work is clear to me.

Received on Sunday, 10 January 2010 18:32:34 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:23 GMT