diff --git a/mozilla/layout/xul/base/src/nsMenuListener.cpp b/mozilla/layout/xul/base/src/nsMenuListener.cpp index 5bea3190a87..a33762ce578 100644 --- a/mozilla/layout/xul/base/src/nsMenuListener.cpp +++ b/mozilla/layout/xul/base/src/nsMenuListener.cpp @@ -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); } diff --git a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp index c12ec4f64e0..e0b5eeef922 100644 --- a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -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);