Re: [css-selectors] Proposal: Logical Combinators / Sets

François REMY skriver:
> If I'm not mistaken, here is the kind of selectors Brian's proposal is aimed to :
> 
>     :not(#a) {
>         selects all elements that are not #a
>     }
>     
>     :and(#a *, #b *) {
>         selects all elements that have both a #a and a #b parent
>     }
>     
>     :or(#a, #b) {
>         selects all elements that are either #a or #b
>     }
> 
> The other proposals (like anyOf, oneOf...) can be emulated using those three. Currently, we already have ':not()' (but I think it's somewhat limited to simple selectors) and it's already possible to emulate ':or()' using commas. So "a :or(b,c) d" == "a b d, a c d". So what's really missing is the ':and' operator.
> 
> (Brian if I'm wrong please correct me)
> 
> 

Boolean algebra says that you can fake and using or. !(!X || !Y) == X &&
Y It works in the other direction too. !(!X && !Y) == X || Y

Received on Wednesday, 13 March 2013 19:02:24 UTC