Bug 511673, hidden panels have an empty state, but should be 'closed', r=roc

This commit is contained in:
Neil Deakin 2009-08-26 09:19:38 -07:00
parent d03f7cb4cd
commit 7f629101b9
2 changed files with 7 additions and 1 deletions

View File

@ -232,6 +232,9 @@ nsPopupBoxObject::EnableKeyboardNavigator(PRBool aEnableKeyboardNavigator)
NS_IMETHODIMP
nsPopupBoxObject::GetPopupState(nsAString& aState)
{
// set this here in case there's no frame for the popup
aState.AssignLiteral("closed");
nsMenuPopupFrame *menuPopupFrame = GetMenuPopupFrame();
if (menuPopupFrame) {
switch (menuPopupFrame->PopupState()) {
@ -247,7 +250,6 @@ nsPopupBoxObject::GetPopupState(nsAString& aState)
aState.AssignLiteral("hiding");
break;
case ePopupClosed:
aState.AssignLiteral("closed");
break;
default:
NS_NOTREACHED("Bad popup state");

View File

@ -30,6 +30,8 @@
</menupopup>
</menu>
<panel id="hiddenpanel" hidden="true"/>
<panel id="panel" onpopupshown="panelOpened()"
onpopuphidden="$('button').focus(); $('button').open = true">
<textbox/>
@ -56,6 +58,8 @@ SimpleTest.waitForExplicitFinish();
function runTests()
{
is($("hiddenpanel").state, "closed", "hidden popup is closed");
var menu = $("menu");
menu.open = true;
}