RE: Recent questions about document traversal

> What is the correct behavior when the current node is deleted?

The TreeWalker follows its current node. Asking for the parent returns its
parent (or other ancestor, if the parent is filtered out, or null if none can be
found) at the time you ask the question.

Our shorthand term for this is "pure current-node semantics" -- all operations
are performed in terms of the current state of the current node, and the current
node doesn't change until you take an action that causes the TreeWalker to
select another current node. It's almost like having a reference directly to
that node, but with the TreeWalker's navigation methods.

(John already said this, but: There's no such thing as "deletion" in the DOM. A
node can be removed from its context, but continues to exist until/unless
implementation-specific actions are taken to destroy it... and those actions are
ouside the DOM's scope. Use the term "removal" to avoid confusion. Yes, early
drafts of the Traversal chapter made the same mistake!)

______________________________________
Joe Kesselman  / IBM Research

Received on Friday, 17 September 1999 03:30:29 UTC