Bikesheds Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-21 Thread Charles McCathieNevile
On Wed, 20 Jun 2012 16:26:14 +0200, Lachlan Hunt lachlan.h...@lachy.id.au wrote: On 2012-06-20 10:42, Charles McCathieNevile wrote: In other words we have the same arguments that we had five years ago, when we settled on querySelector as the one that provoked least objection. ... But

Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-21 Thread Lachlan Hunt
On 2012-06-20 17:46, Marat Tanalin | tanalin.com wrote: 20.06.2012, 18:14, Lachlan Hunt lachlan.h...@lachy.id.au: 4. Support for returning elements that are not descendants of the context object. This feature allows a selector to be constructed such that it matches an element anywhere in

Re: Bikesheds Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-21 Thread Kang-Hao (Kenny) Lu
(12/06/20 22:26), Lachlan Hunt wrote: On 2012-06-20 10:42, Charles McCathieNevile wrote: In other words we have the same arguments that we had five years ago, when we settled on querySelector as the one that provoked least objection. ... But spending another few months arguing about it

Re: Bikesheds Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-21 Thread Lachlan Hunt
On 2012-06-21 15:56, Kang-Hao (Kenny) Lu wrote: (12/06/20 22:26), Lachlan Hunt wrote: On 2012-06-20 10:42, Charles McCathieNevile wrote: In other words we have the same arguments that we had five years ago, when we settled on querySelector as the one that provoked least objection. ... But

Re: Bikesheds Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-21 Thread Charles McCathieNevile
On Thu, 21 Jun 2012 15:56:45 +0200, Kang-Hao (Kenny) Lu kennyl...@csail.mit.edu wrote: (12/06/20 22:26), Lachlan Hunt wrote: On 2012-06-20 10:42, Charles McCathieNevile wrote: In other words we have the same arguments that we had five years ago, when we settled on querySelector as the one

Re: Bikesheds Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-21 Thread Kang-Hao (Kenny) Lu
(12/06/21 23:28), Charles McCathieNevile wrote: On Thu, 21 Jun 2012 15:56:45 +0200, Kang-Hao (Kenny) Lu kennyl...@csail.mit.edu wrote: (12/06/20 22:26), Lachlan Hunt wrote: The least-objectionable alternative is rarely the best alternative, and trying to please everyone is a fool's errand.

Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-20 Thread Charles McCathieNevile
On Wed, 20 Jun 2012 06:19:22 +0200, Elliott Sprehn espr...@gmail.com wrote: On Tue, Jun 19, 2012 at 1:38 PM, Tab Atkins Jr. jackalm...@gmail.comwrote: ... This is not a good argument. qSA is used often enough, and has a long enough name, that the name is actually a pretty significant

Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-20 Thread Lachlan Hunt
On 2012-06-20 10:42, Charles McCathieNevile wrote: In other words we have the same arguments that we had five years ago, when we settled on querySelector as the one that provoked least objection. ... But spending another few months arguing about it hasn't proven that we are any wiser, nor

Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-20 Thread Marat Tanalin | tanalin . com
20.06.2012, 18:26, Lachlan Hunt lachlan.h...@lachy.id.au: In particular, is there really value in adding two distinct methods that differ only by whether they return 1 element or a collection?  Resolving this issue first would help with resolving the naming issue. It should be noted that

Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-20 Thread Dave Methvin
It should be noted that JQuery/sizzle does not use querySelector() at all, AFAICS. It only uses querySelectorAll() and sometimes switches to .getElementById() or document.body. I took a look at using querySelector as an optimization a while back but it did not seem to make a significant

Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-20 Thread Marat Tanalin | tanalin . com
20.06.2012, 18:14, Lachlan Hunt lachlan.h...@lachy.id.au: 4. Support for returning elements that are not descendants of the context object. This feature allows a selector to be constructed such that it matches an element anywhere in the tree relative to the context element. This feature

Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-20 Thread Boris Zbarsky
On 6/20/12 10:52 AM, Dave Methvin wrote: This test html is based on the msn.com http://msn.com home page to be representative of a big real-life document. For what it's worth, that document has about 2200 DOM nodes. That's two orders of magnitude smaller than big real-life documents. This

Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-20 Thread Boris Zbarsky
On 6/20/12 11:34 AM, Marat Tanalin | tanalin.com wrote: It's natural to suppose that searching for just _first_ matching element and returning immediately once it's found should be much _faster_ than searching for _all_ matching elements (be it 100 or 1000 elements) even if we need just first

Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-19 Thread Simon Pieters
On Mon, 18 Jun 2012 16:57:17 +0200, Kang-Hao (Kenny) Lu kennyl...@csail.mit.edu wrote: (12/06/18 22:45), Simon Pieters wrote: I think we should instead either fix the old API (if it turns out to not Break the Web) or live with past mistake (if it turns out it does). To find out whether it

Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-19 Thread Brian Kardell
I am very opposed to this, they do different things. Having abilities isn't a bad thing and numerous Web sites and libraries make use of qsa, not just because find was not available but because different APIs shapes interesting new possibilities, different ways of looking at problems, etc... We

Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-19 Thread Tab Atkins Jr.
On Mon, Jun 18, 2012 at 10:59 PM, Simon Pieters sim...@opera.com wrote: On Mon, 18 Jun 2012 16:57:17 +0200, Kang-Hao (Kenny) Lu kennyl...@csail.mit.edu wrote: (12/06/18 22:45), Simon Pieters wrote: I think we should instead either fix the old API (if it turns out to not Break the Web) or

Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-19 Thread Marat Tanalin | tanalin . com
20.06.2012, 00:38, Tab Atkins Jr. jackalm...@gmail.com: On Mon, Jun 18, 2012 at 10:59 PM, Simon Pieters sim...@opera.com wrote:  On Mon, 18 Jun 2012 16:57:17 +0200, Kang-Hao (Kenny) Lu  kennyl...@csail.mit.edu wrote:  We have lots of shipped APIs with worse names. I think we should live with

Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-19 Thread Elliott Sprehn
On Tue, Jun 19, 2012 at 1:38 PM, Tab Atkins Jr. jackalm...@gmail.comwrote: ... This is not a good argument. qSA is used often enough, and has a long enough name, that the name is actually a pretty significant misfeature. This is a pretty core API, and both it and its precursors

Re: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-18 Thread Kang-Hao (Kenny) Lu
(12/06/18 22:45), Simon Pieters wrote: I think we should instead either fix the old API (if it turns out to not Break the Web) or live with past mistake (if it turns out it does). To find out whether it Breaks the Web (and the breakage can't be evanged), I suggest we ship the

RE: [selectors-api] Consider backporting find() behavior to querySelector()

2012-06-18 Thread Travis Leithead
-Original Message- From: Kang-Hao (Kenny) Lu [mailto:kennyl...@csail.mit.edu] (12/06/18 22:45), Simon Pieters wrote: I think we should instead either fix the old API (if it turns out to not Break the Web) or live with past mistake (if it turns out it does). To find out whether