Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4be0e16798850bcc12eac7486bdcaf87c8fa6856
      
https://github.com/WebKit/WebKit/commit/4be0e16798850bcc12eac7486bdcaf87c8fa6856
  Author: Lily Spiniolas <[email protected]>
  Date:   2026-02-09 (Mon, 09 Feb 2026)

  Changed paths:
    M Source/WebCore/platform/mac/PlatformEventFactoryMac.mm
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
    M Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm
    M Tools/TestWebKitAPI/Tests/mac/MouseEventTests.mm

  Log Message:
  -----------
  REGRESSION (304761@main): Unable to select text and scroll while dragging
https://bugs.webkit.org/show_bug.cgi?id=307312
rdar://169571126

Reviewed by Richard Robinson.

In 304761@main, `mouseButtonForEvent(NSEvent *event)` was changed to return
`MouseButton::None` for `NSEventTypeMouseEntered` and `NSEventTypeMouseExited`.
As a result, a left click drag which leaves the window will cause an exit event
to be created, for which we incorrectly identify the mouse button as
`MouseButton::None` during processing, and thus behave as if the mouse was
released. Fix this by simply restoring the previous return values for
`NSEventTypeMouseEntered` and `NSEventTypeMouseExited`.

Test: Tools/TestWebKitAPI/Tests/mac/MouseEventTests.mm

* Source/WebCore/platform/mac/PlatformEventFactoryMac.mm:
(WebCore::mouseButtonForEvent):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:
* Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm:
(-[WKWebView _simulateMouseExit:]):
* Tools/TestWebKitAPI/Tests/mac/MouseEventTests.mm:
(TestWebKitAPI::TEST(MouseEventTests, AutoscrollOnMouseDragBelowWindow)):

Canonical link: https://commits.webkit.org/307090@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to