Bug 1321245 - Request native key bindings for delayed keypress events. r=smaug

This commit is contained in:
Jessica Jong
2016-12-02 00:41:00 -05:00
parent 3ab91265f9
commit 8e34fa1651
3 changed files with 9 additions and 4 deletions

View File

@@ -9918,6 +9918,7 @@ PresShell::DelayedKeyEvent::DelayedKeyEvent(WidgetKeyboardEvent* aEvent) :
aEvent->mWidget); aEvent->mWidget);
keyEvent->AssignKeyEventData(*aEvent, false); keyEvent->AssignKeyEventData(*aEvent, false);
keyEvent->mFlags.mIsSynthesizedForTests = aEvent->mFlags.mIsSynthesizedForTests; keyEvent->mFlags.mIsSynthesizedForTests = aEvent->mFlags.mIsSynthesizedForTests;
keyEvent->mFlags.mIsSuppressedOrDelayed = true;
mEvent = keyEvent; mEvent = keyEvent;
} }

View File

@@ -132,9 +132,12 @@ public:
// Similar to mComposed. Set it to true to allow events cross the boundary // Similar to mComposed. Set it to true to allow events cross the boundary
// between native non-anonymous content and native anonymouse content // between native non-anonymous content and native anonymouse content
bool mComposedInNativeAnonymousContent : 1; bool mComposedInNativeAnonymousContent : 1;
// True if the event is suppressed or delayed. This is used when parent side // Set to true for events which are suppressed or delayed so that later a
// process the key event after content side, parent side may drop the key // DelayedEvent of it is dispatched. This is used when parent side process
// event if it was suppressed or delayed in content side. // the key event after content side, and may drop the event if the event
// was suppressed or delayed in contents side.
// It is also set to true for the events (in a DelayedInputEvent), which will
// be dispatched afterwards.
bool mIsSuppressedOrDelayed : 1; bool mIsSuppressedOrDelayed : 1;
// If the event is being handled in target phase, returns true. // If the event is being handled in target phase, returns true.

View File

@@ -326,7 +326,8 @@ PuppetWidget::DispatchEvent(WidgetGUIEvent* event, nsEventStatus& aStatus)
"Unexpected event dispatch!"); "Unexpected event dispatch!");
AutoCacheNativeKeyCommands autoCache(this); AutoCacheNativeKeyCommands autoCache(this);
if (event->mFlags.mIsSynthesizedForTests && !mNativeKeyCommandsValid) { if ((event->mFlags.mIsSynthesizedForTests ||
event->mFlags.mIsSuppressedOrDelayed) && !mNativeKeyCommandsValid) {
WidgetKeyboardEvent* keyEvent = event->AsKeyboardEvent(); WidgetKeyboardEvent* keyEvent = event->AsKeyboardEvent();
if (keyEvent) { if (keyEvent) {
mTabChild->RequestNativeKeyBindings(&autoCache, keyEvent); mTabChild->RequestNativeKeyBindings(&autoCache, keyEvent);