cloneNode() and registered EventListener(s)

Hello,

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