Bug 1300003 part.4 Remove NativeKey::mIsFollowedByNonControlCharMessage because calling NativeKey::IsFollowedByNonControlCharMessage() is enough fast r=m_kato
NativeKey is now removing and storing following char messages when it's created for a keydown message. Therefore, IsFollowedByNonControlCharMessage() just refers the stored messages and it's enough fast. So, we can get rid of mIsFollowedByNonControlCharMessage. MozReview-Commit-ID: 542A2sHNXeC
This commit is contained in:
@@ -861,7 +861,6 @@ NativeKey::NativeKey(nsWindowBase* aWidget,
|
||||
, mScanCode(0)
|
||||
, mIsExtended(false)
|
||||
, mIsDeadKey(false)
|
||||
, mIsFollowedByNonControlCharMessage(false)
|
||||
, mFakeCharMsgs(aFakeCharMsgs && aFakeCharMsgs->Length() ?
|
||||
aFakeCharMsgs : nullptr)
|
||||
{
|
||||
@@ -1064,9 +1063,9 @@ NativeKey::NativeKey(nsWindowBase* aWidget,
|
||||
keyboardLayout->ConvertNativeKeyCodeToDOMKeyCode(mOriginalVirtualKeyCode);
|
||||
// Be aware, keyboard utilities can change non-printable keys to printable
|
||||
// keys. In such case, we should make the key value as a printable key.
|
||||
mIsFollowedByNonControlCharMessage =
|
||||
IsKeyDownMessage() && IsFollowedByNonControlCharMessage();
|
||||
mKeyNameIndex = mIsFollowedByNonControlCharMessage ?
|
||||
// FYI: IsFollowedByNonControlCharMessage() returns true only when it's
|
||||
// handling a keydown message.
|
||||
mKeyNameIndex = IsFollowedByNonControlCharMessage() ?
|
||||
KEY_NAME_INDEX_USE_STRING :
|
||||
keyboardLayout->ConvertNativeKeyCodeToKeyNameIndex(mOriginalVirtualKeyCode);
|
||||
mCodeNameIndex =
|
||||
@@ -2042,7 +2041,7 @@ NativeKey::NeedsToHandleWithoutFollowingCharMessages() const
|
||||
// If keydown message is followed by WM_CHAR whose wParam isn't a control
|
||||
// character, we should dispatch keypress event with the char message
|
||||
// even with any modifier state.
|
||||
if (mIsFollowedByNonControlCharMessage) {
|
||||
if (IsFollowedByNonControlCharMessage()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -321,10 +321,6 @@ private:
|
||||
// mIsOverridingKeyboardLayout is true if the instance temporarily overriding
|
||||
// keyboard layout with specified by the constructor.
|
||||
bool mIsOverridingKeyboardLayout;
|
||||
// mIsFollowedByNonControlCharMessage may be true when mMsg is a keydown
|
||||
// message. When the keydown message is followed by a char message, this
|
||||
// is true.
|
||||
bool mIsFollowedByNonControlCharMessage;
|
||||
|
||||
nsTArray<FakeCharMsg>* mFakeCharMsgs;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user