зеркало из https://github.com/mozilla/pjs.git
Bug 685456 - Don't freeze tabItem size when the tab wasn't closed by a mouse click; r=dietrich
This commit is contained in:
Родитель
021b726b4b
Коммит
9bb319a198
|
@ -1086,7 +1086,8 @@ GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
|
|||
// tabItem - The tabItem that is closed.
|
||||
_onChildClose: function GroupItem__onChildClose(tabItem) {
|
||||
let count = this._children.length;
|
||||
let dontArrange = this.expanded || !this.shouldStack(count);
|
||||
let dontArrange = tabItem.closedManually &&
|
||||
(this.expanded || !this.shouldStack(count));
|
||||
let dontClose = !tabItem.closedManually && gBrowser._numPinnedTabs > 0;
|
||||
this.remove(tabItem, {dontArrange: dontArrange, dontClose: dontClose});
|
||||
|
||||
|
|
|
@ -18,12 +18,16 @@ function test() {
|
|||
finish();
|
||||
}
|
||||
|
||||
let closeTabItemManually = function (tabItem) {
|
||||
EventUtils.synthesizeMouseAtCenter(tabItem.container, {button: 1}, cw);
|
||||
}
|
||||
|
||||
let prepareTest = function (testName) {
|
||||
let originalBounds = groupItem.getChild(0).getBounds();
|
||||
|
||||
let tabItem = groupItem.getChild(1);
|
||||
let bounds = tabItem.getBounds();
|
||||
tabItem.close();
|
||||
closeTabItemManually(tabItem);
|
||||
|
||||
ok(originalBounds.equals(groupItem.getChild(0).getBounds()), testName + ': tabs did not change their size');
|
||||
ok(bounds.equals(groupItem.getChild(1).getBounds()), testName + ': third tab is now on second tab\'s previous position');
|
||||
|
@ -180,7 +184,7 @@ function test() {
|
|||
let bounds = tabItem.getBounds();
|
||||
|
||||
while (groupItem.getChildren().length > 2)
|
||||
groupItem.getChild(1).close();
|
||||
closeTabItemManually(groupItem.getChild(1));
|
||||
|
||||
ok(originalBounds.equals(groupItem.getChild(0).getBounds()), 'testExpandedMode: tabs did not change their size');
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ function test() {
|
|||
// remove two tabs and see if the remaining tabs are re-arranged to fill
|
||||
// the resulting gaps
|
||||
for (let i = 0; i < 2; i++) {
|
||||
children[1].close();
|
||||
EventUtils.synthesizeMouseAtCenter(children[1].container, {button: 1}, cw);
|
||||
ok(bounds.equals(children[1].getBounds()), "tabItems were re-arranged");
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ function test() {
|
|||
let bounds = tabItem.getBounds();
|
||||
|
||||
is(groupItem.getActiveTab(), tabItem, "the first tab is active");
|
||||
tabItem.close();
|
||||
EventUtils.synthesizeMouseAtCenter(tabItem.container, {button: 1}, cw);
|
||||
|
||||
is(groupItem.getChildren().indexOf(tabItem), -1, "tabItem got removed");
|
||||
ok(bounds.equals(groupItem.getChild(0).getBounds()), "tabItem bounds didn't change");
|
||||
|
|
Загрузка…
Ссылка в новой задаче