RE: TreeWalker detach()

The same fixup goes for Range, which also has detachability.

Christopher Watson
Sr. Software Engingeer
Director/Shockwave Development
Lightspan, Inc.
Tel: 858.824.8457
Fax: 858.824.8008


-----Original Message-----
From: Joseph Kesselman [mailto:keshlam@us.ibm.com]
Sent: Friday, January 18, 2002 12:56 PM
To: Elliotte Rusty Harold
Cc: www-dom@w3.org
Subject: Re: TreeWalker detach()



>Is there any particular reason NodeIterator has a detach() method and
>TreeWalker doesn't?

Because NodeIterator repairs itself as the document changes under it ("list
position semantics"), its implementations may involve event listeners or
the like which impose a performance burden on the DOM as long as the
NodeIterator is active. Having a way to deactivate it is therefore
important. Being able to do so immediately, rather than waiting until the
garbage collector (in GC langauges) gets around to cleaning it up, may make
a significant difference in application performance.

TreeWalker's "current node semantics" do not require fixup in response to
document mutation, so the same situation doesn't arise.

______________________________________
Joe Kesselman  / IBM Research

Received on Friday, 18 January 2002 16:04:15 UTC