List of steps to reproduce:
- Open any wiki where you have notifications, preferrably bundled ones, like in this pic: DiscussionTools' topic subscriptions, for instance: (In my case, bundled items were ones to have overlay menus, but actually all items create a .mw-echo-ui-actionMenuPopupWidget-menu element, even if empty.) Bundled notifications may also come from
- Click the "Notices" notification badge once
- Open DevTools, search for the second .mw-echo-ui-NotificationBadgeWidget-overlay-menu element. Click on it to select it.
- Type $0.childElementCount in the console, execute.
- Close and open the "Notices" popup several times. Say, three.
What happens?:
- $0.childElementCount returns a four times bigger number. This means the previous menus were not cleaned up.
What should have happened instead?:
- $0.childElementCount should not change (unless the notification count has changed). In order to achieve that, these menus should be removed from the DOM on notification popup (or other relevant widget) teardown.
This bug has a potential of cluttering the DOM at great speed, especially given the features such as the new DiscussionTools' Topic subscriptions. (It's also how I found this bug, being surprised by hundreds of child elements with unreachable menus.)