Synchronous 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 be migrated to Mutation Observer.
Mutation Events have been deprecated for over a decade, with the replacement (Mutation Observer) available also for over a decade. The fact that these events are still supported in browsers makes the addition of new features much more difficult, prohibitively so in some cases. For example, these feature requests and projects are all negatively impacted by the existence of Mutation Events: - iFrame reparenting: https://github.com/whatwg/html/issues/5484 and https://github.com/whatwg/dom/issues/891 - Child reordering: https://github.com/whatwg/dom/issues/586 - DOM Parts and batch DOM updates: https://github.com/WICG/webcomponents/blob/gh-pages/proposals/DOM-Parts.md Given that the feature has been spec-deprecated for a decade, it makes sense to officially deprecate these APIs in Chrome, and work toward removing them.
There are technically 9 Mutation Events, but Chromium only implements 6 of them. Their use counters vary significantly: - DOMNodeInsertedIntoDocument: 0.006% - DOMNodeRemovedFromDocument: 0.012% - DOMCharacterDataModified: 0.016% - DOMNodeRemoved: 0.77% - DOMSubtreeModified: 0.81% - DOMNodeInserted: 1.58% The first three could likely be fairly easily removed after some time. The last three have quite significant usage, and more study and outreach will be required to bring this usage down below safe removal limits, which will take significant time. Tentatively, we're aiming for M126 as the last version of Chrome that supports the events above, ending July 30, 2024.
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
Shipping on desktop | 127 |
Shipping on Android | 127 |
Shipping on WebView | 127 |
Contact emails
mas...@chromium.orgExplainer
NoneSpecification
https://w3c.github.io/uievents/#legacy-event-typesSummary
Synchronous 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 be migrated to Mutation Observer.
Blink component
Blink>DOMMotivation
Mutation Events have been deprecated for over a decade, with the replacement (Mutation Observer) available also for over a decade. The fact that these events are still supported in browsers makes the addition of new features much more difficult, prohibitively so in some cases. For example, these feature requests and projects are all negatively impacted by the existence of Mutation Events: - iFrame reparenting: https://github.com/whatwg/html/issues/5484 and https://github.com/whatwg/dom/issues/891 - Child reordering: https://github.com/whatwg/dom/issues/586 - DOM Parts and batch DOM updates: https://github.com/WICG/webcomponents/blob/gh-pages/proposals/DOM-Parts.md Given that the feature has been spec-deprecated for a decade, it makes sense to officially deprecate these APIs in Chrome, and work toward removing them.
Initial public proposal
NoneSearch tags
MutationEvent, DOMSubtreeModified, DOMNodeInserted, DOMNodeRemoved, DOMNodeRemovedFromDocument, DOMNodeInsertedIntoDocument, DOMCharacterDataModifiedTAG review
NoneTAG review status
Not applicableRisks
Interoperability and Compatibility
There are technically 9 Mutation Events, but Chromium only implements 6 of them. Their use counters vary significantly: - DOMNodeInsertedIntoDocument: 0.006% - DOMNodeRemovedFromDocument: 0.012% - DOMCharacterDataModified: 0.016% - DOMNodeRemoved: 0.77% - DOMSubtreeModified: 0.81% - DOMNodeInserted: 1.58% The first three could likely be fairly easily removed after some time. The last three have quite significant usage, and more study and outreach will be required to bring this usage down below safe removal limits, which will take significant time.
Tentatively, we're aiming for M126 as the last version of Chrome that supports the events above, ending July 30, 2024.
Gecko: No signal (https://github.com/whatwg/dom/issues/305#issuecomment-241686139) Old comments indicate support, but no official position yet.
WebKit: No signal
Web developers: No signals
Other signals: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
Is this feature fully tested by web-platform-tests?
NoFlag name
Requires code in //chrome?
FalseTracking bug
https://crbug.com/1446498Estimated milestones
Shipping on desktop 127
Shipping on Android 127
Shipping on WebView 127 Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5083947249172480Links to previous Intent discussions
This intent message was generated by Chrome Platform Status.
--
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+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDgP1mWEoDABHmKfCXSSFO9ZyQDQ5p7h_TtN51ZnyvxSSg%40mail.gmail.com.
On Thu, May 18, 2023 at 9:29 PM Mason Freed <mas...@chromium.org> wrote:Motivation
Mutation Events have been deprecated for over a decade, with the replacement (Mutation Observer) available also for over a decade. The fact that these events are still supported in browsers makes the addition of new features much more difficult, prohibitively so in some cases. For example, these feature requests and projects are all negatively impacted by the existence of Mutation Events: - iFrame reparenting: https://github.com/whatwg/html/issues/5484 and https://github.com/whatwg/dom/issues/891 - Child reordering: https://github.com/whatwg/dom/issues/586 - DOM Parts and batch DOM updates: https://github.com/WICG/webcomponents/blob/gh-pages/proposals/DOM-Parts.md Given that the feature has been spec-deprecated for a decade, it makes sense to officially deprecate these APIs in Chrome, and work toward removing them.
Was the impact due to the supporting these events in the code or due to the fact that we needed to actually run them?If we'd have to run a long deprecation trial, would that still negatively impact the platform's evolution?
Interoperability and Compatibility
There are technically 9 Mutation Events, but Chromium only implements 6 of them. Their use counters vary significantly: - DOMNodeInsertedIntoDocument: 0.006% - DOMNodeRemovedFromDocument: 0.012% - DOMCharacterDataModified: 0.016% - DOMNodeRemoved: 0.77% - DOMSubtreeModified: 0.81% - DOMNodeInserted: 1.58% The first three could likely be fairly easily removed after some time. The last three have quite significant usage, and more study and outreach will be required to bring this usage down below safe removal limits, which will take significant time.
Turning those use counters into UKM can be interesting.
Tentatively, we're aiming for M126 as the last version of Chrome that supports the events above, ending July 30, 2024.
Are you planning to remove all of them at the same time, despite the order of magnitude difference in usage?
Gecko: No signal (https://github.com/whatwg/dom/issues/305#issuecomment-241686139) Old comments indicate support, but no official position yet.
WebKit: No signalCan we file for positions? A joint effort could help here.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.