Re: [csswg-drafts] [selectors4] Name the “functional pseudo-class like :matches() with 0 specificity”

@therealglazou thanks for your very well reasoned answer! You make some excellent points.

I agree that "as" syntax for extra argument wasn't a good idea. But maybe with better way to do it (e.g. with a simple comma separator, as [in @tabatkins's initial proposal](1170#issuecomment-329877027)) the idea to reuse the same pseudo-class for both default-specificity and zero-specificity/custom-specificity matching would be not so bad? At least, it completely solves the "different names for the exactly the same thing except..." problem.

Unfortunatly, Apple [has shipped](https://developer.apple.com/library/content/releasenotes/General/WhatsNewInSafari/Articles/Safari_9_0.html#//apple_ref/doc/uid/TP40014305-CH9-SW34) the `:matches()` implementation, together with `:not()` with selector list and `:nth-*()` with `An + B of S` syntax support with no prefixes or flags back in 2015, in Safari 9.0. I agree that doing it while the spec was far from CR was not the right move from Apple. However, as @tabatkins mentioned, `:matches()` is now not only in the spec draft and Apple's implementation, but also in many docs and guides for web devs, in the compatibility tables like [caniuse.com](https://caniuse.com/#feat=css-matches-pseudo), in the lists of modern CSS features like [cssdb](https://jonathantneal.github.io/css-db/#selectors-matches) (where it is marked as "[Allowable](https://jonathantneal.github.io/css-db/#stage-3)"), and there are polyfills and [PostCSS plugins](https://github.com/postcss/postcss-selector-matches) for it. Changing it without _really good_ reasoning would punish not only Apple, but also authors and users of all these resources. There are also many CSS features (e.g. transforms, transitions and animations) that are implemented with "rough interoperability" and are widely used despite having never been in CR. I'm afraid that making CR status too important could possibly lead to "no implementation before CR/no CR before two implementations" deadlocks.

-- 
GitHub Notification of comment by SelenIT
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2143#issuecomment-361557835 using your GitHub account

Received on Tuesday, 30 January 2018 10:58:14 UTC