The default bug view has changed. See this FAQ.

setTabState() always unhides the tab

RESOLVED FIXED in Firefox 14

Status

()

Firefox
Session Restore
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: ttaubert, Assigned: ttaubert)

Tracking

(Blocks: 1 bug)

Trunk
Firefox 14
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
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.
(Assignee)

Comment 1

6 years ago
Created attachment 573511 [details] [diff] [review]
patch v1

This patch moves the code that unhides the first tab (to have at least one shown tab) to restoreWindow().
Attachment #573511 - Flags: review?(paul)
(Assignee)

Updated

5 years ago
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+
(Assignee)

Comment 3

5 years ago
Created attachment 580303 [details] [diff] [review]
patch v2 (with test)

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?
(Assignee)

Comment 5

5 years ago
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 :)
(Assignee)

Comment 6

5 years ago
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+
(Assignee)

Comment 7

5 years ago
https://hg.mozilla.org/integration/fx-team/rev/9f166123a74f
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 14
(Assignee)

Comment 8

5 years ago
https://hg.mozilla.org/mozilla-central/rev/9f166123a74f
Status: ASSIGNED → RESOLVED
Last Resolved: 5 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.