Re: [CSS4 Selectors] :matches naming bikeshed

On Thu, Jun 16, 2011 at 8:13 PM, fantasai <fantasai.lists@inkedblade.net>wrote:

> On 06/16/2011 07:58 PM, Ojan Vafai wrote:
>
>> I think we should rename :matches to :any.
>>
>> 1. :matches, doesn't make clear the "or" relationship that :any does. I
>> could
>>   easily interpret :matches to mean that it matches all of the selectors
>>   instead of any one of them.
>> 2. Two browser vendors already ship :any (vendor prefixed of course).
>> 3. :any is less typing and fewer bytes to ship down the wire.
>>
>
> I chose "matches" over "any" because
>  1. it contrasts with :not() which is the negation of the exact same
> functionality
>  2. it allows expansion to a full :matches() implementation, where a full
> :matches()
>     implementation is that :matches() takes any selector (including those
> with
>     combinators); calling it :any() implies there has to be more than one
> argument
>     for it to be useful, which is the case now, but would not be for a full
> version
>
> Basically, I think about this as
>  :not(selector)
>  :matches(selector)
> where selector can include commas, as per usual (rather than as
>

I think I'm a bit confused on terminology here. I don't think of selectors
as allowing commas. I think of that as a selector group as per
http://dev.w3.org/csswg/selectors4/#grouping.

Terminology aside, I don't think many web developers think of a
comma-separated list of selectors as a single selector. Similarly,
querySelectorAll doesn't take a comma-separated list, right? It would be
nice if it did, but I think that ship has sailed.

Boris, Rob, you have opinions on this? I don't feel strongly about this. I'm
not opposed to changing WebKit if Gecko changes as well, but I still prefer
:any to :matches.

Ojan


>  :not(selector, selector)
>  :any(selector, selector)
> where it can't).
>
> Does that make sense now or still not? :)

Received on Friday, 17 June 2011 17:51:47 UTC