RESOLVED INVALID 273761
NSEventTypeMouseExited is triggered when moving the mouse in the wkwebview
https://bugs.webkit.org/show_bug.cgi?id=273761
Summary NSEventTypeMouseExited is triggered when moving the mouse in the wkwebview
xiaofeihan
Reported 2024-05-06 02:56:23 PDT
Reproduce steps: 1. create a wkwebview and navigate to google.com 2. Move mouse within the WkWebView 3. print the event type in `sendEvent:` of subclassing NSApplication Expect: NSEventTypeMouseExited don't be triggerred. Actual: NSEventTypeMouseExited be trigger multiple times.
Attachments
Alexey Proskuryakov
Comment 1 2024-05-06 13:44:03 PDT
Thank you for the report. What makes you expect that NSEventTypeMouseExited won't be dispatched on NSApplication? AFAICT it's used for NSTrackingArea.
xiaofeihan
Comment 2 2024-05-06 17:22:29 PDT
Thanks @Alexey for the quick reply. IIUC, NSEventTypeMouseExited only be triggerred when uses exit a NSView? If uses only move mouse inside the WKWebView, I think it should not be triggerred.
Alexey Proskuryakov
Comment 3 2024-05-07 13:36:34 PDT
It would seem fair to expect this for events sent to the view, but not for everything dispatched through NSApplication.
xiaofeihan
Comment 4 2024-05-07 23:00:48 PDT
Sorry, I didn't get you. When I move mouse within WKWebView(e.g move out from <input> element), `sendEvent:` of subclassing NSApplication is called with `mouseExited`. It can definitely mean that the user move out of some NSTracking area, right? My guess is that there are many tracing area in one WKWebView, e.g one tracking are per one button/input. If so, That explains my question. But according to WKWebView source code, I found it seems that there is only one NSTracking area for WKWebView. https://github.com/WebKit/WebKit/blob/164aa4e39b317d71cbd408dcaa124282838b4d2f/Source/WebKit/UIProcess/mac/WebViewImpl.mm#L1158
Alexey Proskuryakov
Comment 5 2024-05-08 09:01:08 PDT
You can ask this question in Cocoa programming groups, or use a debugger to discover why it't being sent. There is no indication of a problem that needs to be fixed here.
Note You need to log in before you can comment on or make changes to this bug.