W3C home > Mailing lists > Public > www-style@w3.org > March 2013

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

From: Henrik Andersson <henke@henke37.cjb.net>
Date: Wed, 13 Mar 2013 20:01:47 +0100
Message-ID: <5140CD1B.5060909@henke37.cjb.net>
To: François REMY <francois.remy.dev@outlook.com>, Brian Kardell <bkardell@gmail.com>, "liam@w3.org" <liam@w3.org>
CC: Bjoern Hoehrmann <derhoermi@gmx.net>, "www-style@w3.org" <www-style@w3.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:06 GMT