W3C home > Mailing lists > Public > www-dom@w3.org > October to December 1998

Re: Walking the DOM (was: XML APIs)

From: John Cowan <cowan@locke.ccil.org>
Date: Fri, 06 Nov 1998 13:23:28 -0500
Message-ID: <36433EA0.8637E40A@locke.ccil.org>
To: DOM List <www-dom@w3.org>
Stephen R. Savitzky wrote:

> But in
> fact even with pseudo-timestamps on the document, you need an O(log N) test
> to determine whether an iterator is inside the part of the document that
> changed; presumably you wouldn't want to invalidate _all_ iterators, only
> the ones currently inside the affected subtree.

Actually I *was* thinking of invalidating all iterators, on the assumption
that the number of iterators is typically small, even if we can't
(due to garbage-collection considerations) determine its actual value.

For Level 1 purposes, a NodeList doesn't actually get invalidated
from the user's viewpoint; it just has to rescan the tree from the origin.

> Determining the desired behavior when a subtree that contains an iterator is
> _moved_ is even more difficult.  One can make a good case either way.

I think it's simplest to treat moves as remove + insert.

-- 
John Cowan	http://www.ccil.org/~cowan		cowan@ccil.org
	You tollerday donsk?  N.  You tolkatiff scowegian?  Nn.
	You spigotty anglease?  Nnn.  You phonio saxo?  Nnnn.
		Clear all so!  'Tis a Jute.... (Finnegans Wake 16.5)
Received on Friday, 6 November 1998 13:22:11 GMT

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