web-platform-tests / interop

web-platform-tests Interop project
https://wpt.fyi/interop
303 stars 28 forks source link

Remove support for Mutation Events #784

Open mfreed7 opened 1 week ago

mfreed7 commented 1 week ago

Description

This proposal is to remove support for Mutation Events.

Mutation Events, including DOMSubtreeModified, DOMNodeInserted, DOMNodeRemoved, DOMNodeRemovedFromDocument, DOMNodeInsertedIntoDocument, and DOMCharacterDataModified, are quite bad for page performance, and also significantly increase the complexity of adding new features to the Web. These APIs were deprecated from the spec ( Spec: UI Events ) in 2011, and were replaced (in 2012) by the much better-behaved Mutation Observer API.

Please see this blog post (about Chrome’s work to remove support) for more detail: https://developer.chrome.com/blog/mutation-events-deprecation

These events have been completely removed from the standards as of August, 2024. Chrome has disabled all of these events for all users, starting in M127 (July, 2024), and has encountered only a few bug reports. Chrome does have an Origin Trial and Enterprise Policy that will allow sites/organizations to opt themselves back in to the events, but those are scheduled to be end-dated in M135 (April 2025).

Specification

This was never a specified feature. There are peripheral mentions, such as the fire mutation events flag, but those don’t actually describe how the feature works. Indeed, see the polyfill documentation for some behavioral differences between browsers.

Additional Signals

Standards Positions

Tests

dandclark commented 4 days ago

The dom/historical.html test could be used, although we'd probably need to split the mutation events subtests out into another file since there are other unrelated failures: