On Tue, Jun 28, 2011 at 2:24 PM, Jonas Sicking <jonas@sicking.cc> wrote:
>
> 1. DOMNodeRemoved is fired *before* a mutation takes place. This one's
> tricky since you have to figure out all the removals you're going to
> do, then fire events for them, and then hope that the mutations
> actually still makes sense.
In WebKit, at least, we don't do this during editing actions and
execCommand. In particular, we've delayed DOMNodeRemoved events to fire
after all mutations are done (violating the spec). We've got a few bug
reports saying that the event is not fired (i.e. invisible) to event
listeners on ancestor nodes because when the event is fired, the node has
already been removed.
Even before we made that change, WebKit always fired DOMNodeRemoved as we
remove nodes instead of figuring out all the removals because that's too
hard.
- Ryosuke