-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define mutation events #305
Comments
I'm still hoping we actually try to get rid of mutation events. (FYI, Firefox telemetry compares Window objects, in which a listener for mutation events was added to either Window or to some Node, to those Window objects where such listeners weren't added.) |
See also thread in https://lists.w3.org/Archives/Public/www-dom/2016JulSep/thread.html |
Usage of each event
|
Latest here is https://lists.w3.org/Archives/Public/www-dom/2017JanMar/0004.html. So Blink still wants to change their behavior. |
Once we define these (it seems ever more unlikely we'll be able to remove them), we'll need to make sure to not fire them inside shadow trees. Tracked by https://bugzilla.mozilla.org/show_bug.cgi?id=1489858 for Fx. |
Noting for the record that when/if we fix this, we'd need to update HTML (https://www.w3.org/Bugs/Public/show_bug.cgi?id=23036) and UI Events. UI Events currently has a decent amount of spec text around mutation events. |
Elliot proposed dispatching DOM mutation events on CEReactions timing in 2016. I investigated the feasibility of the proposal. TL;DR: Not feasible for |
It's worth noting that the removal of mutation events has shipped in Chrome 127 thanks to @mfreed7. While there is an enterprise policy that we expect to support for at least 9 months (and there have been a bunch of bugs that ended with telling folks that they need to use the enterprise policy to keep their apps working until those apps can be fixed), the removal seems so far to be sticking. |
Knock on wood! 😄 But yeah, so far the removal is going cautiously well. It only very recently (last 48 hours) reached 100% of stable users, and it sometimes takes a few days for bugs to trickle back to me. I'll try to check back in here after a few more weeks with a more definitive status update. But assuming that's successful, I'd strongly advocate for this issue being closed as "WontFix". There are also a few mentions of mutation events in the spec (e.g. https://html.spec.whatwg.org/#concept-document-fire-mutation-events-flag) that should likely be deleted. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Alright, I think I'm cautiously ready to come back here and announce victory over mutation events. They have been disabled for 99% of Chrome users (for desktop and mobile, and about 10% and rising for webview) since July 23. There have been a few affected folks, but mostly they seem to have been able to migrate off of mutation events fairly easily. (Usage of my polyfill has jumped significantly.) There is still work to do, in that there are many people that requested origin trials, and those folks will need more time to migrate. But I believe the feature can now be removed from the open web. Would folks be receptive to an HTML spec PR removing the ~17 mentions of "mutation events" at this point? And closing this bug? |
The html spec only mentioned mutation events a handful of times, but now that they [have been removed from some browsers](whatwg/dom#305 (comment)) it feels safe to remove these mentions from the spec.
whatwg/html#10573 in case the answer is "yes". |
With web-platform-tests/wpt@e0c3477 landed and |
I have a couple of concerns given the existence of the "reverse origin trial":
I don't really have a good idea of how to handle this, but I'm going to reopen this for now to keep track of this. |
This is a very good point. There are some sites using the origin trial, though not a ton. But I agree it might be the best to simply wait for the end of the OT before turning off mutation events in other browsers, to be safe. I've been very actively trying to manage the usage of mutation events coming up to this removal, and I'll continue to do that afterwards for the origin trial registrants. E.g. I'll be sending reminder emails to all registrants that the OT is coming to a close, and warning that we won't be extending it for anything other than very dire circumstances. But you're right that there's a chance we need to extend the deadline. Perhaps for now, the answer is "do nothing", and I'll check back in here toward the first quarter of Q1 with an update? |
Mutation events are not defined in detail anywhere (see whatwg/dom#305), but the standard mentioned them a few times to explain how HTML features should interact with them. As there has been some success in removing them from some browsers (see whatwg/dom#305 (comment)), we can now remove them, aligning HTML and DOM on no longer acknowledging their existence.
I merged the HTML PR, but reopening per the latest comment. It also occurred to me that we should remove https://w3c.github.io/uievents/#legacy-mutationevent-events and other mentions of MutationEvent in that spec. @mfreed7 up for that too? |
Please see this WHATWG/dom issue for more details: whatwg/dom#305 (comment) Mutation events have now been disabled for most all users of the Chrome browser. While there are still a few sites opted back in to the events via origin trial tokens, those are time limited and we've committed to end-date them as soon as possible. However, it feels appropriate to remove the definition of these deprecated events from the standard at this point.
Thanks!
|
Please see this WHATWG/dom issue for more details: whatwg/dom#305 (comment) Mutation events have now been disabled for most all users of the Chrome browser. While there are still a few sites opted back in to the events via origin trial tokens, those are time limited and we've committed to end-date them as soon as possible. However, it feels appropriate to remove the definition of these deprecated events from the standard at this point.
Mutation events are not defined in detail anywhere (see whatwg/dom#305), but the standard mentioned them a few times to explain how HTML features should interact with them. As there has been some success in removing them from some browsers (see whatwg/dom#305 (comment)), we can now remove them, aligning HTML and DOM on no longer acknowledging their existence.
Telemetry from Firefox release builds: 39 0.4% of window/node objects had seen mutation event listener somewhere in them, 47 0.22%.
Chrome:
Chrome probably inherits non-support for DOMAttrModified from WebKit: https://bugs.webkit.org/show_bug.cgi?id=8191 (WONTFIX, \o/).
A couple of the Chrome numbers are below the Blink threshold of 0.03%.
@esprehn has mentioned he wanted to change how these events are dispatched in Chrome to offset some of their negative side effects. Is this happening?
According to https://msdn.microsoft.com/en-us/library/dn265032.aspx Internet Explorer does not support *IntoDocument and *FromDocument, but does support DOMAttrModified.
It seems like DOM Standard needs to define
at a minimum. "Asynchronous timing" would be great, but we should only specify that if Chrome manages to ship it.
The text was updated successfully, but these errors were encountered: