Re: [DOM4] NodeList should be deprecated

On Thu, Mar 8, 2012 at 11:57 PM, Anne van Kesteren <> wrote:

> On Thu, 08 Mar 2012 23:24:45 +0100, Ojan Vafai <> 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
>> .
> 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.

- Adam

Received on Monday, 12 March 2012 18:01:22 UTC