DOMLinkRemoved event never fires to the document for removed link elements
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox121 | --- | fixed |
People
(Reporter: mossop, Assigned: mossop)
Details
Attachments
(1 file)
When removing a link element from the DOM we attempt to fire a DOMLinkRemoved
event but because the event is dispatched asynchronously by the time the event is actually dispatched the element is no longer in the DOM and so any listeners attached to the document do not see the event. Maybe listeners attached to the element itself do? This is unlikely to be what was intended though.
However we also never appear to listen to this event anywhere so we should probably just consider removing it. Presumably we used to use it to track removed favicons, I guess I'm a little surprised that we still don't.
Updated•1 year ago
|
Assignee | ||
Comment 1•1 year ago
|
||
Marco, does it make sense that we don't remove the tab icon if its <link>
element is removed from the document? If so we can just remove the DOMLinkRemoved
events entirely.
Comment 2•1 year ago
|
||
My expectation is that a web site rarely intends to "remove" an icon persistently and change to a no-icon state.
Though, I suspect it may do something like:
- have default icons
- add a state icon (unread content, notifications...)
- remove the state icon to revert to the default icons
I guess they may do this by adding/removing links dynamically, rather than changing the href of an existing link or keep adding links.
We apparently only listen to DOMLinkAdded and DOMLinkChanged and I don't remember bugs complaining about us not handling DOMLinkRemoved.
Thus it's probably ok to remove it from our point of view, but I'd suggest to first check how other browsers handle this case, to avoid WebCompat issues.
Assignee | ||
Comment 4•1 year ago
|
||
Looks like Chrome doesn't change the tab icon when removing the current icon's link element from the DOM so we probably shouldn't either.
Assignee | ||
Comment 5•1 year ago
|
||
The event isn't dispatched correctly for DOM manipulations anymore. It is
dispatched when swapping docshells but we don't actually use this event anywhere
except tests so we might as well just remove it entirely.
Comment 7•1 year ago
|
||
bugherder |
Description
•