Bug 1447866 - GeckoEditableSupport::SendIMEDummyKeyEvent() should set native key bindings to none before dispatching keyboard events which are marked as "processed by IME" r=esawin

When EditorEventListener receives keyboard events, it tries to execute
native key bindings which are stored by each keyboard event.  For performance
reason in e10s, TabParent initializes native key binding information of every
keyboard event before sending it to the remote process.  Therefore,
PuppetWidget checks if every keyboard event has native key binding information.
However, the native key binding information of dummy keyboard events marked as
"processed by IME" on Android are never initialized before sending PuppetWidget.
Therefore, we hit MOZ_ASSERT in PuppetWidget.

This patch makes GeckoEditableSuppor::SendIMEDummyKeyEvent() set native key
binding information to "none" before dispatching every keyboard event since
keyboard events during composition shouldn't cause any edit actions.

MozReview-Commit-ID: Bk532ahCQP6

--HG--
extra : rebase_source : 939c1befd4b587681192b6827e7c7fa52619d498
This commit is contained in:
Masayuki Nakano 2018-03-23 11:54:01 +09:00
Родитель 30292048c2
Коммит b87a7f9729
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -700,6 +700,11 @@ GeckoEditableSupport::SendIMEDummyKeyEvent(nsIWidget* aWidget, EventMessage msg)
// keyboard event.
event.mKeyCode = NS_VK_PROCESSKEY;
event.mKeyNameIndex = KEY_NAME_INDEX_Process;
// KeyboardEvents marked as "processed by IME" shouldn't cause any edit
// actions. So, we should set their native key binding to none before
// dispatch to avoid crash on PuppetWidget and avoid running redundant
// path to look for native key bindings.
event.PreventNativeKeyBindings();
NS_ENSURE_SUCCESS_VOID(BeginInputTransaction(mDispatcher));
mDispatcher->DispatchKeyboardEvent(msg, event, status);
}