Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ac3d35def7ee6b9a6bdb085e947f5766086f74ac
      
https://github.com/WebKit/WebKit/commit/ac3d35def7ee6b9a6bdb085e947f5766086f74ac
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2025-11-18 (Tue, 18 Nov 2025)

  Changed paths:
    M Source/WebKit/Shared/WebWheelEvent.h
    M Source/WebKit/UIProcess/mac/WKPanGestureController.mm
    M Source/WebKit/UIProcess/mac/WebViewImpl.mm

  Log Message:
  -----------
  [AppKit Gestures] Pan gesture driven wheel inputs should support momentum 
scrolling
https://bugs.webkit.org/show_bug.cgi?id=302655
rdar://162040854

Reviewed by Wenson Hsieh.

303084@main introduced general pan gesture --> wheel input support, but
did not hook all the necessary event handling to drive the momentum
phases of scrolling.

In this patch, we teach WKPanGestureController how to prod the momentum
event dispatcher by sending a `Momentum:=Phase::Began` wheel event
with the appropriate velocity at the end of a recognized gesture. This
leads to synthetic momentum events generation using the acceleration
curve. Moreover, we introduce some state to facilitate catching or
interruption of an ongoing momentum scroll. Again, we simply teach
WKPanGestureController to prod the momentum event dispatcher by sending
a wheel event with `MomentumEndType:=Interrupted`.

* Source/WebKit/Shared/WebWheelEvent.h:
(WebKit::WebWheelEvent::setRawPlatformDelta):
  Add a setter so the raw delta can be computed after event creation,
  since the event itself may be required to fetch an associated scrolling
  acceleration curve.
* Source/WebKit/UIProcess/mac/WKPanGestureController.mm:
(velocityInView):
(toRawPlatformDelta):
(-[WKPanGestureController panGestureRecognized:]):
  Small refactor to avoid unnecessary bloat in the gesture recognition
  method.
(-[WKPanGestureController sendWheelEventForGesture:]):
(-[WKPanGestureController startMomentumIfNeededForGesture:]):
(-[WKPanGestureController interruptMomentumIfNeeded]):
  Introduce three smaller wheel event handling helper methods.
* Source/WebKit/UIProcess/mac/WebViewImpl.mm: Removed unused variable.
(WebKit::WebViewImpl::configurePanGestureRecognizerIfNeeded):

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



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

Reply via email to