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

Re: [WebIDL] Remove ArrayClass?

From: Dirk Schulze <dschulze@adobe.com>
Date: Sat, 19 Jul 2014 11:55:25 +0000
To: Boris Zbarsky <bzbarsky@MIT.EDU>
CC: "public-script-coord@w3.org" <public-script-coord@w3.org>
Message-ID: <9D0C0EA8-9D14-45B5-B5D9-0FCBFACB6FE4@adobe.com>

On Jul 19, 2014, at 3:18 AM, Boris Zbarsky <bzbarsky@MIT.EDU> wrote:

> On 7/18/14, 5:21 PM, Dirk Schulze wrote:
>> So far ArrayClass was just proposed for the legacy interface DOMRectList recently. In Gecko, ArrayClass is used for MediaLink
> 
> You mean MediaList.  Like the cssom spec says.

Yes of course, a typo. Sorry. Anyway, MediaList and DOMRectList (ClientRectList) are both not implemented in browsers other than Gecko/Servo. Authors can not rely on ArrayClass here anyway today. Removing ArrayClass will unlikely break content.

> 
> And we've had repeated requests to do it for NodeList as well.  I plan to do it soon if I don't run into compat issues (which I don't expect to).

It looks like WebKit has some experience with that already. The popular Closure library broke and many Google projects like Gmail broke with it. While Closure and Gmail have been fixed, there is no guarantee that other projects won’t have the same problem. (instanceof Array checks IIRC). The performance regressions we saw might be implementation specific though. [1]

HTMLCollections might have problems as well with ArrayClass[2].

> 
>> It seems that most people strongly prefer sequences over ArrayClass.
> 
> Sure.  ArrayClass is only useful for legacy listlike interfaces.  And then only for the ones without named getters.  But we should still make those suck less than they do now.

NodeList is a strong candidate for ArrayClass, yes. It just seems like there is a lot of risk that we break content. Closure was for sure just the tip of the iceberg. Legacy APIs that could use it are probably around for too long. Maybe we can find alternative solutions like Array wrappers that must be called by authors explicitly: ArrayWrapper(getClientRects()).

Greetings,
Dirk

> 
> -Boris
> 

[1] https://bugs.webkit.org/show_bug.cgi?id=81573
[2] https://www.w3.org/Bugs/Public/show_bug.cgi?id=16490
Received on Saturday, 19 July 2014 11:55:56 UTC

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