W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2001

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

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Wed, 11 Jul 2001 12:20:17 -0400
Cc: www-dom@w3.org
Message-ID: <OFF21B2B68.B52203C5-ON85256A86.0059088D@pok.ibm.com>

>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

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:08 UTC