diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 0b0893e9d363..48d0626c5262 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -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: diff --git a/dom/ipc/BrowserChild.cpp b/dom/ipc/BrowserChild.cpp index fe515df85be6..a779c2e93843 100644 --- a/dom/ipc/BrowserChild.cpp +++ b/dom/ipc/BrowserChild.cpp @@ -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, diff --git a/dom/ipc/BrowserChild.h b/dom/ipc/BrowserChild.h index d94ca031eb26..4d6132356610 100644 --- a/dom/ipc/BrowserChild.h +++ b/dom/ipc/BrowserChild.h @@ -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, diff --git a/dom/ipc/BrowserParent.cpp b/dom/ipc/BrowserParent.cpp index 6b3632a81fda..55a621fe8d2c 100644 --- a/dom/ipc/BrowserParent.cpp +++ b/dom/ipc/BrowserParent.cpp @@ -1462,10 +1462,10 @@ void BrowserParent::SendRealMouseEvent(WidgetMouseEvent& aEvent) { localEvent.mMessage = eMouseEnterIntoWidget; DebugOnly 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 ret = + isInputPriorityEventEnabled + ? SendRealMouseEnterExitWidgetEvent(aEvent, guid, blockId) + : SendNormalPriorityRealMouseEnterExitWidgetEvent(aEvent, guid, + blockId); + NS_WARNING_ASSERTION(ret, "SendRealMouseEnterExitWidgetEvent() failed"); + MOZ_ASSERT(!ret || aEvent.HasBeenPostedToRemoteProcess()); + return; + } + DebugOnly ret = isInputPriorityEventEnabled ? SendRealMouseButtonEvent(aEvent, guid, blockId) diff --git a/dom/ipc/PBrowser.ipdl b/dom/ipc/PBrowser.ipdl index f172618b7d36..c807e740b6a3 100644 --- a/dom/ipc/PBrowser.ipdl +++ b/dom/ipc/PBrowser.ipdl @@ -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);