[webkit-dev] Unprefixing DOM MutationObservers, and looking for help from port maintainers

Adam Klein adamk at chromium.org
Fri Jun 8 14:16:24 PDT 2012


Hi webkit-dev,

DOM MutationObservers (see meta bug
https://bugs.webkit.org/show_bug.cgi?id=68729) have been shipping as
WebKitMutationObserver in Chromium since earlier this year. The
feature is fully specced as part of DOM4
(http://www.w3.org/TR/domcore/#mutation-observers) and is implemented
in Firefox. Mozilla has also recently unprefixed their version of the
API (https://bugzilla.mozilla.org/show_bug.cgi?id=749920), and I'd
like to do the same (https://bugs.webkit.org/show_bug.cgi?id=85161).

The tricky part is that while the Chromium version is complete and
compatible with Firefox, there's one piece missing from all other
ports (https://bugs.webkit.org/show_bug.cgi?id=78290). The short
version is that each port needs to be able to run some code
(delivering mutations) at the end of every task (see
http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#processing-model-2,
step 4 "Perform a microtask checkpoint"). Without this code, mutations
due to user input are not delivered in a timely fashion.

It's easy for Chromium to do this because we have our own MessageLoop
abstraction wrapping the native event loops on various platforms, so
our definition of end-of-task is easy to define. But implementing this
properly is likely to be slightly different for every port.

In the short term, my plan is to add the unprefixed version (in
addition to the prefixed) of MutationObserver when PLATFORM(CHROMIUM)
is enabled. But I'd like to help other ports implement this
appropriately, and provide the unprefixed version there too. Please
let me know how I can be of assistance.

Let me know if you have questions or concerns,
Adam Klein


More information about the webkit-dev mailing list