Re: Mutation events replacement

On 07/21/2011 06:01 PM, Boris Zbarsky wrote:
> On 7/21/11 5:08 AM, Dave Raggett wrote:
>> Thanks for the explanation. Apps would need a way to disable
>> notifications during such animation sequences, and would be able to find
>> another means to serialize the animation (at a higher level).
> I'm not sure I trust apps to do that, which is why I think the default
> behavior should be that they just don't get the information.
>> This raises the question is unregistering and re-regtistering a mutation
>> notification handler cheap or do we need an alternative mechanism for
>> temporarily suspending notifications?
> Olli is better able than I to answer this for Gecko.

In the current WIP patch for mutation event replacement registering and
unregistering listeners is cheap, and if there are no listeners,
performance isn't affected at all.
This is with the sync approach.

If async approach is taken, listener handling becomes significantly
more complicated. What if the listener is added after the mutation has
happened, should it be called? If not, then we need to keep a list of
changes for all the listeners separately. If yes, then we need to
track all the changes all the time, even if there are no listeners.


Received on Thursday, 21 July 2011 15:20:11 UTC