W3C home > Mailing lists > Public > www-dom@w3.org > April to June 1999

cloneNode() and registered EventListener(s)

From: Christian Roth <rothc@informatik.tu-muenchen.de>
Date: Tue Apr 13 07:06:10 1999
To: "DOM Mailing List" <www-dom@w3.org>
Message-Id: <19990413110541Z12004-8139+4852@hpsystem14.informatik.tu-muenchen.de>

I am in the course of implementing DOM Level 2 in C++ and stumbled upon 
the following:

What happens to EventListeners that are registered for a certain Node 
when it is cloned? Are they copied alongside or does the new Node have no 
EventListeners registered initially?

Are there any ideas on how to implement the registration of 
EventListeners safely and efficiently? At the moment, I store a list that 
contains a pointer to the EventListeners registered. But then, who is 
responsible for deleting the EventListener object? Is this a case for 
"reference counted object(-pointers)"? On the other hand, if I store the 
direct object in the list, the idea of "using the same listener on 
several Nodes" cannot be implemented, as they would all be different 
objects. Sharing data would only be possible by using static class 
members (uh-oh...).

cu Christian.
Received on Tuesday, 13 April 1999 07:06:10 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:36:44 UTC