Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 68e05b741c15d45984b7df829663146d36eeb42e
      
https://github.com/WebKit/WebKit/commit/68e05b741c15d45984b7df829663146d36eeb42e
  Author: Richard Robinson <[email protected]>
  Date:   2026-06-27 (Sat, 27 Jun 2026)

  Changed paths:
    M Source/WebKit/UIProcess/mac/WKAppKitGestureController.mm
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    A Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/AppKitGesturesTestsSupport.swift
    A Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/BasicAppKitGesturesTests.swift
    A Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/EmbeddedAppKitGesturesTests.swift
    R Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKitGesturesTests.swift

  Log Message:
  -----------
  REGRESSION(313624@main): [AppKit Gestures] Cannot scroll the enclosing scroll 
view by scrolling over an image
https://bugs.webkit.org/show_bug.cgi?id=317994
rdar://180052761

Reviewed by Abrar Rahman Protyasha.

In 313624@main, image position information began being computed on macOS, so
InteractionInformationAtPosition::isImage (and therefore
representsDraggableElement()) is now true over <img> elements. As a result,
when a scroll begins over an image in non-scrollable web content, the 
drag-deferring
gesture recognizer resolves to the recognized (.ended) state rather than 
failing.

-[WKAppKitGestureController _gestureRecognizer:canPreventGestureRecognizer:]
only exempted our click gesture recognizers from preventing scroll and zoom
gesture recognizers (313208@main); the deferring gesture recognizers fell
through to the default and were allowed to prevent anything. So once the
drag-deferring gesture recognized over an image, it prevented the enclosing
scroll view's pan gesture recognizer, and a non-scrollable web view's scroll
was never handed off to it. Non-draggable content was unaffected because the
deferring gesture fails there.

Hoist the scroll-or-zoom check above the click-gesture early return so that
none of our gesture recognizers — click or deferring — can prevent an
enclosing scroll view's pan (or any other scroll/zoom) gesture. The deferring
gesture recognizers still prevent text selection gestures, so
drag-and-drop over draggable content is unchanged.

Test: Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKitGesturesTests.swift

* Source/WebKit/UIProcess/mac/WKAppKitGestureController.mm:
(-[WKAppKitGestureController _gestureRecognizer:canPreventGestureRecognizer:]):
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/AppKitGesturesTestsSupport.swift: Added.
(TestWebKitAPILibrary.play(_:)):
(AppKitGestureTestSuite.text):
(AppKitGestureTestSuite.recap):
(AppKitGestureTestSuite.page):
(AppKitGestureTestSuite.window):
(convertToCoreGraphicsScreenCoordinates(_:window:)):
(AppKitGestureTestSuite.screenBoundsOfText(_:)):
(AppKitGestureTestSuite.screenBounds(ofElementWithID:)):
(AppKitGestureTestSuite.screenBounds(ofPointInWindowCoordinates:)):
(AppKitGestureTestSuite.screenBounds(ofRectInViewportCoordinates:)):
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/BasicAppKitGesturesTests.swift: Renamed from 
Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKitGesturesTests.swift.
(AppKitGesturesTests.draggingSelectionToWindowEdgeAutoscrolls(_:)):
(AppKitGesturesTests.pressDragOverRangeInputChangesInputValue(_:)):
(AppKitGesturesTests.pressDragOnLinkInitiatesDragAndDrop):
(AppKitGesturesTests.pressDragOnImageInitiatesDragAndDrop):
(AppKitGesturesTests.pressDragOnExistingSelectionDoesNotExtendSelection):
(AppKitGesturesTests.loadScrollableText):
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/EmbeddedAppKitGesturesTests.swift: Added.
(AppKitGesturesTests.scrollOverNonScrollableWebViewPropagatesToEnclosingScrollView):
(AppKitGesturesTests.pressDragOverTextInWebViewInsideEnclosingScrollViewCreatesSelection):
(AppKitGesturesTests.quickDragOverTextInWebViewInsideEnclosingScrollViewScrolls):

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



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

Reply via email to