W3C home > Mailing lists > Public > public-html@w3.org > April 2014

Re: Elements array and query/queryAll methods

From: Dean Edwards <dean.edwards@gmail.com>
Date: Tue, 8 Apr 2014 19:24:13 +0100
Message-ID: <CAJMHKgzxoF7g1Zi7ohKQXsvzLOSVGto-OWmWuund-mNoPcPH5A@mail.gmail.com>
To: Domenic Denicola <domenic@domenicdenicola.com>
Cc: Anne van Kesteren <annevk@annevk.nl>, Travis Leithead <travis.leithead@microsoft.com>, Eric Devine <devineej@gmail.com>, "public-html@w3.org" <public-html@w3.org>, "www-dom@w3.org" <www-dom@w3.org>
On 8 April 2014 19:13, Domenic Denicola <domenic@domenicdenicola.com> wrote:
> From: Dean Edwards <dean.edwards@gmail.com>
>
>> First of all it's counter-intuitive to how I'd expect it to work - the idea stemmed from jQuery's find() method which does not return duplicates.
>
> Hmm, perhaps I misunderstood---I thought you were talking about creating duplicates via `push` etc., but it sounds like you are worried about duplicates in the result of `queryAll`? If so, then yes, I agree there should not be duplicates in that result. It may be a mismatch between my "polyfill" (which was meant to be more illustrative than anything) versus the actual spec.

Ah, fair enough then. But then I go back to my initial problem with it
being difficult to polyfill without ES6 where we could at least use a
Set to prevent duplicates. A polyfill that we could use today would be
pretty slow compared to the existing querySelector(All) API.

I have actually written a polyfill for the Elements class using
real-world JS and it's horrible. :)
Received on Tuesday, 8 April 2014 18:24:41 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:16:38 UTC