Re: DOM Level 3 Events

2009/5/18 Travis Leithead <Travis.Leithead@microsoft.com>

> My understanding is that the “document does it all”. In this manner,
> recursive or re-entrant event handlers that modify the tree do not have an
> effect on the original computed path. In other words, if an event handler is
> triggered which removes the target node from the document before the capture
> phase completes, that target node will still receive the event despite the
> fact that it’s no longer in the tree (because the document is managing
> it).
>
I agree with you that's the path I've eventually decided to follow. It
should be said however that from an implementation point of view the second
method is not entirely infeasible and therein lies the minor ambiguity.
I.e., if the event is initialized with, among other things, a nodelist
detailing its propagation path, each event target along the way can be
responsible for pushing (or not) the event to the next target node, no
matter if the node is or is no longer in the tree. I think.

But I think the first method is just cleaner and simpler, I do not see
advantages with the idea of event targets passing each other the event.

Thank you!

Manu

Received on Monday, 18 May 2009 21:50:08 UTC