backout changes that landed near the beginning of the unit test orange, as a test.

This commit is contained in:
sayrer@gmail.com 2007-08-09 01:01:59 -07:00
Родитель dfd77a09fd
Коммит e459c53338
5 изменённых файлов: 7 добавлений и 48 удалений

Просмотреть файл

@ -981,6 +981,9 @@ nsMenuPopupFrame::SetPopupPosition(nsIFrame* aAnchorFrame)
parentViewWidgetOffset.x - parentPos.x;
ypos = screenViewLocY - presContext->DevPixelsToAppUnits(screenParentWidgetRect.y) -
parentViewWidgetOffset.y - parentPos.y;
// once the popup is positioned on screen, it doesn't need to be positioned again
mShouldAutoPosition = PR_FALSE;
}
// Compute info about the screen dimensions. Because of multiple monitor systems,

Просмотреть файл

@ -184,9 +184,6 @@ NS_IMETHODIMP nsXULPopupManager::ShouldRollupOnMouseActivate(PRBool *aShouldRoll
NS_IMETHODIMP
nsXULPopupManager::GetSubmenuWidgetChain(nsISupportsArray **_retval)
{
// this method is used by the widget code to determine the list of popups
// that are open. If a mouse click occurs outside one of these popups, the
// panels will roll up. If the click is inside a popup, they will not roll up
nsresult rv = NS_NewISupportsArray(_retval);
NS_ENSURE_SUCCESS(rv, rv);
nsMenuChainItem* item = mCurrentMenu;
@ -195,13 +192,7 @@ nsXULPopupManager::GetSubmenuWidgetChain(nsISupportsArray **_retval)
item->Frame()->GetWidget(getter_AddRefs(widget));
nsCOMPtr<nsISupports> genericWidget(do_QueryInterface(widget));
(*_retval)->AppendElement(genericWidget);
// In the case when a menulist inside a panel is open, clicking in the
// panel should still roll up the menu, so if a different type is found,
// stop scanning.
nsMenuChainItem* parent= item->GetParent();
if (parent && item->Frame()->PopupType() != parent->Frame()->PopupType())
break;
item = parent;
item = item->GetParent();
}
return NS_OK;

Просмотреть файл

@ -56,8 +56,6 @@ _TEST_FILES = bug288254_window.xul \
test_bug331215.xul \
test_popup_preventdefault_chrome.xul \
window_popup_preventdefault_chrome.xul \
test_largemenu.xul \
window_largemenu.xul \
$(NULL)
libs:: $(_TEST_FILES)

Просмотреть файл

@ -1,33 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
<window title="Large Menu Tests"
onload="setTimeout(runTest, 0);"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<title>Large Menu Tests</title>
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"/>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
<script>
SimpleTest.waitForExplicitFinish();
function runTest()
{
window.open("window_largemenu.xul", "_new", "chrome,width=200,height=200");
}
</script>
<body xmlns="http://www.w3.org/1999/xhtml">
<p id="display">
</p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</window>

Просмотреть файл

@ -76,16 +76,16 @@ function popupShown()
}
else if (gTestIndex == 1) {
// the popup was supposed to open 100 pixels from the bottom, but that
// would put it off screen so it should be flipped to have its bottom
// would put it off screen so it should be flipped to have it's bottom
// edge 100 pixels from the bottom
ok(Math.round(rect.top) >= screen.top, gTests[gTestIndex] + " top");
ok(Math.round(rect.top) > screen.top, gTests[gTestIndex] + " top");
is(Math.round(rect.bottom) + gScreenY, screen.height - 100,
gTests[gTestIndex] + " bottom");
ok(!gOverflowed && !gUnderflowed, gTests[gTestIndex] + " overflow")
}
else if (gTestIndex == 2) {
// the popup is too large so ensure that it is on screen
window.opener.wrappedJSObject.SimpleTest.todo(Math.round(rect.top) >= screen.top, gTests[gTestIndex] + " top");
ok(Math.round(rect.top) > screen.top, gTests[gTestIndex] + " top");
ok(Math.round(rect.bottom) < screen.height, gTests[gTestIndex] + " bottom");
ok(gOverflowed && !gUnderflowed, gTests[gTestIndex] + " overflow")
}