backout bug 685073 part.2 due to random crash

This commit is contained in:
Masayuki Nakano 2011-10-01 10:10:43 +09:00
parent 3b1fb85f88
commit 228ea34ec8
2 changed files with 4 additions and 19 deletions

View File

@ -481,8 +481,6 @@ protected:
bool mKeyPressDispatched;
// Whether keypress event was consumed by web contents or chrome contents.
bool mKeyPressHandled;
// Whether the key event causes other key events via IME or something.
bool mCausedOtherKeyEvents;
KeyEventState(NSEvent* aNativeKeyEvent) : mKeyEvent(nsnull)
{
@ -497,7 +495,6 @@ protected:
mKeyDownHandled = aOther.mKeyDownHandled;
mKeyPressDispatched = aOther.mKeyPressDispatched;
mKeyPressHandled = aOther.mKeyPressHandled;
mCausedOtherKeyEvents = aOther.mCausedOtherKeyEvents;
}
~KeyEventState()
@ -521,7 +518,6 @@ protected:
mKeyDownHandled = PR_FALSE;
mKeyPressDispatched = PR_FALSE;
mKeyPressHandled = PR_FALSE;
mCausedOtherKeyEvents = PR_FALSE;
}
bool KeyDownOrPressHandled()
@ -568,12 +564,6 @@ protected:
*/
KeyEventState* PushKeyEvent(NSEvent* aNativeKeyEvent)
{
PRUint32 nestCount = mCurrentKeyEvents.Length();
for (PRUint32 i = 0; i < nestCount; i++) {
// When the key event is caused by another key event, all key events
// which are being handled should be marked as "consumed".
mCurrentKeyEvents[i].mCausedOtherKeyEvents = PR_TRUE;
}
KeyEventState keyEventState(aNativeKeyEvent);
return mCurrentKeyEvents.InsertElementAt(0, keyEventState);
}

View File

@ -1124,8 +1124,7 @@ TextInputHandler::HandleKeyDownEvent(NSEvent* aNativeEvent)
// our default action for this key.
if (!(interpretKeyEventsCalled &&
IsNormalCharInputtingEvent(keypressEvent))) {
if (currentKeyEvent->mKeyDownHandled ||
currentKeyEvent->mCausedOtherKeyEvents) {
if (currentKeyEvent->mKeyDownHandled) {
keypressEvent.flags |= NS_EVENT_FLAG_NO_DEFAULT;
}
currentKeyEvent->mKeyPressHandled = DispatchEvent(keypressEvent);
@ -1420,16 +1419,12 @@ TextInputHandler::DoCommandBySelector(const char* aSelector)
PR_LOG(gLog, PR_LOG_ALWAYS,
("%p TextInputHandler::DoCommandBySelector, aSelector=\"%s\", "
"Destroyed()=%s, keypressHandled=%s, causedOtherKeyEvents=%s",
"Destroyed()=%s, keypressHandled=%s",
this, aSelector ? aSelector : "", TrueOrFalse(Destroyed()),
currentKeyEvent ?
TrueOrFalse(currentKeyEvent->mKeyPressHandled) : "N/A",
currentKeyEvent ?
TrueOrFalse(currentKeyEvent->mCausedOtherKeyEvents) : "N/A"));
TrueOrFalse(currentKeyEvent->mKeyPressHandled) : "N/A"));
return !Destroyed() && currentKeyEvent &&
(currentKeyEvent->mKeyPressHandled ||
currentKeyEvent->mCausedOtherKeyEvents);
return !Destroyed() && currentKeyEvent && currentKeyEvent->mKeyPressHandled;
}