Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 78ad297be7f772ab584bb4a1110e2cea163c57af
https://github.com/WebKit/WebKit/commit/78ad297be7f772ab584bb4a1110e2cea163c57af
Author: Abrar Rahman Protyasha <[email protected]>
Date: 2025-11-15 (Sat, 15 Nov 2025)
Changed paths:
M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
M Source/WebCore/platform/Scrollbar.h
M Source/WebKit/Platform/spi/mac/AppKitSPI.h
M Source/WebKit/Shared/NativeWebWheelEvent.h
M Source/WebKit/Shared/mac/NativeWebWheelEventMac.mm
M Source/WebKit/SourcesCocoa.txt
A Source/WebKit/UIProcess/mac/WKPanGestureController.h
A Source/WebKit/UIProcess/mac/WKPanGestureController.mm
M Source/WebKit/UIProcess/mac/WebViewImpl.h
M Source/WebKit/UIProcess/mac/WebViewImpl.mm
M Source/WebKit/WebKit.xcodeproj/project.pbxproj
Log Message:
-----------
[AppKit Gestures] Refactor wheel input handling to support
NSPanGestureRecognizer
https://bugs.webkit.org/show_bug.cgi?id=302494
rdar://163242714
Reviewed by Lily Spiniolas and Wenson Hsieh.
This patch adds infrastructure to support scrolling web views using
NSPanGestureRecognizer, modernizing our gesture handling to adopt
AppKit's gesture recognizer APIs in place of lower-level event handling.
The implementation introduces WKPanGestureController, which translates
NSPanGestureRecognizer events into WebWheelEvents that can drive the
existing scrolling machinery. This behavior change is gated behind a new
UseAppKitGestures internal preference.
Test coverage will be added in a follow up patch.
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/platform/Scrollbar.h:
(WebCore::Scrollbar::pixelsPerLineStep): Drive-by: make this constexpr.
* Source/WebKit/Platform/spi/mac/AppKitSPI.h:
* Source/WebKit/Shared/NativeWebWheelEvent.h:
* Source/WebKit/Shared/mac/NativeWebWheelEventMac.mm:
(WebKit::NativeWebWheelEvent::NativeWebWheelEvent):
Added constructor to create NativeWebWheelEvent from WebWheelEvent,
enabling gesture-synthesized wheel events without a backing NSEvent.
* Source/WebKit/SourcesCocoa.txt:
* Source/WebKit/UIProcess/mac/WKPanGestureController.h: Added.
* Source/WebKit/UIProcess/mac/WKPanGestureController.mm: Added.
(translationInView):
(toWheelEventPhase):
(-[WKPanGestureController configureForScrolling:]):
(-[WKPanGestureController initWithPage:viewImpl:]):
(-[WKPanGestureController panGestureRecognized:]):
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::m_flagsChangedEventMonitorTrackingArea):
(WebKit::WebViewImpl::configurePanGestureRecognizerIfNeeded):
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
Canonical link: https://commits.webkit.org/303084@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications