Bug 399350, clicking menu doesn't work after selecting a command, r=bz,mano,sr=bz,a=beltzner

This commit is contained in:
enndeakin@sympatico.ca 2007-10-26 10:24:35 -07:00
Родитель 6f84faeb15
Коммит b08edfd3a6
2 изменённых файлов: 36 добавлений и 2 удалений

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

@ -1845,10 +1845,16 @@ nsXULMenuCommandEvent::Run()
// need to be hidden.
nsIFrame* popupFrame = menuFrame->GetParent();
while (popupFrame) {
if (popupFrame->GetType() == nsGkAtoms::menuPopupFrame) {
popup = popupFrame->GetContent();
// If the menu is a descendant of a menubar, clear the recently closed
// state. Break out afterwards, as the menubar is the top level of a
// menu hierarchy.
if (popupFrame->GetType() == nsGkAtoms::menuBarFrame) {
(static_cast<nsMenuBarFrame *>(popupFrame))->SetRecentlyClosed(nsnull);
break;
}
else if (!popup && popupFrame->GetType() == nsGkAtoms::menuPopupFrame) {
popup = popupFrame->GetContent();
}
popupFrame = popupFrame->GetParent();
}

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

@ -490,6 +490,34 @@ var popupTests = [
checkClosed("editmenu", testname);
}
},
{
// this test ensures that the menu can still be opened by clicking after selecting
// a menuitem from the menu. See bug 399350.
testname: "press on menu after menuitem selected",
events: [ "popupshowing editpopup", "DOMMenuBarActive menubar",
"DOMMenuItemActive editmenu", "popupshown editpopup" ],
test: function() { synthesizeMouse(document.getElementById("editmenu"), 8, 8, { }); },
result: function (testname) {
checkActive(document.getElementById("editpopup"), "", testname);
checkOpen("editmenu", testname);
}
},
{ // try selecting a different command
testname: "press on menuitem again",
events: [ "DOMMenuInactive editpopup",
"DOMMenuBarInactive menubar",
"DOMMenuItemInactive editmenu",
"DOMMenuItemInactive editmenu",
"command paste", "popuphiding editpopup", "popuphidden editpopup",
"DOMMenuItemInactive paste",
],
test: function() {
synthesizeMouse(document.getElementById("paste"), 8, 8, { });
},
result: function (testname) {
checkClosed("editmenu", testname);
}
},
{
testname: "F10 to activate menubar for tab deactivation",
events: [ "DOMMenuBarActive menubar", "DOMMenuItemActive filemenu" ],