Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: df21793e6c19f998711912d0165fcd3d57d6ebb1
https://github.com/WebKit/WebKit/commit/df21793e6c19f998711912d0165fcd3d57d6ebb1
Author: Richard Robinson <[email protected]>
Date: 2026-02-03 (Tue, 03 Feb 2026)
Changed paths:
M Source/WebKit/Modules/Internal/module.modulemap
M Source/WebKit/Platform/spi/mac/AppKitSPI.h
M Source/WebKit/Shared/API/APIObject.h
M Source/WebKit/Shared/ios/WebAutocorrectionData.h
A Source/WebKit/UIProcess/API/Cocoa/Logger+Extras.swift
M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
A Source/WebKit/UIProcess/WebPageProxy.swift
M Source/WebKit/UIProcess/mac/WKAppKitGestureController.h
M Source/WebKit/UIProcess/mac/WKAppKitGestureController.mm
A Source/WebKit/UIProcess/mac/WKTextSelectionController.h
A Source/WebKit/UIProcess/mac/WKTextSelectionController.swift
M Source/WebKit/UIProcess/mac/WebViewImpl.h
M Source/WebKit/UIProcess/mac/WebViewImpl.mm
M Source/WebKit/WebKit.xcodeproj/project.pbxproj
M Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp
M Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h
M Source/WebKit/WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm
M Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
M Source/WebKit/WebProcess/WebPage/WebPage.h
M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
Log Message:
-----------
[AppKit Gestures] Add initial support for handling clicks during text
selection
https://bugs.webkit.org/show_bug.cgi?id=306749
rdar://169422675
Reviewed by Abrar Rahman Protyasha.
Set up initial support for text interaction, starting with click handling.
* Source/WebKit/Modules/Internal/module.modulemap:
* Source/WebKit/Platform/IPC/MessageReceiver.h:
* Source/WebKit/Shared/API/APIObject.h:
* Source/WebKit/Shared/ios/WebAutocorrectionData.h:
Add missing modules, header includes, and compilation guards.
* Source/WebKit/Platform/spi/mac/AppKitSPI.h:
Add forward declarations.
* Source/WebKit/UIProcess/API/Cocoa/Logger+Extras.swift: Added.
Set up infrastructure for a consistent and cohesive Swift Logging mechanism in
WebKit.
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
When the WKWebView is being initialized, set up the text selection manager on
the impl's
text selection controller.
* Source/WebKit/UIProcess/WebPageProxy.swift: Added.
(WebKit.editorStateCopy):
(WebKit.editorState):
- Add an async helper function around `selectWithGestures` to make it more
pleasant to use.
- Encapsulate the unsafety of accessing `editorState` in a computed property.
* Source/WebKit/UIProcess/mac/WKAppKitGestureController.mm:
(-[WKAppKitGestureController
gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
Allow both the webkit click gesture and the AppKit click gesture to be
recognized at the same time.
* Source/WebKit/UIProcess/mac/WKTextSelectionController.h:
* Source/WebKit/UIProcess/mac/WKTextSelectionController.swift: Added.
(WKTextSelectionController.addTextSelectionManager):
(WKTextSelectionController.isTextSelected(at:)):
(WKTextSelectionController.moveInsertionCursor(to:)):
(WKTextSelectionController.handleClick(at:)):
(WKTextSelectionController.showContextMenu(at:)):
(WKTextSelectionController.dragSelection(withGesture:completionHandler:)):
(WKTextSelectionController.beginRangeSelection(at:with:)):
(WKTextSelectionController.continueRangeSelection(at:)):
(WKTextSelectionController.endRangeSelection(at:)):
Create a new WKTextSelectionController type to control the text interaction and
act as
a delegate for the text selection manager.
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::m_flagsChangedEventMonitorTrackingArea):
(WebKit::WebViewImpl::addTextSelectionManager):
WebViewImpl will now own a WKTextSelectionController
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::shouldAllowSingleClickToChangeSelection const):
* Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h:
* Source/WebKit/WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
(WebKit::WebEditorClient::shouldAllowSingleClickToChangeSelection const):
Deleted.
* Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::shouldAllowSingleClickToChangeSelection):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::shouldAllowSingleClickToChangeSelection): Deleted.
Expose this function on macOS with minimal differences.
Canonical link: https://commits.webkit.org/306753@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications