remove docElem.matchesSelector, it wasn't supported anywhere unprefixed; fixes #13629 #1206

Closed
wants to merge 1 commit into
from

Projects

None yet

5 participants

@mgol
Member
mgol commented Mar 19, 2013

No description provided.

@mgol
Member
mgol commented Mar 19, 2013
@staabm staabm commented on the diff Mar 19, 2013
src/selector-native.js
@@ -24,7 +24,7 @@
*/
var selector_hasDuplicate,
- matches = docElem.matchesSelector ||
+ matches = docElem.matches ||
@staabm
staabm Mar 19, 2013 Contributor

should matchesSelector stay for browsers which do net yet support the latest spec

@mgol
mgol Mar 19, 2013 Member

No browser has already unprefixed matches so there's no need for that.

@staabm
staabm Mar 19, 2013 Contributor

So you should keep the old value name for BC

@mgol
mgol Mar 19, 2013 Member

Why? I've kept all prefixed versions but, as I said, once implementors start unprefixing they surely won't use an outdated name so I don't see the need to keep it.

@rwaldron
Member

Just curious—what browsers, if any, have been updated?

@mgol
Member
mgol commented Mar 19, 2013

@rwldrn Afaik no browser has unprefixed yet it but once they start they'll surely use the official name.

@scottgonzalez
Member

I commented on the ticket, but I'll comment here too, for those who are only following the PR. I think it's a really bad idea to start making changes based on an unfinished specification that isn't supported by any browser vendors. Let the standards process do its job...

@rwaldron
Member

@scottgonzalez +1, which is sort of where I was going with my question about browser implementation. jQuery does it's best work by sticking to working with what's there and not trying to overreach

@mgol
Member
mgol commented Mar 20, 2013

OK, but then you should also remove docElem.matchesSelector (and only leave prefixed versions) since it was taken from an unfinished specification not implemented anywhere as well.

@mgol
Member
mgol commented Mar 20, 2013

If that's what you prefer, I can update my pull requests. I just can think of no reason to keep in the code a method name implemented nowhere and taken from an unstable and out-of-date working draft so, IMHO, it should be changed anyway, one way or the other.

@dmethvin
Member

I left this elsewhere but it seems to me that matchesSelector and matches are not the same API so this PR is not correct at all. Vendors have implemented matchesSelector and we use it but nobody has implemented matches and it's not a drop-in replacement. (It's better, thankfully, @scottgonzalez will be happy to know that it accepts leading combinators!)

@scottgonzalez
Member

It's better, thankfully, @scottgonzalez will be happy to know that it accepts leading combinators!

I should've guessed, shorter names == saner implementations, right?

@mgol
Member
mgol commented Mar 20, 2013

Ah, OK, I was misled by caniuse's description suggesting that just the name has changed.

The only question left is if docElem.matchesSelector should be left or removed, see discussion in the bug tracker: http://bugs.jquery.com/ticket/13629

@dmethvin
Member

Closing this since it't more than a new name.

@dmethvin dmethvin closed this Mar 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment