W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2010

[whatwg] Adding ECMAScript 5 array extras to HTMLCollection (ATTN IE TEAM - TRAVIS LEITHEAD)

From: Garrett Smith <dhtmlkitchen@gmail.com>
Date: Thu, 29 Apr 2010 11:35:46 -0700
Message-ID: <n2rc9e12661004291135y143549a2wa4670b123a0d8b47@mail.gmail.com>
On Thu, Apr 29, 2010 at 6:59 AM, Geoffrey Sneddon <gsneddon at opera.com> wrote:
> On 28/04/10 23:28, Garrett Smith wrote:
>>
>> On Wed, Apr 28, 2010 at 2:12 AM, James Graham<jgraham at opera.com> ?wrote:
>>>
>>> On 04/28/2010 10:27 AM, David Bruant wrote:
>>>
>>>> When I started this thread, my point was to define a normalized way
>>>> (through ECMAScript binding) to add array extras to array-like objects
>>>> in the scope of HTML5 (HTMLCollection and inheriting interfaces).
>>>> I don't see any reason yet to try to find a solution to problems that
>>>> are in current web browsers.
>>>> Of course, if/when a proposal emerges from this thread and some user
>>>> agent accept to implement it, a workaround (probably, feature detection)
>>>> will have to be found to use the feature in user agents that implement
>>>> it and doing something equivalent in web browsers that don't.
>>>
>>> To be clear the proposals in this thread are pure syntactic sugar; they
>>> don't allow you do do anything that you can't already do like:
>>>
>>> Array.prototype.whatever.call(html_collection, arg1, arg2, ...)
>>>
>>> where "whatever" is the array method you are interested in.
>>>
>>
>> - and from that you can expect errors in Internet Explorer up to and
>> including version 8.
>
> Adding a toArray operation (for example) won't work in IE up to and
> including version 8 though either. There's no point in adding a toArray
> operation for the pure reason that they currently don't implement another
> part of the spec (through the WebIDL references) currently. toArray adds no
> extra usefulness once they implement other parts of the spec.
>

It's pretty hard to make out what you're getting at here. You "the
spec" to refer to something "here" that "they" don't implement.

It was also hard to understand your meaning in:

| To be clear the proposals in this thread are pure syntactic sugar;
| they don't allow you do do anything that you can't already do like:
|
|   Array.prototype.whatever.call(html_collection, arg1, arg2, ...)"

 Array.prototype.slice.call(html_collection) is not something that one
cannot already do; it *is* something that can be done, however one
cannot expect an Array to be returned from that operation in IE <= 8.
Whatever it is you meant to convey in that paragraph was lost.

If IE "dhtml collections" are implemented as native ECMAScript objects
in IE9, the case for the "toArray" proposal is weak.

The fact that IE implements "dhtml collections" as unwieldy
error-throwing objects poses an obstacle at a fundamental level. That
problem needs to be addressed by Microsoft.

[...]

>
> In IE8 document.styleSheets.toArray().slice(0, 1); also throws an error. How
> does adding toArray help for IE8, which you're giving as the reason for
> adding it?
>

What lead you to the assumption that I proposed "toArray" to address
problems in IE8? I would not publish something so ludicrous.

>> Travis Leithead and IE Team: Can you release Internet Explorer 9 with
>> all "dhtml collections" implemented as native EcmaScript objects?
>
> As far as I am aware, none of them are on this list.
>

He subscribes to the w3c-censored lists (dog-and-pony shows), but now
that you mention it, I don't see his name showing up here much.
Received on Thursday, 29 April 2010 11:35:46 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:22 UTC