mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 04:38:02 +00:00
Bug 585361 - Handle requests for synchronously removing an already asynchronously closing tab. r=gavin
This commit is contained in:
parent
83666a4b0d
commit
614ec4a44c
@ -1323,10 +1323,19 @@
|
||||
<parameter name="aParams"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var isLastTab = (this.tabs.length - this._removingTabs.length == 1);
|
||||
if (aParams)
|
||||
var animate = aParams.animate;
|
||||
|
||||
// Handle requests for synchronously removing an already
|
||||
// asynchronously closing tab.
|
||||
if (!animate &&
|
||||
this._removingTabs.indexOf(aTab) > -1) {
|
||||
this._endRemoveTab(aTab);
|
||||
return;
|
||||
}
|
||||
|
||||
var isLastTab = (this.tabs.length - this._removingTabs.length == 1);
|
||||
|
||||
if (!this._beginRemoveTab(aTab, false, null, true))
|
||||
return;
|
||||
|
||||
@ -2404,7 +2413,7 @@
|
||||
var tabs = document.getBindingParent(this);
|
||||
tabs.removeAttribute("overflow");
|
||||
|
||||
tabs.tabbrowser._removingTabs.forEach(tabs.tabbrowser._endRemoveTab,
|
||||
tabs.tabbrowser._removingTabs.forEach(tabs.tabbrowser.removeTab,
|
||||
tabs.tabbrowser);
|
||||
|
||||
tabs._positionPinnedTabs();
|
||||
|
@ -5,6 +5,11 @@ function test() {
|
||||
gBrowser.removeTab(tab);
|
||||
is(tab.parentNode, null, "tab removed immediately");
|
||||
|
||||
tab = gBrowser.addTab("about:blank", { skipAnimation: true });
|
||||
gBrowser.removeTab(tab, { animate: true });
|
||||
gBrowser.removeTab(tab);
|
||||
is(tab.parentNode, null, "tab removed immediately when calling removeTab again after the animation was kicked off");
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
Services.prefs.setBoolPref("browser.tabs.animate", true);
|
||||
|
@ -83,10 +83,6 @@ Tester.prototype = {
|
||||
let msg = baseMsg.replace("{elt}", "tab") +
|
||||
": " + lastTab.linkedBrowser.currentURI.spec;
|
||||
this.currentTest.addResult(new testResult(false, msg, "", false));
|
||||
if (gBrowser._removingTabs && gBrowser._removingTabs.indexOf(lastTab) > -1) {
|
||||
gBrowser._endRemoveTab(lastTab);
|
||||
continue;
|
||||
}
|
||||
gBrowser.removeTab(lastTab);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user