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

Re: [selectors-api] Liveness versus NodeList

From: Stewart Brodie <stewart.brodie@antplc.com>
Date: Fri, 21 Nov 2008 15:48:24 +0000
To: <public-webapps@w3.org>
Message-ID: <4e4b261e84ee4f4e67dd8cc83e9de3b61e588e4b@localhost>

Lachlan Hunt <lachlan.hunt@lachy.id.au> wrote:

> 
> Gavin Kistner wrote:
> > DOM Level 2 Core and DOM Level 3 Core both say:
> > "The NodeList interface provides the abstraction of an ordered
> > collection of nodes, without defining or constraining how this
> > collection is implemented. NodeList objects in the DOM are live." [1]
[2]
> >
> > " NodeList and NamedNodeMap objects in the DOM are live; that is,
> > changes to the underlying document structure are reflected in all
> > relevant NodeList and NamedNodeMap objects. For example, if a DOM user
> > gets a NodeList object containing the children of an Element, then
> > subsequently adds more children to that element (or removes children, or
> > modifies them), those changes are automatically reflected in the
> > NodeList, without further action on the user's part. Likewise, changes
> > to a Node in the tree are reflected in all references to that Node in
> > NodeListand NamedNodeMap objects." [3] [4]
> 
> This is considered to be a bug in the DOM Core specs, which will
> hopefully be fixed by Web DOM Core, which is a proposal Simon Pieters is
> working on.

You will still need a new type, as I don't see how you can possibly change
the existing behaviour so dramatically under the feet of existing content.

I would not like to lose the liveness property of node lists, as it would
make NodeList objects incredibly memory inefficient if we had to construct
the entire node list at NodeList construction time, too.


-- 
Stewart Brodie
Software Engineer
ANT Software Limited
Received on Friday, 21 November 2008 15:49:05 GMT

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