mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-28 12:45:27 +00:00
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:
parent
4a3c059a83
commit
f6edcbd052
@ -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);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user