Closed Bug 2070184 Opened 2 months ago Closed 2 months ago

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)

defect

Tracking

()

RESOLVED FIXED
157 Branch
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.

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.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
Severity: -- → S3
Priority: -- → P1
Attachment #9639169 - Attachment description: Bug 2070184 - Reset a Ctrl+Tab preview's thumbnail when its tab changes. r?#tabbrowser-reviewers! → Bug 2070184 - Reset a Ctrl+Tab preview's thumbnail when its tab changes. r?#tabbrowser-reviewers
Attachment #9639170 - Attachment description: Bug 2070184 - Stop waiting a second for a Ctrl+Tab thumbnail that failed to load. r?#tabbrowser-reviewers! → Bug 2070184 - Stop waiting a second for a Ctrl+Tab thumbnail that failed to load. r?#tabbrowser-reviewers
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/3344f250390f https://hg.mozilla.org/integration/autoland/rev/6e2279ad3ea9 Reset a Ctrl+Tab preview's thumbnail when its tab changes. r=tabbrowser-reviewers,niklas https://github.com/mozilla-firefox/firefox/commit/aa9c1ba8f0ee https://hg.mozilla.org/integration/autoland/rev/0f2838ec7335 Stop waiting a second for a Ctrl+Tab thumbnail that failed to load. r=tabbrowser-reviewers,niklas
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 157 Branch
QA Whiteboard: [qa-triage-done-c158/b157][qa-ver-needed-c158/b157]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: