W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2002

RE: TreeWalker detach()

From: Watson, Christopher <CWatson@lightspan.com>
Date: Fri, 18 Jan 2002 13:03:36 -0800
Message-ID: <A65CC8B0C730D511B8340002A52CF7A214A18D@mail.lightspan.com>
To: "'Joseph Kesselman'" <keshlam@us.ibm.com>, Elliotte Rusty Harold <elharo@metalab.unc.edu>
Cc: www-dom@w3.org
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 GMT

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