W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: QSA, the problem with ":scope", and naming

From: Alex Russell <slightlyoff@google.com>
Date: Mon, 31 Oct 2011 13:57:24 -0700
Message-ID: <CANr5HFUmZjEGWvVgMG7P=o-kcN9zprfmy9TbGOCcq9UNZwFPoQ@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Cameron McCormack <cam@mcc.id.au>, Jonas Sicking <jonas@sicking.cc>, Webapps WG <public-webapps@w3.org>, Yehuda Katz <wycats@gmail.com>, John Resig <jeresig@gmail.com>, Paul Irish <paulirish@google.com>, Lachlan Hunt <lachlan.hunt@lachy.id.au>
What Tab said  = )

On Sun, Oct 30, 2011 at 9:23 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Sat, Oct 29, 2011 at 8:28 PM, Cameron McCormack <cam@mcc.id.au> wrote:
>> On 20/10/11 3:50 AM, Alex Russell wrote:
>>>
>>> I strongly agree that it should be an Array *type*, but I think just
>>> returning a plain Array is the wrong resolution to our NodeList
>>> problem. WebIDL should specify that DOM List types *are* Array types.
>>> It's insane that we even have a NodeList type which isn't a real array
>>> at all. Adding a parallel system when we could just fix the one we
>>> have (and preserve the value of a separate prototype for extension) is
>>> wonky to me.
>>>
>>> That said, I'd *also* support the ability to have some sort of
>>> decorator mechanism before return on .find() or a way to re-route the
>>> prototype of the returned Array.
>>>
>>> +heycam to debate this point.
>>
>> Late replying here again, apologies, but I agree with others who say that an
>> actual Array object should be returned from this new API given that it is
>> not meant to be live.  What benefit is there from returning a NodeList?
>
> If it's a NodeList (or something else that *subclasses* Array) we can
> do fun things like add .find to it, which returns the sorted union of
> calling .find on all the elements within it.  Returning a plain Array
> doesn't let us do that.
>
> ~TJ
>
Received on Monday, 31 October 2011 20:58:47 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:48 GMT