Bug 617076 - Large white space under Add-on Manager when switching tabs and panes. r=tnikkel a=blocking2.0:betaN

This commit is contained in:
Mats Palmgren 2011-01-29 01:10:46 +01:00
parent b06dc4b9ae
commit 345787dcab
3 changed files with 77 additions and 0 deletions

View File

@ -317,8 +317,14 @@ _TEST_FILES += \
$(NULL)
endif
_BROWSER_FILES = \
browser_bug617076.js \
$(NULL)
libs:: $(_TEST_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
libs:: $(_BROWSER_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
check::
@$(EXIT_ON_ERROR) \

View File

@ -0,0 +1,61 @@
function test()
{
waitForExplicitFinish();
test1();
}
/**
* 1. load about:addons in a new tab and select that tab
* 2. insert a button with tooltiptext
* 3. create a new blank tab and select that tab
* 4. select the about:addons tab and hover the inserted button
* 5. remove the about:addons tab
* 6. remove the blank tab
*
* the test succeeds if it doesn't trigger any assertions
*/
function test1() {
let uri = "about:addons";
let tab = gBrowser.addTab();
tab.linkedBrowser.addEventListener("load", function(aEvent) {
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
let doc = gBrowser.contentDocument;
var e = doc.createElement("button");
e.setAttribute('label', "hello");
e.setAttribute('tooltiptext', "world");
doc.documentElement.insertBefore(e, doc.documentElement.firstChild);
let tab2 = gBrowser.addTab();
gBrowser.selectedTab = tab2;
setTimeout(function() {
gBrowser.selectedTab = tab;
let doc = gBrowser.contentDocument;
var win = gBrowser.contentWindow;
EventUtils.disableNonTestMouseEvents(true);
try {
EventUtils.synthesizeMouse(e, 1, 1, { type: "mouseover" }, win);
EventUtils.synthesizeMouse(e, 2, 6, { type: "mousemove" }, win);
EventUtils.synthesizeMouse(e, 2, 4, { type: "mousemove" }, win);
} finally {
EventUtils.disableNonTestMouseEvents(false);
}
executeSoon(function() {
gBrowser.removeTab(tab, {animate: false});
gBrowser.removeTab(tab2, {animate: false});
ok(true, "pass if no assertions");
// done
executeSoon(finish);
});
}, 0);
}, true);
gBrowser.selectedTab = tab;
gBrowser.selectedTab.linkedBrowser.loadURI(uri);
}

View File

@ -314,6 +314,16 @@ NS_IMETHODIMP nsViewManager::SetWindowDimensions(nscoord aWidth, nscoord aHeight
{
if (mRootView) {
if (mRootView->IsEffectivelyVisible()) {
if (mDelayedResize != nsSize(NSCOORD_NONE, NSCOORD_NONE) &&
mDelayedResize != nsSize(aWidth, aHeight)) {
// We have a delayed resize; that now obsolete size may already have
// been flushed to the PresContext so we need to update the PresContext
// with the new size because if the new size is exactly the same as the
// root view's current size then DoSetWindowDimensions will not
// request a resize reflow (which would correct it). See bug 617076.
mDelayedResize = nsSize(aWidth, aHeight);
FlushDelayedResize(PR_FALSE);
}
mDelayedResize.SizeTo(NSCOORD_NONE, NSCOORD_NONE);
DoSetWindowDimensions(aWidth, aHeight);
} else {