Re: DOM Level 2 Event Listeners and Document.importNode()

>Can you inform me of the desired behaviour of importing a node that has
>event listeners associated with it.

The newly created (imported) nodes will start off with no listeners.  The
DOM has no way of knowing which listeners should or shouldn't be attached
in the new document , and some might actually cause aplication malfunctions
if they were bound to the new nodes, so we leave this for the user to deal
with. There has been discussion of trying to invent a callback scheme where
each listener could say what it wants done in this situation,but I think we
decided it was becoming overly baroque.

>And while on this subject can you answer this same question for
>Document.adoptNode() in DOM Level 3

Good quesiton. adoptNode() is intended to really move the node object from
one document to another (in those situations where the DOM can do so
without destroying its internal datastructures). One can argue that this
means the listeners should remain attached. But I don't know if we've made
a formal decision on that.

______________________________________
Joe Kesselman  / IBM Research

Received on Wednesday, 11 July 2001 12:20:58 UTC