Bug 585785 - Skip the tab closing animation if the tab has the minimal width due to the opening animation not having moved yet. r=gavin a=b

This commit is contained in:
Dão Gottwald 2010-10-22 08:29:17 +02:00
parent 4258453d03
commit b00a9b4134
3 changed files with 14 additions and 11 deletions

View File

@ -1366,19 +1366,12 @@
if (!this._beginRemoveTab(aTab, false, null, true))
return;
/* Don't animate if:
- the caller didn't opt in
- this is the last tab in the window
- this is a pinned tab
- a bunch of other tabs are already closing (arbitrary threshold)
- the fadein attribute hasn't been set yet
- browser.tabs.animate is false */
if (!animate ||
if (!animate /* the caller didn't opt in */ ||
isLastTab ||
aTab.pinned ||
this._removingTabs.length > 3 ||
aTab.getAttribute("fadein") != "true" ||
this._removingTabs.length > 3 /* don't want lots of concurrent animations */ ||
aTab.getAttribute("fadein") != "true" /* fade-in transition hasn't been triggered yet */ ||
window.getComputedStyle(aTab).maxWidth == "1px" /* fade-in transition hasn't moved yet */ ||
!Services.prefs.getBoolPref("browser.tabs.animate")) {
this._endRemoveTab(aTab);
return;

View File

@ -151,6 +151,7 @@ _BROWSER_FILES = \
browser_bug581242.js \
browser_bug581253.js \
browser_bug581947.js \
browser_bug585785.js \
browser_bug585830.js \
browser_bug592338.js \
browser_bug594131.js \

View File

@ -0,0 +1,9 @@
function test() {
waitForExplicitFinish();
var tab = gBrowser.addTab();
executeSoon(function () {
gBrowser.removeTab(tab, {animate:true});
ok(!tab.parentNode, "tab successfully removed");
finish();
});
}