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

Re: Mutation events replacement

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 19 Jul 2011 23:23:30 -0400
Message-ID: <4E264A32.5020107@mit.edu>
To: public-webapps@w3.org
On 7/19/11 7:18 PM, Ryosuke Niwa wrote:
> For editing purposes, it's also crucial to know from/to where nodes are
> removed/inserted.  It seems like adding an offset trivially solves this
> problem without much overhead.

I'm not convinced about "without much overhead".  In general, adding an 
offset is O(N) in number of childnodes in many existing 
implementations....  that can be improved, but only at the cost of more 
memory or performance elsewhere.

> Again, it'll be very useful to have old and new values for editing
> purposes.  Although I have a reservation as to whether we should do for
> style or not because calling mutation listeners every time script
> modifies some style property will be quite expensive as it requires
> serializing CSSStyleDeclaration.

Yes, that is _exactly_ the problem.

I have a related question.  If the same node is inserted and removed 
over and over again (say 100 times) in the same task, what 
notification(s) will be delivered at the end of the task?

-Boris
Received on Wednesday, 20 July 2011 03:23:58 GMT

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