Bug 378752 Mnemonic of Menu doesn't work if an editor has focus and IME is on r+sr=roc

This commit is contained in:
2007-05-02 08:34:35 -07:00
parent 758d904145
commit e3f47ac88a
6 changed files with 42 additions and 4 deletions

View File

@@ -44,6 +44,7 @@
#include "nsMenuPopupFrame.h"
#include "nsGkAtoms.h"
#include "nsIContent.h"
#include "nsContentUtils.h"
#include "prtypes.h"
#include "nsIAtom.h"
#include "nsPresContext.h"
@@ -1800,7 +1801,9 @@ nsMenuPopupFrame::InstallKeyboardNavigator()
target->AddEventListener(NS_LITERAL_STRING("keypress"), (nsIDOMKeyListener*)mKeyboardNavigator, PR_TRUE);
target->AddEventListener(NS_LITERAL_STRING("keydown"), (nsIDOMKeyListener*)mKeyboardNavigator, PR_TRUE);
target->AddEventListener(NS_LITERAL_STRING("keyup"), (nsIDOMKeyListener*)mKeyboardNavigator, PR_TRUE);
nsContentUtils::NotifyInstalledMenuKeyboardListener(PR_TRUE);
return NS_OK;
}
@@ -1813,9 +1816,11 @@ nsMenuPopupFrame::RemoveKeyboardNavigator()
mTarget->RemoveEventListener(NS_LITERAL_STRING("keypress"), (nsIDOMKeyListener*)mKeyboardNavigator, PR_TRUE);
mTarget->RemoveEventListener(NS_LITERAL_STRING("keydown"), (nsIDOMKeyListener*)mKeyboardNavigator, PR_TRUE);
mTarget->RemoveEventListener(NS_LITERAL_STRING("keyup"), (nsIDOMKeyListener*)mKeyboardNavigator, PR_TRUE);
NS_IF_RELEASE(mKeyboardNavigator);
nsContentUtils::NotifyInstalledMenuKeyboardListener(PR_FALSE);
return NS_OK;
}