diff --git a/browser/base/content/tabview/groupitems.js b/browser/base/content/tabview/groupitems.js index 664d48eb445..5f2fd8d858a 100644 --- a/browser/base/content/tabview/groupitems.js +++ b/browser/base/content/tabview/groupitems.js @@ -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}); }, // ----------- diff --git a/browser/base/content/test/tabview/Makefile.in b/browser/base/content/test/tabview/Makefile.in index de7335c91ad..76b6ec7cbe3 100644 --- a/browser/base/content/test/tabview/Makefile.in +++ b/browser/base/content/test/tabview/Makefile.in @@ -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 \ diff --git a/browser/base/content/test/tabview/browser_tabview_bug665502.js b/browser/base/content/test/tabview/browser_tabview_bug665502.js new file mode 100644 index 00000000000..bf986dd1c7b --- /dev/null +++ b/browser/base/content/test/tabview/browser_tabview_bug665502.js @@ -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); +}