Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9e74eac7aaebc36b060438a12ba9f63ac4fafd30
https://github.com/WebKit/WebKit/commit/9e74eac7aaebc36b060438a12ba9f63ac4fafd30
Author: Richard Robinson <[email protected]>
Date: 2026-06-15 (Mon, 15 Jun 2026)
Changed paths:
M Source/WebKit/Shared/Cocoa/InteractionInformationAtPosition.h
M Source/WebKit/Shared/Cocoa/InteractionInformationAtPosition.mm
M
Source/WebKit/Shared/Cocoa/InteractionInformationAtPosition.serialization.in
M Source/WebKit/UIProcess/mac/WKAppKitGestureController.mm
M Source/WebKit/WebProcess/WebPage/Cocoa/PositionInformationForWebPage.mm
M Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKitGesturesTests.swift
Log Message:
-----------
[AppKit Gestures] REGRESSION(313984@main): Long press over non-editable text
does not produce word selection
https://bugs.webkit.org/show_bug.cgi?id=317182
rdar://179184036
Reviewed by Abrar Rahman Protyasha.
313984@main added `_secondaryClickGestureRecognizer` which synthesizes a right
mouse-down/up to show
a context menu. Its begin gate, `-_secondaryClickShouldBeginAtLocation:`,
started the gesture whenever
the position was `isSelectable()`. But `Selectable` only means selection is
permitted there (it's true
both over a real run of text and over empty-but-selectable page background.) So
the secondary click
fired over actual words, suppressing the text-selection manager's word
selection.
`isSelectable()` cannot distinguish "a word is here" from "empty selectable
area", so this adds an
explicit signal. The secondary click now owns selectable points that are not
over text (e.g. the page
background); over a run of selectable text the text-selection manager wins, so
a long press selects the
word as before.
Test: Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKitGesturesTests.swift
* Source/WebKit/Shared/Cocoa/InteractionInformationAtPosition.h:
* Source/WebKit/Shared/Cocoa/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::InteractionInformationAtPosition):
* Source/WebKit/Shared/Cocoa/InteractionInformationAtPosition.serialization.in:
* Source/WebKit/UIProcess/mac/WKAppKitGestureController.mm:
(-[WKAppKitGestureController _secondaryClickShouldBeginAtLocation:]):
* Source/WebKit/WebProcess/WebPage/Cocoa/PositionInformationForWebPage.mm:
(WebKit::selectionPositionInformation):
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKitGesturesTests.swift:
(AppKitGesturesTests.longPressOverTextSelectsWordAndDoesNotOpenContextMenu):
Canonical link: https://commits.webkit.org/315270@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications