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

Re: Specificity of :any (was Re: [css3-selectors] Grouping)

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Thu, 25 Feb 2010 20:25:13 -0800
Message-ID: <153A8A28E88C41A5AB49A9F258FBFF8C@terra3>
To: "L. David Baron" <dbaron@dbaron.org>, <www-style@w3.org>

--------------------------------------------------
From: "L. David Baron" <dbaron@dbaron.org>
Sent: Thursday, February 25, 2010 3:16 PM
To: <www-style@w3.org>
Subject: Specificity of :any (was Re: [css3-selectors] Grouping)
...
>
> So given a selector like:
>
> p:any(:hover,#mypara)
>
> Should this selector have:
>
> specificity 11 (p + :any)
> specificity 111 (p + :hover + #mypara)
> specificity 121 (p + :any + :hover + #mypara)
> specificity 11 (p + :hover) or 101 (p + #mypara) depending on how it
>   matches (with 101 if it matches both ways)?
> one of 11 or 101, not depending on how it matches (just always the
>   lowest or highest)
>
> I'd note that the next-to-last seems like it might be best, but I
> can't think of an obvious way to implement it in our code.
>

Conceptually
p:any(:hover,#mypara) {}
is just two selectors
p:hover, p#mypara {}
sharing the same set of properties. So it is next-to-last.  Implementation 
is straightforward - just generate two selectors.

David, I am not sure I understand how and whom this :any() construction may 
benefit. Is this for UA developers or CSS authors?

-- 
Andrew Fedoniouk

http://terrainformatica.com






 
Received on Friday, 26 February 2010 04:25:43 GMT

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