W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2012

Re: [DOM4] NodeList should be deprecated

From: Rick Waldron <waldron.rick@gmail.com>
Date: Mon, 12 Mar 2012 14:07:31 -0400
Message-ID: <CAHfnhfoWCty147Cv5kcFS6dpsAoVC5Dp3LEsMY7+Ni2jp-goxQ@mail.gmail.com>
To: Adam Klein <adamk@chromium.org>
Cc: Anne van Kesteren <annevk@opera.com>, WebApps WG <public-webapps@w3.org>, Erik Arvidsson <arv@chromium.org>, Ryosuke Niwa <rniwa@chromium.org>, Ojan Vafai <ojan@chromium.org>
On Mon, Mar 12, 2012 at 2:00 PM, Adam Klein <adamk@chromium.org> wrote:

> On Thu, Mar 8, 2012 at 11:57 PM, Anne van Kesteren <annevk@opera.com>wrote:
>
>> On Thu, 08 Mar 2012 23:24:45 +0100, Ojan Vafai <ojan@chromium.org> wrote:
>>
>>> Dynamic NodeLists have a significant memory and performance cost. Static
>>> NodeLists are basically just under-powered arrays. We should just return
>>> Node arrays from any new APIs that return a list of Nodes. I'd like to
>>> see NodeList get similar treatment to hasFeature, i.e. a note that it not be
>>> used for new APIs and possibly even the explicitly list the APIs allowed
>>> to return them.
>>>
>>> I don't see the Dynamic/Static distinction in DOM4 or the HTML spec. Is
>>> this specified anywhere?
>>>
>>
>> We use the words "live" and "static".
>>
>>
>>
>>  For reference, this came up in WebKit with some new Regions APIs
>>> https://bugs.webkit.org/show_**bug.cgi?id=80638<https://bugs.webkit.org/show_bug.cgi?id=80638>
>>> .
>>>
>>
>> Mutation observers uses NodeList too.
>
>
> Though there's no reason they couldn't use arrays instead (they're not
> live). In fact, that would make the API more self-consistent, since arrays
> (of MutationRecords) are already part of the interface.
>

The NodeList item() method is a blocker.


Rick



>
> - Adam
>
Received on Monday, 12 March 2012 18:08:21 GMT

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