Bug 673196 - When creating a new TabGroup near the edge of the screen in Panorama, a part of it is invisible; r=dietrich

This commit is contained in:
Tim Taubert 2011-08-03 07:38:07 +02:00
parent 00301a3c9f
commit a801bf5ebe
3 changed files with 39 additions and 3 deletions

View File

@ -263,11 +263,10 @@ function GroupItem(listOfEls, options) {
if (options.dontPush) {
this.setZ(drag.zIndex);
drag.zIndex++;
} else
} else {
// Calling snap will also trigger pushAway
this.snap(immediately);
if ($container)
this.setBounds(rectToBe, immediately);
}
if (!options.immediately && listOfEls.length > 0)
$container.hide().fadeIn();

View File

@ -150,6 +150,7 @@ _BROWSER_FILES = \
browser_tabview_bug663421.js \
browser_tabview_bug665502.js \
browser_tabview_bug669694.js \
browser_tabview_bug673196.js \
browser_tabview_bug673729.js \
browser_tabview_click_group.js \
browser_tabview_dragdrop.js \

View File

@ -0,0 +1,36 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
function test() {
function onLoad(win) {
registerCleanupFunction(function () win.close());
win.gBrowser.addTab();
}
function onShow(win) {
let cw = win.TabView.getContentWindow();
let group = cw.GroupItems.groupItems[0];
// shrink the group to make some room for dragging
group.setSize(200, 200, true);
waitForFocus(function () {
let target = group.getChild(0).container;
EventUtils.synthesizeMouseAtCenter(target, {type: "mousedown"}, cw);
EventUtils.synthesizeMouse(target, 0, 300, {type: "mousemove"}, cw);
EventUtils.synthesizeMouseAtCenter(target, {type: "mouseup"}, cw);
let newGroup = cw.GroupItems.groupItems[1];
let groupBounds = newGroup.getBounds();
let safeWindowBounds = cw.Items.getSafeWindowBounds();
ok(safeWindowBounds.contains(groupBounds),
"new group is within safe window bounds");
finish();
}, cw);
}
waitForExplicitFinish();
newWindowWithTabView(onShow, onLoad);
}