Bug 1342927 - Transfer pendingTabChild state when swapping docShells in tabswitcher. r=billm

MozReview-Commit-ID: CY26wdxSIiS

--HG--
extra : rebase_source : c77b011ff2012de5c019187bdc20619382f3617d
This commit is contained in:
Mike Conley 2017-03-04 14:57:00 -05:00
Родитель 4a3c059a83
Коммит f6edcbd052
1 изменённых файлов: 20 добавлений и 3 удалений

Просмотреть файл

@ -4242,9 +4242,18 @@
let otherTabbrowser = otherBrowser.ownerGlobal.gBrowser;
let otherState;
let pendingTabChild = false;
if (otherTabbrowser && otherTabbrowser._switcher) {
let otherTab = otherTabbrowser.getTabForBrowser(otherBrowser);
otherState = otherTabbrowser._switcher.getTabState(otherTab);
let otherSwitcher = otherTabbrowser._switcher;
otherState = otherSwitcher.getTabState(otherTab);
pendingTabChild = otherSwitcher.pendingTabChild.has(otherBrowser);
if (pendingTabChild) {
this.assert(otherState == this.STATE_LOADING);
}
otherSwitcher.pendingTabChild.delete(otherBrowser);
} else {
otherState = (otherBrowser.docShellIsActive
? this.STATE_LOADED
@ -4254,7 +4263,10 @@
if (!this.swapMap) {
this.swapMap = new WeakMap();
}
this.swapMap.set(otherBrowser, otherState);
this.swapMap.set(otherBrowser, {
state: otherState,
pendingTabChild,
});
},
onEndSwapDocShells(ourBrowser, otherBrowser) {
@ -4273,12 +4285,17 @@
}
this.loadingTab = null;
let otherState = this.swapMap.get(otherBrowser);
let { state: otherState, pendingTabChild } =
this.swapMap.get(otherBrowser);
this.swapMap.delete(otherBrowser);
let ourTab = this.tabbrowser.getTabForBrowser(ourBrowser);
if (ourTab) {
this.setTabStateNoAction(ourTab, otherState);
if (pendingTabChild) {
this.pendingTabChild.add(ourTab.linkedBrowser);
}
}
},