Closed Bug 701377 Opened 13 years ago Closed 13 years ago

setTabState() always unhides the tab

Categories

(Firefox :: Session Restore, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 14

People

(Reporter: ttaubert, Assigned: ttaubert)

References

Details

Attachments

(1 file, 1 obsolete file)

When I have a hidden blank tab (in another group for example) and call ss.setTabState(blankTab) I expect it not to be restored but be ready for restoration when the corresponding group gets shown again. That's because of setTabState() calls: > this.restoreHistoryPrecursor(window, [aTab], [tabState], 0, 0, 0); And restoreHistoryPrecursor contains these lines: > let unhiddenTabs = aTabData.filter(function (aData) !aData.hidden).length; > > // if all tabs to be restored are hidden, make the first one visible > if (unhiddenTabs == 0) { > aTabData[0].hidden = false; > } else if (aTabs.length > 1) { > ... > } This results in very strange results (especially in combination with Panorama) as the tab gets shown, loads and is hidden again.
Attached patch patch v1 (obsolete) (deleted) — Splinter Review
This patch moves the code that unhides the first tab (to have at least one shown tab) to restoreWindow().
Attachment #573511 - Flags: review?(paul)
Blocks: 675539
Comment on attachment 573511 [details] [diff] [review] patch v1 Review of attachment 573511 [details] [diff] [review]: ----------------------------------------------------------------- Seems fine by me, just add a test before landing. Thanks Tim!
Attachment #573511 - Flags: review?(paul) → review+
Attached patch patch v2 (with test) (deleted) — Splinter Review
Added a sessionstore test. Alas, there are intermittent try failures which need to be investigated: browser_tabview_bug627288.js times out because the tab passed to ss.restoreTab() seems to be removed from its window. I think there's some issue with setTimeout() and the tab being removed in the meantime...
Attachment #573511 - Attachment is obsolete: true
I know you're a busy man Tim, but any update on those oranges?
It's been in my todo list for weeks and I've always wanted to look at this again. Hope I can find the time soon. Don't hesitate to steal this in the meantime if anyone feels like it :)
Comment on attachment 580303 [details] [diff] [review] patch v2 (with test) So I pushed it to try again and had one strange intermittent error that didn't seem to recur: https://tbpl.mozilla.org/?tree=Try&rev=ad05cc963b54 A second try push with some debug output didn't show it, too: https://tbpl.mozilla.org/?tree=Try&rev=8ebc88495609
Attachment #580303 - Flags: review?(paul)
Attachment #580303 - Flags: review?(paul) → review+
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 14
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: