All the MutationObserver stuff in TextInputWidget, which calls #adjustSize for autosized inputs after they're inserted into the document, is slow. There is some overhead for creating the MutationObserver, it (probably) slows down DOM operations a little bit, the handler for it is executed with some delay, and when building an interface with many TextInputWidgets, each of them runs separately and causes a separate reflow when #adjustSize is called. We really should find a way to do this less often, or not at all.
Description
Description
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Duplicate | None | T71799 Editing a transclusion with many templates hangs the browser | |||
| Open | None | T134814 Multi-part transclusion dialog a little slow to load | |||
| Resolved | matthiasmullie | T135085 Increase the limit of 50 uploads at once (maxUploads) | |||
| Resolved | MarkTraceur | T153210 Make upload interface changes a little snappier | |||
| Resolved | matmarex | T154024 Kill slow MutationObserver stuff in TextInputWidget | |||
| Declined | None | T176998 Try using SentinelJS (or stealing code from it) instead of nasty code in TextInputWidget#installParentChangeDetector |
Event Timeline
Comment Actions
Another issue is that onAttach isn't necessarily the correct time to auto-size the widget, for example if a widget is attached to a still-animating dialog (cf T200834).
Comment Actions
I rewrote the code using Custom Elements in https://gerrit.wikimedia.org/r/c/oojs/ui/+/917977 / https://gerrit.wikimedia.org/r/c/oojs/ui/+/989586.