Bug 1438097 - nsXBLWindowKeyHandler::HandleEventOnCaptureInSystemEventGroup() should mark keyboard events which won't be fired on content in the default event group as "wait reply from remote process" r?smaug
BaseEventFlags::mOnlySystemGroupDispatchInContent was used only when the
key combination is reserved by chrome, and used for preventing to fire
in web content on non-e10s window (
bug 1203059).
However, now, this is also used for preventing to fire keypress event for
non-printable key combinations on web contents in the default event group
(
bug 1433101). Therefore, now, we need to send events whose
mFlags.mOnlySystemGroupDispatchInContent is true because some event listeners
in the system event group in remote process may want to handle specific
keyboard events before nsXBLWindowKeyHandler.
This patch makes nsXBLWindowKeyHandler::HandleEventOnCaptureInSystemEventGroup()
treat KeyboardEvent whose mFlags.mOnlySystemGroupDispatchInContent is true
but which will be sent to remote process as usual event.
MozReview-Commit-ID: 4x0co9X2QV7
--- a/dom/xbl/nsXBLWindowKeyHandler.cpp
+++ b/dom/xbl/nsXBLWindowKeyHandler.cpp
@@ -560,19 +560,22 @@ nsXBLWindowKeyHandler::HandleEventOnCapt
void
nsXBLWindowKeyHandler::HandleEventOnCaptureInSystemEventGroup(
KeyboardEvent* aEvent)
{
WidgetKeyboardEvent* widgetEvent =
aEvent->WidgetEventPtr()->AsKeyboardEvent();
// If the event won't be sent to remote process, this listener needs to do
- // nothing.
- if (widgetEvent->mFlags.mOnlySystemGroupDispatchInContent ||
- !widgetEvent->WillBeSentToRemoteProcess()) {
+ // nothing. Note that even if mOnlySystemGroupDispatchInContent is true,
+ // we need to send the event to remote process and check reply event
+ // before matching it with registered shortcut keys because event listeners
+ // in the system event group may want to handle the event before registered
+ // shortcut key handlers.
+ if (!widgetEvent->WillBeSentToRemoteProcess()) {
return;
}
if (!HasHandlerForEvent(aEvent)) {
return;
}
// If this event wasn't marked as IsCrossProcessForwardingStopped,