Contact emailsmas...@chromium.org

ExplainerNone

Specificationhttps://w3c.github.io/uievents/#legacy-event-types

Summary

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 (
https://w3c.github.io/uievents/#legacy-event-types) in 2011, and were
replaced (in 2012) by the much better-behaved Mutation Observer API. Usage
of the obsolete Mutation Events must now be migrated to Mutation Observer.
Mutation event support will be disabled by default starting in Chrome 127,
around July 30, 2024. Code should be migrated before that date to avoid
site breakage. If more time is needed, there are a few options: - The
Mutation Events Deprecation Trial (
https://developer.chrome.com/origintrials/#/view_trial/919297273937002497)
can be used to re-enable the feature for a limited time on a given site.
This can be used through Chrome 134, ending March 25, 2025. - A
MutationEventsEnabled enterprise policy (
https://chromeenterprise.google/policies/#MutationEventsEnabled) can also
be used for the same purpose, also through Chrome 134. Please see this blog
post for more detail:
https://developer.chrome.com/blog/mutation-events-deprecation Report bugs
here: https://issues.chromium.org/new?component=1456718&template=1948649


Blink componentBlink>DOM
<https://bugs.chromium.org/p/chromium/issues/list?q=component:Blink%3EDOM>

Search tagsMutationEvent
<https://chromestatus.com/features#tags:MutationEvent>, DOMSubtreeModified
<https://chromestatus.com/features#tags:DOMSubtreeModified>, DOMNodeInserted
<https://chromestatus.com/features#tags:DOMNodeInserted>, DOMNodeRemoved
<https://chromestatus.com/features#tags:DOMNodeRemoved>,
DOMNodeRemovedFromDocument
<https://chromestatus.com/features#tags:DOMNodeRemovedFromDocument>,
DOMNodeInsertedIntoDocument
<https://chromestatus.com/features#tags:DOMNodeInsertedIntoDocument>,
DOMCharacterDataModified
<https://chromestatus.com/features#tags:DOMCharacterDataModified>

TAG reviewNone

TAG review statusNot applicable

Chromium Trial NameMutationEvents

Origin Trial documentation link
https://developer.chrome.com/blog/mutation-events-deprecation

WebFeature UseCounter namekDOMNodeRemovedEvent

Risks


Interoperability and Compatibility

There are technically 9 Mutation Events, but Chromium only implements 6 of
them. Their use counters vary significantly: - DOMNodeInsertedIntoDocument:
0.008% - DOMNodeRemovedFromDocument: 0.009% - DOMCharacterDataModified:
0.011% - DOMNodeRemoved: 0.73% - DOMSubtreeModified: 0.68% -
DOMNodeInserted: 1.086% Chrome has shipped an experiment since M124 that
disables all Mutation Events for 99% of users of Canary, Dev, and Beta
versions of Chrome. Very few bugs have been filed in the intervening
months, and all that were filed have been resolved quickly via the site
owner making changes to not rely on the deprecated events. This gives me
significant confidence that removing the events will not be as big of a
deal as the use counters would suggest. Still, due to the still-high
numbers, extreme care will be taken in the removal process. I plan to
disable the events via Finch only, so that if issues are encountered, Finch
will be a safe way to re-enable the events. Additionally, there are the
deprecation trial and enterprise policies to offer an easy relief valve for
affected sites.


*Gecko*: Positive (https://github.com/mozilla/standards-positions/issues/807)
"very strong positive position"

*WebKit*: No signal (
https://github.com/WebKit/standards-positions/issues/192)

*Web developers*: No signals

*Other signals*:

Activation

This npm package attempts to polyfill Mutation Events using Mutation
Observer: https://www.npmjs.com/package/mutation-events.


WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that
it has potentially high risk for Android WebView-based applications?

None


Debuggability



Will this feature be supported on all six Blink platforms (Windows, Mac,
Linux, ChromeOS, Android, and Android WebView)?Yes

Is this feature fully tested by web-platform-tests
<https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md>
?No

Flag name on chrome://flagsmutation-events

Finch feature nameMutationEvents

Requires code in //chrome?False

Tracking bughttps://crbug.com/1446498

Estimated milestones
Shipping on desktop 127
Origin trial desktop first 124
Origin trial desktop last 134
Shipping on Android 127
OriginTrial Android last 134
OriginTrial Android first 124
Shipping on WebView 127
OriginTrial webView last 134
OriginTrial webView first 124

Anticipated spec changes

Open questions about a feature may be a source of future web compat or
interop issues. Please list open issues (e.g. links to known github issues
in the project for the feature specification) whose resolution may
introduce web compat/interop risk (e.g., changing to naming or structure of
the API in a non-backward-compatible way).
None

Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5083947249172480?gate=5111010140094464

Links to previous Intent discussionsIntent to Deprecate:
https://groups.google.com/a/chromium.org/g/blink-dev/c/qDsKRU-cQ_4/m/isA1mZ_aAAAJ
Intent to Experiment:
https://groups.google.com/a/chromium.org/g/blink-dev/c/z-VIfSOco4k/m/KDz9c_goAAAJ

This intent message was generated by Chrome Platform Status
<https://chromestatus.com/>.

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to blink-dev+unsubscr...@chromium.org.
To view this discussion on the web visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDjonGju3YX1WkXtEJrMGLo4bH9AqtwV0QoqvopdGNioAg%40mail.gmail.com.

Reply via email to