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

Re: [WebIDL] Remove ArrayClass?

From: David Bruant <bruant.d@gmail.com>
Date: Fri, 18 Jul 2014 23:58:20 +0200
Message-ID: <53C9987C.5000706@gmail.com>
To: Dirk Schulze <dschulze@adobe.com>, "Tab Atkins Jr." <jackalmage@gmail.com>
CC: "public-script-coord@w3.org" <public-script-coord@w3.org>
Le 18/07/2014 23:37, Dirk Schulze a écrit :
> On Jul 18, 2014, at 11:26 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>
>> On Fri, Jul 18, 2014 at 2:21 PM, Dirk Schulze <dschulze@adobe.com> wrote:
>>> WebIDL currently specifies ArrayClass[1] as:  “it indicates that the internal [[Prototype]] property of its interface prototype object will be the Array prototype object rather than the Object prototype object”.
>>>
>>> So far ArrayClass was just proposed for the legacy interface DOMRectList recently. In Gecko, ArrayClass is used for MediaLink and two internal, not yet specified interfaces. It seems that most people strongly prefer sequences over ArrayClass. Both, MediaList and DOMRectList (ClientRectList previously) are just implemented with the Array prototype in Gecko (and Servo?). No other browser engine seems to support something like ArrayClass.
>>>
>>> I would suggest that ArrayClass gets removed and keep the legacy interfaces as implemented in most browsers without Array prototype.
>> sequence<Foo> and [ArrayClass] Foo do different things - [ArrayClass]
>> subclasses an array, so you can add more attributes/methods, but
>> sequence<Foo> is just a plain array holding Foo objects.
> The point is that you shouldn’t define interfaces that require more than sequences today I think.
Agreed.

It's attempted to add [ArrayClass] to NodeList and HTMLCollection. I 
don't remember where the experiment is at, but that's a good use for 
[ArrayClass] if that works I believe.

Maybe it should be renamed [LegacyArrayClass] to discourage folks from 
using it. The WebIDL spec could warn about its use and encourage using 
sequences instead.

David
Received on Friday, 18 July 2014 21:58:50 UTC

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