Ctrl+Tab previews go blank and shrink to a sliver when a tab closes while the panel is open
Categories
(Firefox :: Tabbed Browser, defect, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox157 | --- | fixed |
People
(Reporter: dao, Assigned: dao)
References
(Blocks 1 open bug)
Details
Attachments
(2 external files)
Steps: with six or more tabs open, hold Ctrl and press Tab to bring up the Ctrl+Tab panel, then press Ctrl+W while it is still open.
Result: every other preview loses its thumbnail. A preview with no thumbnail also collapses, because nothing gives .ctrlTab-preview-inner a width except the thumbnail: measured on a live panel, the card goes from 186x165 to 27x165 and its label wraps from 20px to 133px tall, so it reads as a thin, tall sliver.
Cause: tabPreviews.get resolves with a cached DOM node -- __thumbnail holds the <canvas> or <img> element itself -- while updatePreview captures canvas.firstChild before awaiting and then calls canvas.replaceChild(img, existingPreview). When the tab list shifts under an open panel (removeClosingTabFromUI -> updatePreviews), preview i takes the tab that preview i+1 was showing, so inserting that tab's cached node moves it out of preview i+1. Preview i+1's own replaceChild then throws "NotFoundError: Node.replaceChild: Child to be replaced is not a child of this node", which the .catch(console.error) swallows, and its canvas is left empty.
Lazy and discarded tabs make it stick: tabPreviews.get resolves null for them, so their preview never refills after being robbed, and a preview that resolves null keeps whatever it was left holding -- including another tab's thumbnail.
| Assignee | ||
Comment 1•2 months ago
|
||
Putting the placeholder back also takes every cached thumbnail out of the DOM before any pending update inserts one, so a cached node can no longer be moved out of the preview that is still showing it.
Updated•2 months ago
|
| Assignee | ||
Comment 2•2 months ago
|
||
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Comment 4•2 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/6e2279ad3ea9
https://hg.mozilla.org/mozilla-central/rev/0f2838ec7335
Updated•1 month ago
|
Description
•