W3C home > Mailing lists > Public > www-dom@w3.org > July to September 1998

Re: Implementing NodeList

From: Stephen R. Savitzky <steve@crc.ricoh.com>
Date: 27 Jul 1998 14:20:19 -0700
To: keshlam@us.ibm.com
Cc: www-dom@w3.org
Message-ID: <qc7m0zat4c.fsf@gelion.crc.ricoh.com>
keshlam@us.ibm.com writes:

>      Its simpler than it seems.  Each insertion or removal involves
>      incrementing
>      or decrementing the index by one.
> 
> That's not quite so simple, unless I'm missing something.

I _hope_ that what you're missing is that one only has to renumber the nodes
in a nodelist if they are all siblings.  Our implementation of a NodeList
simply refers to the parent and the renumbering happens automatically.

Actually, we have _two_ implementations of the NodeList interface:
ChildNodeList, which contains the children of a single Node, and
ArrayNodeList, which is an array of potentially unrelated nodes.  Only the
former is ``live''.  

It would be useful if the specification reflected this distinction.  It's
extremely useful to have both ``live'' and ``dead'' (or at least,
flash-frozen) collections of nodes. 

-- 
 Stephen R. Savitzky   Chief Software Scientist, Ricoh Silicon Valley, Inc., 
<steve@rsv.ricoh.com>                            California Research Center
 voice: 650.496.5710   fax: 650.854.8740    URL: http://rsv.ricoh.com/~steve/
  home: <steve@starport.com> URL: http://www.starport.com/people/steve/
Received on Monday, 27 July 1998 17:33:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:45 GMT