зеркало из https://github.com/mozilla/pjs.git
fix for 67731, patch from varga@utcru.sk, r=pinkerton, sr=hyatt
This commit is contained in:
Родитель
c97558dab7
Коммит
a12ad79211
|
@ -169,8 +169,10 @@ nsMenuListener::KeyPress(nsIDOMEvent* aKeyEvent)
|
|||
if (theChar == NS_VK_LEFT ||
|
||||
theChar == NS_VK_RIGHT ||
|
||||
theChar == NS_VK_UP ||
|
||||
theChar == NS_VK_DOWN) {
|
||||
// The arrow keys were pressed. User is moving around within
|
||||
theChar == NS_VK_DOWN ||
|
||||
theChar == NS_VK_HOME ||
|
||||
theChar == NS_VK_END) {
|
||||
// The navigation keys were pressed. User is moving around within
|
||||
// the menus.
|
||||
mMenuParent->KeyboardNavigation(theChar, handled);
|
||||
}
|
||||
|
|
|
@ -1179,13 +1179,19 @@ nsMenuPopupFrame::KeyboardNavigation(PRUint32 aDirection, PRBool& aHandledFlag)
|
|||
return NS_OK; // The child menu took it for us.
|
||||
|
||||
// For the vertical direction, we can move up or down.
|
||||
if (aDirection == NS_VK_UP || aDirection == NS_VK_DOWN) {
|
||||
if (aDirection == NS_VK_UP || aDirection == NS_VK_DOWN ||
|
||||
aDirection == NS_VK_HOME || aDirection == NS_VK_END) {
|
||||
|
||||
nsIMenuFrame* nextItem;
|
||||
|
||||
if (aDirection == NS_VK_DOWN)
|
||||
if (aDirection == NS_VK_UP)
|
||||
GetPreviousMenuItem(mCurrentMenu, &nextItem);
|
||||
else if (aDirection == NS_VK_DOWN)
|
||||
GetNextMenuItem(mCurrentMenu, &nextItem);
|
||||
else GetPreviousMenuItem(mCurrentMenu, &nextItem);
|
||||
else if (aDirection == NS_VK_HOME)
|
||||
GetNextMenuItem(nsnull, &nextItem);
|
||||
else
|
||||
GetPreviousMenuItem(mCurrentMenu, &nextItem);
|
||||
|
||||
SetCurrentMenuItem(nextItem);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче