Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f96549a8d98bee3804f71cc09bb08a4f897bc2b3
      
https://github.com/WebKit/WebKit/commit/f96549a8d98bee3804f71cc09bb08a4f897bc2b3
  Author: Richard Robinson <[email protected]>
  Date:   2026-09-25 (Fri, 25 Sep 2026)

  Changed paths:
    M Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.mm
    M Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/BasicAppKitGesturesTests.swift

  Log Message:
  -----------
  [AppKit Gestures] Scrolling the page sometimes selects text
https://bugs.webkit.org/show_bug.cgi?id=325105
rdar://187817705

Reviewed by Tim Horton and Abrar Rahman Protyasha.

`_caughtDeceleratingScroll` only handles WebKit's own recognizers, not 
NSTextSelectionManager's.
Also, the check in `gestureRecognizerShouldBegin:` ran before the check that 
always lets deferring
gesture recognizers begin, so a deferral that tried to prevent text selection 
while catching a
decelerating scroll was failed instead, which released the text selection 
gestures rather than
blocking them.

Fix this by always allowing deferring gesture recognizers to begin. Also 
resolve every deferral as
"prevent" as soon as the event begins if it caught a decelerating scroll, 
instead of waiting for position
information, so the deferred gestures fail before they can begin.

Test: Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/BasicAppKitGesturesTests.swift

* Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.mm:
(-[WKAppKitGestureController 
deferringGestureRecognizer:shouldDeferGesturesForEventThatWillBeginAction:]):
(-[WKAppKitGestureController gestureRecognizerShouldBegin:]):
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/BasicAppKitGesturesTests.swift:
(AppKitGesturesTests.clickThenDragSelectsTextUnlessItInterruptsDeceleratingScroll(_:)):

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



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

Reply via email to