Re: [CSS4 Selectors] :matches naming bikeshed

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
   :not(selector, selector)
   :any(selector, selector)
where it can't).

Does that make sense now or still not? :)

~fantasai

Received on Friday, 17 June 2011 03:13:52 UTC