Re: [WebIDL] Remove ArrayClass?

On Jul 19, 2014, at 2:55 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 7/19/14, 7:55 AM, Dirk Schulze wrote:
>> Removing ArrayClass will unlikely break content.
> 
> Sure.  I think we should aim slightly higher than not breaking content in API design.
> 
>>> 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
> 
> Ah, that's useful information.  I read through your link, but there is nothing specific there about the failure other than that it involved concat.  What was the actual fail?  Was it code like this:
> 
>  var x = document.querySelectorAll("*");
>  var y = x.concat();
> 
> or something else?

I do not have more information than the bits that you filtered already. For current WebKit, you just need the part that does not patch V8 from https://bugs.webkit.org/attachment.cgi?id=170983&action=prettypatch. I suppose it is easier to add [ArrayClass] to NodeList.webidl in Gecko.

> 
>> HTMLCollections might have problems as well with ArrayClass[2].
> 
> HTMLCollections are not ok to ArrayClass, because they have a named getter.  No one is seriously proposing to use ArrayClass on them.

Ok. Thanks.

> 
>> It just seems like there is a lot of risk that we break content.
> 
> It would really help in cases like this if vendors running into these problems would report details to the relevant standards list so that we don't all just end up duplicating the same compat testing work.
> 
>> Maybe we can find alternative solutions like Array wrappers that must be called by authors explicitly: ArrayWrapper(getClientRects()).
> 
> Authors can already do Array.prototype.slice.call(getClientRects()) or Array.from(getClientRects()) in browsers that support enough ES6. Adding Array.from to the browsers that don't support it yet would help here more than anything else.

Maybe this is enough and just needs to be evangelist?

Greetings,
Dirk

> 
> -Boris

Received on Saturday, 19 July 2014 13:24:15 UTC