Re: Implementing NodeList

     There is nothing in the spec about updating of the index positions and
     such. It is entirely up to the user to stay out of trouble.  Since the
     current DOM spec does not support concurrent access to a DOM, this is
     easily done.


Uhm... Don, that's the question I started with: "Does the fact that
NodeList is explicitly described as 'live' imply that if I take a NodeList,
insert and/or delete nodes, take another NodeList and compare the two, they
will have the same nodes at the same indices?"

I was told "yes".

If that's correct, the update (or something that achieves the same
appearance) is required... which is what I'm trying to find a clean
implementation for, specifically in the case where the NodeList came from
getElementsByTagName() and hence may reach deep into the tree.

Unless, of course, my understanding of getElementsByTagName() is incorrect
and it really means "get immediate children by tag name", which would make
the whole problem cheap enough not to have to worry about... but the
description of that method says it searches the subtree.

Received on Monday, 27 July 1998 17:02:30 UTC