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

--------------------------------------------------
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 UTC