Anne van Kesteren

A new low-level DOM mutation notification API

Currently the DOM has mutation events, which are not really liked by anyone, but are important for applications to track changes to a document. In particular editing applications make great use of them. The problem is their complexity. E.g. while node.removeChild(…) is invoked a DOMNodeRemoved event needs to be dispatched before the mutation takes place. The event handler for that event could itself remove the node being removed, change its location, or do anything it wants really. This sucks.

Although way late in the game given that mutation events have existed for about a decade, we are going to attempt to get rid of them. Olli Pettay posted a revised mutation events replacement proposal to the WebApps WG yesterday. Once we settle on the details it will get implemented experimentally, make its way into DOM Core, and people will be encouraged to transition to this API. Warnings for traditional mutation events will start to appear in developer consoles.

Then a little later an attempt will be made to remove mutation events from the platform entirely. So now would be a good time to see if the new API meets your needs and give us feedback!