Why is the DOMSubtreeModified event deprecated in DOM level 3?

huyz picture huyz · Jul 12, 2011 · Viewed 51.9k times · Source

Why is the DOMSubtreeModified event deprecated and what are we supposed to use instead?

Answer

Domenic picture Domenic · Jul 12, 2011

If you scroll down a bit, you see:

Warning! The MutationEvent interface was introduced in DOM Level 2 Events, but has not yet been completely and interoperably implemented across user agents. In addition, there have been critiques that the interface, as designed, introduces a performance and implementation challenge. A new specification is under development with the aim of addressing the use cases that mutation events solves, but in more performant manner. Thus, this specification describes mutation events for reference and completeness of legacy behavior, but deprecates the use of both the MutationEvent interface and the MutationNameEvent interface.

The replacement API is mutation observers, which are fully specified in the DOM Living Standard that supercedes all of the DOM level X silliness.