W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2011

Re: Mutation events replacement

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 22 Jul 2011 11:54:12 -0400
Message-ID: <4E299D24.8090203@mit.edu>
To: Aryeh Gregor <Simetrical+w3c@gmail.com>
CC: Ryosuke Niwa <rniwa@webkit.org>, David Flanagan <dflanagan@mozilla.com>, public-webapps@w3.org
On 7/22/11 11:44 AM, Aryeh Gregor wrote:
> Pretty much any formatting command is going to involve adding and
> removing wrapper elements.  To add a wrapper element, say adding a<b>
> around some text to make it bold, you first have to insert the wrapper
> before or after the thing you want to wrap, then move all the nodes to
> wrap into the wrapper.

Actually, you can pretty easily do it in the other order (move the text 
into the <b>, and then put the <b> in the DOM), and may want to so as to 
minimize the number of changes the the live DOM; that's something that's 
often recommended as a performance enhancement.

> Likewise, to remove a wrapper, you have to
> first move all its contents adjacent to it, then actually remove it
> from its parent.

Again, these can easily happen in the opposite order....

> So I don't have any numbers, but anecdotally, editing things
> definitely does a lot of moving.  If you want numbers, though, you
> probably don't want to look at my implementation -- you want some
> real-world software that actually uses mutation events.

I don't need software that uses mutation events.  I need software that 
triggers editing operations, so I can them actually measure what DOM 
mutations are performed in the course of these editing operations.

-Boris
Received on Friday, 22 July 2011 15:54:42 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:46 GMT