зеркало из https://github.com/mozilla/gecko-dev.git
Bug 399350, clicking menu doesn't work after selecting a command, r=bz,mano,sr=bz,a=beltzner
This commit is contained in:
Родитель
6f84faeb15
Коммит
b08edfd3a6
|
@ -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" ],
|
||||
|
|
Загрузка…
Ссылка в новой задаче