Bug 639843 - Port Bug 628270 [Undo close (hidden) tab causes panorama and session restore to break unrecoverably]. r=Neil
This commit is contained in:
Родитель
93c05eaf88
Коммит
f1f1daf0d9
|
@ -2300,7 +2300,21 @@ SessionStoreService.prototype = {
|
|||
}
|
||||
}
|
||||
|
||||
if (aTabs.length > 0) {
|
||||
if (!this._isWindowLoaded(aWindow)) {
|
||||
// from now on, the data will come from the actual window
|
||||
delete this._statesToRestore[aWindow.__SS_restoreID];
|
||||
delete aWindow.__SS_restoreID;
|
||||
delete this._windows[aWindow.__SSi]._restoring;
|
||||
}
|
||||
|
||||
if (aTabs.length == 0) {
|
||||
// this is normally done in restoreHistory() but as we're returning early
|
||||
// here we need to take care of it.
|
||||
this._sendWindowStateEvent(aWindow, "Ready");
|
||||
return;
|
||||
}
|
||||
|
||||
if (aTabs.length > 1) {
|
||||
// Load hidden tabs last, by pushing them to the end of the list
|
||||
let unhiddenTabs = aTabs.length;
|
||||
for (let t = 0; t < unhiddenTabs; ) {
|
||||
|
@ -2333,13 +2347,13 @@ SessionStoreService.prototype = {
|
|||
aTabData = aTabData.splice(firstVisibleTab, maxVisibleTabs).concat(aTabData);
|
||||
aSelectTab -= firstVisibleTab;
|
||||
}
|
||||
}
|
||||
|
||||
// make sure to restore the selected tab first (if any)
|
||||
if (aSelectTab-- && aTabs[aSelectTab]) {
|
||||
aTabs.unshift(aTabs.splice(aSelectTab, 1)[0]);
|
||||
aTabData.unshift(aTabData.splice(aSelectTab, 1)[0]);
|
||||
tabbrowser.selectedTab = aTabs[0];
|
||||
}
|
||||
// make sure to restore the selected tab first (if any)
|
||||
if (aSelectTab-- && aTabs[aSelectTab]) {
|
||||
aTabs.unshift(aTabs.splice(aSelectTab, 1)[0]);
|
||||
aTabData.unshift(aTabData.splice(aSelectTab, 1)[0]);
|
||||
tabbrowser.selectedTab = aTabs[0];
|
||||
}
|
||||
|
||||
// Prepare the tabs so that they can be properly restored. We'll pin/unpin
|
||||
|
@ -2391,13 +2405,6 @@ SessionStoreService.prototype = {
|
|||
}
|
||||
}
|
||||
|
||||
if (!this._isWindowLoaded(aWindow)) {
|
||||
// from now on, the data will come from the actual window
|
||||
delete this._statesToRestore[aWindow.__SS_restoreID];
|
||||
delete aWindow.__SS_restoreID;
|
||||
delete this._windows[aWindow.__SSi]._restoring;
|
||||
}
|
||||
|
||||
// helper hashes for ensuring unique frame IDs and unique document
|
||||
// identifiers.
|
||||
var idMap = { used: {} };
|
||||
|
|
Загрузка…
Ссылка в новой задаче