зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1309587 - PreventDefault() on suppressed/delayed key events that are sent back to parent. r=smaug
--HG-- extra : rebase_source : 0762ef1284c063c9716a963bf40ff5cc82b48326
This commit is contained in:
Родитель
a2e45117d7
Коммит
3f2c55024c
|
@ -1804,6 +1804,10 @@ TabChild::RecvRealKeyEvent(const WidgetKeyboardEvent& event,
|
|||
mIgnoreKeyPressEvent = status == nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
|
||||
if (localEvent.mFlags.mIsSuppressedOrDelayed) {
|
||||
localEvent.PreventDefault();
|
||||
}
|
||||
|
||||
// If a response is desired from the content process, resend the key event.
|
||||
// If mAccessKeyForwardedToChild is set, then don't resend the key event yet
|
||||
// as RecvHandleAccessKey will do this.
|
||||
|
|
|
@ -7513,6 +7513,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
|||
delete event;
|
||||
}
|
||||
}
|
||||
aEvent->mFlags.mIsSuppressedOrDelayed = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -132,6 +132,10 @@ public:
|
|||
// Similar to mComposed. Set it to true to allow events cross the boundary
|
||||
// between native non-anonymous content and native anonymouse content
|
||||
bool mComposedInNativeAnonymousContent : 1;
|
||||
// True if the event is suppressed or delayed. This is used when parent side
|
||||
// process the key event after content side, parent side may drop the key
|
||||
// event if it was suppressed or delayed in content side.
|
||||
bool mIsSuppressedOrDelayed : 1;
|
||||
|
||||
// If the event is being handled in target phase, returns true.
|
||||
inline bool InTargetPhase() const
|
||||
|
|
Загрузка…
Ссылка в новой задаче