Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3077fc7befd476203eccd6352d7931e3eb9a042b
https://github.com/WebKit/WebKit/commit/3077fc7befd476203eccd6352d7931e3eb9a042b
Author: Tim Horton <[email protected]>
Date: 2026-09-08 (Tue, 08 Sep 2026)
Changed paths:
M Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.h
M Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.mm
M Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.swift
M Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture
Tests/BasicAppKitGesturesTests.swift
Log Message:
-----------
[AppKit Gestures] Very short (or coalesced) trackpad flick doesn't result in
momentum scrolling
https://bugs.webkit.org/show_bug.cgi?id=323472
rdar://185580451
Reviewed by Abrar Rahman Protyasha.
Because of how AppKit's velocity filter is hooked up, it reports zero velocity
if no "changed" events are ever seen, which can happen if you flick impossibly
quickly, or (more likely) if events are coalesced. Keep track of enough
information
to compute the velocity ourselves in this case.
Test: Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture
Tests/BasicAppKitGesturesTests.swift
* Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.h:
* Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.mm:
(-[WKAppKitGestureController startMomentumIfNeededForGesture:]):
(velocityInView): Deleted.
* Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.swift:
(WKPanGestureRecognizer.gestureStartTime):
(WKPanGestureRecognizer.gestureStartLocationInWindow):
(WKPanGestureRecognizer.lastMovementTime):
(WKPanGestureRecognizer.lastMovementLocationInWindow):
(WKPanGestureRecognizer.reset):
(WKPanGestureRecognizer.wk_velocity(in:)):
(WKAppKitGestureController.panVelocity(in:)):
Compute the velocity from two points if we never saw a "changed" event;
otherwise, trust the one we're given.
Also, mimic AppKit's 200ms timeout and bail from momentum if the two events are
far apart in time.
(WKAppKitGestureController.loggingDescription(for:)):
Drive-by fix to stop logging the (static) class and log the gesture recognizer
instead.
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture
Tests/BasicAppKitGesturesTests.swift:
Add tests both for the named bug, and also that we don't fling if there's too
much time between the two events.
Canonical link: https://commits.webkit.org/320665@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications