зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1694229 - Separate Enter/Exit Widget Events from Mouse Button events r=smaug
If we don't do this, then just moving the mouse over a window experiencing a slow script will cause it to show the notification. We could try to deserialize the message inside nsContentUtils::IsMessageCriticalInputEvent, but that seems overcomplicated compared to just adding a new message which proxies to the original message handlers. Differential Revision: https://phabricator.services.mozilla.com/D106016
This commit is contained in:
Родитель
a9fbe5527c
Коммит
6b8f6949b2
|
@ -10019,6 +10019,7 @@ bool nsContentUtils::IsMessageInputEvent(const IPC::Message& aMsg) {
|
|||
switch (aMsg.type()) {
|
||||
case mozilla::dom::PBrowser::Msg_RealMouseMoveEvent__ID:
|
||||
case mozilla::dom::PBrowser::Msg_RealMouseButtonEvent__ID:
|
||||
case mozilla::dom::PBrowser::Msg_RealMouseEnterExitWidgetEvent__ID:
|
||||
case mozilla::dom::PBrowser::Msg_RealKeyEvent__ID:
|
||||
case mozilla::dom::PBrowser::Msg_MouseWheelEvent__ID:
|
||||
case mozilla::dom::PBrowser::Msg_RealTouchEvent__ID:
|
||||
|
|
|
@ -1679,6 +1679,19 @@ mozilla::ipc::IPCResult BrowserChild::RecvNormalPriorityRealMouseButtonEvent(
|
|||
return RecvRealMouseButtonEvent(aEvent, aGuid, aInputBlockId);
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult BrowserChild::RecvRealMouseEnterExitWidgetEvent(
|
||||
const WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId) {
|
||||
return RecvRealMouseButtonEvent(aEvent, aGuid, aInputBlockId);
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
BrowserChild::RecvNormalPriorityRealMouseEnterExitWidgetEvent(
|
||||
const WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId) {
|
||||
return RecvRealMouseButtonEvent(aEvent, aGuid, aInputBlockId);
|
||||
}
|
||||
|
||||
// In case handling repeated mouse wheel takes much time, we skip firing current
|
||||
// wheel event if it may be coalesced to the next one.
|
||||
bool BrowserChild::MaybeCoalesceWheelEvent(const WidgetWheelEvent& aEvent,
|
||||
|
|
|
@ -329,6 +329,13 @@ class BrowserChild final : public nsMessageManagerScriptExecutor,
|
|||
const mozilla::WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId);
|
||||
|
||||
mozilla::ipc::IPCResult RecvRealMouseEnterExitWidgetEvent(
|
||||
const mozilla::WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId);
|
||||
mozilla::ipc::IPCResult RecvNormalPriorityRealMouseEnterExitWidgetEvent(
|
||||
const mozilla::WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId);
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
||||
mozilla::ipc::IPCResult RecvRealDragEvent(const WidgetDragEvent& aEvent,
|
||||
const uint32_t& aDragAction,
|
||||
|
|
|
@ -1462,10 +1462,10 @@ void BrowserParent::SendRealMouseEvent(WidgetMouseEvent& aEvent) {
|
|||
localEvent.mMessage = eMouseEnterIntoWidget;
|
||||
DebugOnly<bool> ret =
|
||||
isInputPriorityEventEnabled
|
||||
? SendRealMouseButtonEvent(localEvent, guid, blockId)
|
||||
: SendNormalPriorityRealMouseButtonEvent(localEvent, guid, blockId);
|
||||
NS_WARNING_ASSERTION(
|
||||
ret, "SendRealMouseButtonEvent(eMouseEnterIntoWidget) failed");
|
||||
? SendRealMouseEnterExitWidgetEvent(localEvent, guid, blockId)
|
||||
: SendNormalPriorityRealMouseEnterExitWidgetEvent(localEvent, guid,
|
||||
blockId);
|
||||
NS_WARNING_ASSERTION(ret, "SendRealMouseEnterExitWidgetEvent() failed");
|
||||
MOZ_ASSERT(!ret || localEvent.HasBeenPostedToRemoteProcess());
|
||||
}
|
||||
|
||||
|
@ -1500,6 +1500,18 @@ void BrowserParent::SendRealMouseEvent(WidgetMouseEvent& aEvent) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (eMouseEnterIntoWidget == aEvent.mMessage ||
|
||||
eMouseExitFromWidget == aEvent.mMessage) {
|
||||
DebugOnly<bool> ret =
|
||||
isInputPriorityEventEnabled
|
||||
? SendRealMouseEnterExitWidgetEvent(aEvent, guid, blockId)
|
||||
: SendNormalPriorityRealMouseEnterExitWidgetEvent(aEvent, guid,
|
||||
blockId);
|
||||
NS_WARNING_ASSERTION(ret, "SendRealMouseEnterExitWidgetEvent() failed");
|
||||
MOZ_ASSERT(!ret || aEvent.HasBeenPostedToRemoteProcess());
|
||||
return;
|
||||
}
|
||||
|
||||
DebugOnly<bool> ret =
|
||||
isInputPriorityEventEnabled
|
||||
? SendRealMouseButtonEvent(aEvent, guid, blockId)
|
||||
|
|
|
@ -792,6 +792,14 @@ child:
|
|||
ScrollableLayerGuid aGuid,
|
||||
uint64_t aInputBlockId);
|
||||
|
||||
[Priority=input]
|
||||
async RealMouseEnterExitWidgetEvent(WidgetMouseEvent event,
|
||||
ScrollableLayerGuid aGuid,
|
||||
uint64_t aInputBlockId);
|
||||
async NormalPriorityRealMouseEnterExitWidgetEvent(WidgetMouseEvent event,
|
||||
ScrollableLayerGuid aGuid,
|
||||
uint64_t aInputBlockId);
|
||||
|
||||
[Priority=input]
|
||||
async RealKeyEvent(WidgetKeyboardEvent event);
|
||||
async NormalPriorityRealKeyEvent(WidgetKeyboardEvent event);
|
||||
|
|
Загрузка…
Ссылка в новой задаче