W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2014

Re: [WebIDL] Remove ArrayClass?

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Sat, 19 Jul 2014 22:02:59 -0400
Message-ID: <53CB2353.1000601@mit.edu>
To: Dirk Schulze <dschulze@adobe.com>, "Tab Atkins Jr." <jackalmage@gmail.com>
CC: "public-script-coord@w3.org" <public-script-coord@w3.org>, Erik Arvidsson <arv@chromium.org>
On 7/19/14, 6:01 PM, Dirk Schulze wrote:
> It would be frustrating for authors to have querySelectorAll return a NodeList with Array prototype but let getElementsBy* return an HTMLCollection without Array capabilities.

Just like it's frustrating that querySelectorAll returns a static list 
but getElementsBy* returns a live list?  Or the various other behavior 
differences between the return values of the methods?

I agree it would be nice to have array stuff on HTMLCollection, but we 
know for a fact that would break code that relies on the named getter 
for a name that happens to collide with something on Array.prototype, 
which is what makes it a non-starter.

> getElementsBy* and querySelectorAll might have the same backwards compatibility issues if we just make them prototype Array.

No, the compat issues for getElementsBy* are much worse.

-Boris
Received on Sunday, 20 July 2014 02:03:29 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:22 UTC