W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2011

Re: Replacement for mutation events

From: Olli Pettay <Olli.Pettay@helsinki.fi>
Date: Wed, 02 Feb 2011 13:13:18 +0200
Message-ID: <4D493C4E.1080600@helsinki.fi>
To: "www-dom@w3.org" <www-dom@w3.org>
CC: Jacob Rossi <jrossi@microsoft.com>, "schepers@w3.org" <schepers@w3.org>, "jeresig@gmail.com" <jeresig@gmail.com>, Jonas Sicking <jonas@sicking.cc>
On 02/02/2011 01:01 PM, Olli Pettay wrote:
> Hi all,
>
> I'm hoping we could prototype Jonas' proposal in Gecko
> pretty soon (using moz prefix of course!). It should be very easy to
> implement. The method names in the proposal could need still some tweaking.
> Maybe there could be just two methods
> addMutationObserver(SOME_CONSTANT, callback_function)
> removeMutationObserver(SOME_CONSTANT, callback_function)
>
>
> I'm worried about the performance of selector based
> proposals. You would need to run selector (after timeout)
> whenever something in DOM tree changes, but also whenever some
> state changes (hover, focus, etc). That would mean *lots* of
> calls to querySelectorAll.
Or in other words, handling states at least makes it more difficult to
optimize out some querySelectorAll calls.



> Also, the selector based proposals need a separate method for
> changes in characterdata, like watchCharacterData.
> That just feels a bit hacky to me.
Oh, I forgot the problem with attribute value changes.
That is something a11y explicitly wanted to be able to handle,
and selector based filtering makes it rather awkward.



I do like the filtering feature of selector based proposal, but
because of the limitations of such approach we should probably
do something lower level, like Jonas' proposal.
One could even rather easily implement selector based filtering
on top of that kind of lower level API.








>
> -Olli
>
>
>
> On 02/02/2011 10:29 AM, Jacob Rossi wrote:
>> Hi folks,
>>
>> As we’ve discussed before, there’s a desire to move forward on spec’ing
>> replacements for DOM mutation events. On the Web Apps wiki, there are
>> two existing proposals (one from Microsoft, another from Mozilla) [1].
>> Also, John Resig’s NodeList proposal has potential for solving some of
>> the issues with the existing deprecated events [2].
>>
>> Since the current DOM mutation events are deprecated and there’s been a
>> request from PFWG and others to see a replacement, I’d like to know what
>> the plan is to move forward on this issue. Ideally, I think this will be
>> work done in a separate spec and likely with separate conferences if
>> needed.
>>
>> Thanks,
>>
>> Jacob
>>
>> [1] http://www.w3.org/2008/webapps/wiki/MutationReplacement
>>
>> [2] http://www.nodelist.org/
>>
>
>
>
Received on Wednesday, 2 February 2011 11:13:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:07 GMT