Re: Mutation events replacement

On Fri, Jul 1, 2011 at 12:53 PM, David Flanagan <dflanagan@mozilla.com>wrote:

>  On 7/1/11 12:29 PM, Ryosuke Niwa wrote:
>
>  I think this will be really hard to implement.  For example, consider the
> following code:
> var parent = node.parentNode;
> parent.removeChild(node);
> setTimeout(function () {parent.appendChild(node), 0);
>
>
> I'd treat that as a removal followed by an insertion. I was only talking
> about the case of calling appendChild or insertBefore on a node that is
> already in the tree.  I'd like that not to generate a remove event and then
> an insert event.
>

Ah I see.  I think I misunderstood you then.  You're saying that
when appendChild, insertBefore, etc... are called with a node that's already
attached in the document, you just want to know that a node has been moved
from one place to another, right?  That makes a lot of sense.  Maybe in the
mutation lists where we list an equivalent of DOMNodeInserted, we'll have a
property to indicate the old container as well as the new container.

- Ryosuke

Received on Friday, 1 July 2011 20:00:10 UTC