Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 8b21bb68c6fbc325572bb23189e9948b14dd740d
https://github.com/WebKit/WebKit/commit/8b21bb68c6fbc325572bb23189e9948b14dd740d
Author: Richard Robinson <[email protected]>
Date: 2026-07-14 (Tue, 14 Jul 2026)
Changed paths:
M Source/WebCore/page/EventHandler.cpp
M Source/WebCore/platform/ScrollTypes.h
M Source/WebCore/platform/ScrollView.cpp
M Source/WebCore/platform/ScrollView.h
M Source/WebCore/platform/Scrollbar.cpp
M Source/WebCore/platform/Scrollbar.h
M Source/WebCore/platform/ScrollbarTheme.h
M Source/WebCore/platform/ScrollbarThemeComposite.cpp
M Source/WebCore/platform/ScrollbarThemeComposite.h
M Source/WebKit/UIProcess/mac/WKAppKitGestureController.mm
M Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture
Tests/BasicAppKitGesturesTests.swift
Log Message:
-----------
[AppKit Gestures] Unable to grab scroll bar in Safari
https://bugs.webkit.org/show_bug.cgi?id=319227
rdar://181274217
Reviewed by Abrar Rahman Protyasha.
Clicking and dragging to grab the scroll bar in Safari wasn't working for three
reasons:
1. AppKit's internal mechanism prevented any gestures reaching
WKAppKitGestureController in the
first place in the case where the click's location was very close to the window
edge. Fix this
by telling AppKit if a point is located atop WebKit's custom scrollbar.
2. In the case where the click's location was close or near the inner edge of
the scrollbar, the
scrollbar hit testing threshold range was too narrow. Fix this by expanding the
range where applicable.
3. In WKAppKitGestureController, other gestures were preventing the mouse
tracking gesture when
clicking over the scrollbar in some cases. Fix this by preventing all gestures
when the click is
above the scrollbar (except the mouse tracking one).
Test: Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture
Tests/BasicAppKitGesturesTests.swift
* Source/WebCore/page/EventHandler.cpp:
(WebCore::scrollbarForMouseEvent):
* Source/WebCore/platform/ScrollTypes.h:
* Source/WebCore/platform/ScrollView.cpp:
(WebCore::ScrollView::scrollbarAtPoint):
* Source/WebCore/platform/ScrollView.h:
* Source/WebCore/platform/Scrollbar.cpp:
(WebCore::Scrollbar::mouseDown):
(WebCore::Scrollbar::expandedHitTestToleranceThreshold const):
* Source/WebCore/platform/Scrollbar.h:
* Source/WebCore/platform/ScrollbarTheme.h:
(WebCore::ScrollbarTheme::hitTest):
* Source/WebCore/platform/ScrollbarThemeComposite.cpp:
(WebCore::ScrollbarThemeComposite::hitTest):
* Source/WebCore/platform/ScrollbarThemeComposite.h:
Fix (2).
* Source/WebKit/UIProcess/mac/WKAppKitGestureController.mm:
(-[WKAppKitGestureController
deferringGestureRecognizer:shouldDeferGesturesForEventThatWillBeginAction:]):
(-[WKAppKitGestureController _isPointOverScrollbar:]):
(-[WKAppKitGestureController gestureRecognizerShouldBegin:]):
Fix (3).
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture
Tests/BasicAppKitGesturesTests.swift:
(AppKitGesturesTests.scrollingOnScrollBarChangesScrollPosition(_:pressAndWait:)):
A test, with parameterized combinations for all the potential failure cases
that were a result
of any of the three failing issues.
Canonical link: https://commits.webkit.org/317197@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications