Skip to main content

Bug Tracker

Side navigation

#13629 closed bug (notabug)

Opened March 19, 2013 08:44PM UTC

Closed April 05, 2013 01:32AM UTC

Rename matchesSelector to matches

Reported by: m_gol Owned by:
Priority: low Milestone: None
Component: selector Version: 2.0b2
Keywords: Cc:
Blocked by: Blocking:
Description

According to the current version of the spec:

Attachments (0)

Change History (14)

Changed March 19, 2013 08:47PM UTC by m_gol comment:2

Changed March 19, 2013 08:49PM UTC by m_gol comment:3

Sizzle needs more similar changes btw.

Changed March 19, 2013 09:00PM UTC by m_gol comment:4

Changed March 19, 2013 09:03PM UTC by timmywil comment:5

component: unfiledselector
priority: undecidedlow
status: newopen

Replying to [comment:3 m_gol]:

Sizzle needs more similar changes btw.

A Sizzle issue would be perfect. :)

Changed March 19, 2013 09:09PM UTC by m_gol comment:6

Changed March 20, 2013 12:10AM UTC by scottgonzalez comment:7

Shouldn't we wait for at least one browser to implement this or for the spec to actually be stable? So far you've pointed at 2 sources: 1) The new spec, which specifically says that it is not stable; 2) caniuse which says that not a single browser supports the new name.

Changed March 20, 2013 12:25AM UTC by m_gol comment:8

I'll repeat my comment from pull request: consequently, you should also remove docElem.matchesSelector (and only leave prefixed versions) since it was taken from an unfinished specification not implemented anywhere as well.

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.

Changed March 20, 2013 12:44AM UTC by scottgonzalez comment:9

Replying to [comment:8 m_gol]:

I'll repeat my comment from pull request: consequently, you should also remove docElem.matchesSelector (and only leave prefixed versions) since it was taken from an unfinished specification not implemented anywhere as well.

Except that prefixed versions WERE implemented. We should always wait for at least one implementation before writing code to support a proposed feature.

PLEASE PLEASE PLEASE DO NOT lock browser vendors into an API based on an unstable spec and a previous prefixed implementation. We're killing the standards process if we do.

Changed March 20, 2013 01:11AM UTC by m_gol comment:10

_comment0: > > I'll repeat my comment from pull request: consequently, you should also remove `docElem.matchesSelector` (and only leave prefixed versions) since it was taken from an unfinished specification not implemented anywhere as well. \ > \ > Except that prefixed versions WERE implemented. \ \ Exactly. Prefixed versions were implemented, e.g. `mozMatchesSelector` & `webkitMatchesSelector` were implemented; `matchesSelector` hasn't been implemented anywhere. What I'm saying is that I understand your concerns but it means that the code: \ {{{ \ matches = docElem.matchesSelector || \ docElem.mozMatchesSelector || \ docElem.webkitMatchesSelector || \ docElem.oMatchesSelector || \ docElem.msMatchesSelector \ }}} \ should be changed to: \ {{{ \ matches = docElem.mozMatchesSelector || \ docElem.webkitMatchesSelector || \ docElem.oMatchesSelector || \ docElem.msMatchesSelector \ }}} \ i.e. the `docElem.matchesSelector` part should be completely removed. \ \ Do you want me to make such a change?1363741934141613
_comment1: > > I'll repeat my comment from pull request: consequently, you should also remove `docElem.matchesSelector` (and only leave prefixed versions) since it was taken from an unfinished specification not implemented anywhere as well. \ > \ > Except that prefixed versions WERE implemented. \ \ Exactly. Prefixed versions were implemented, e.g. `mozMatchesSelector` & `webkitMatchesSelector` were implemented; `matchesSelector` hasn't been implemented anywhere. What I'm saying is that I understand your concerns (and agree with them!) but it means that the code: \ {{{ \ matches = docElem.matchesSelector || \ docElem.mozMatchesSelector || \ docElem.webkitMatchesSelector || \ docElem.oMatchesSelector || \ docElem.msMatchesSelector \ }}} \ should be changed to: \ {{{ \ matches = docElem.mozMatchesSelector || \ docElem.webkitMatchesSelector || \ docElem.oMatchesSelector || \ docElem.msMatchesSelector \ }}} \ i.e. the `docElem.matchesSelector` part should be completely removed. \ \ Do you want me to make such a change?1363741960536420
> I'll repeat my comment from pull request: consequently, you should also remove docElem.matchesSelector (and only leave prefixed versions) since it was taken from an unfinished specification not implemented anywhere as well. Except that prefixed versions WERE implemented.

Exactly. Prefixed versions were implemented, e.g. mozMatchesSelector & webkitMatchesSelector were implemented; matchesSelector hasn't been implemented anywhere. What I'm saying is that I understand your concerns but it means that the code:

matches = docElem.matchesSelector ||
		docElem.mozMatchesSelector ||
		docElem.webkitMatchesSelector ||
		docElem.oMatchesSelector ||
		docElem.msMatchesSelector

should be changed to:

matches = docElem.mozMatchesSelector ||
		docElem.webkitMatchesSelector ||
		docElem.oMatchesSelector ||
		docElem.msMatchesSelector

i.e. the docElem.matchesSelector part should be completely removed.

Do you want me to make such a change?

Changed March 20, 2013 01:19AM UTC by scottgonzalez comment:11

It seems a bit premature to assume no browser vendor will implement an unprefixed matchesSelector. However, I don't have a strong opinion on whether it stays or goes.

Changed March 20, 2013 01:21AM UTC by m_gol comment:12

Does it happen for browser vendors to implement an unprefixed version of an experimental feature based on an out-of-date spec working draft?

Changed March 24, 2013 12:19AM UTC by m_gol comment:13

_comment0: I see timmywill has removed `docElem.matchesSelector` from Sizzle as I suggested.1364084884174722

I see timmywill has removed docElem.matchesSelector from Sizzle as I suggested.

This ticket can now be closed, obviously.

Changed April 05, 2013 01:32AM UTC by dmethvin comment:14

resolution: → notabug
status: openclosed