Bug 665502 - tabItems are resized when closing the active tab in a group; r=dietrich

This commit is contained in:
Tim Taubert 2011-06-20 18:34:55 +02:00
parent 457d121d41
commit 5652e30d81
3 changed files with 37 additions and 1 deletions

View File

@ -300,7 +300,9 @@ GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
"tab must be null (if no children) or a TabItem");
this._activeTab = tab;
this.arrange({immediately: true});
if (this.isStacked())
this.arrange({immediately: true});
},
// -----------

View File

@ -150,6 +150,7 @@ _BROWSER_FILES = \
browser_tabview_bug656778.js \
browser_tabview_bug656913.js \
browser_tabview_bug662266.js \
browser_tabview_bug665502.js \
browser_tabview_dragdrop.js \
browser_tabview_exit_button.js \
browser_tabview_expander.js \

View File

@ -0,0 +1,33 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
function test() {
waitForExplicitFinish();
let onLoad = function (win) {
for (let i = 0; i < 2; i++)
win.gBrowser.addTab();
};
let onShow = function (win) {
registerCleanupFunction(function () win.close());
let cw = win.TabView.getContentWindow();
let groupItem = cw.GroupItems.groupItems[0];
groupItem.setSize(400, 200, true);
let tabItem = groupItem.getChild(0);
let bounds = tabItem.getBounds();
is(groupItem.getActiveTab(), tabItem, "the first tab is active");
tabItem.close();
is(groupItem.getChildren().indexOf(tabItem), -1, "tabItem got removed");
ok(bounds.equals(groupItem.getChild(0).getBounds()), "tabItem bounds didn't change");
finish();
};
newWindowWithTabView(onShow, onLoad);
}