Bug 273761
Summary: | NSEventTypeMouseExited is triggered when moving the mouse in the wkwebview | ||
---|---|---|---|
Product: | WebKit | Reporter: | xiaofeihan |
Component: | WebKit2 | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Normal | CC: | ap, kkinnunen |
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | Mac (Apple Silicon) | ||
OS: | macOS 14 |
xiaofeihan
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
Thank you for the report. What makes you expect that NSEventTypeMouseExited won't be dispatched on NSApplication? AFAICT it's used for NSTrackingArea.
xiaofeihan
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
It would seem fair to expect this for events sent to the view, but not for everything dispatched through NSApplication.
xiaofeihan
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
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.