Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 2c57b3458aa21f937d17c8f3ac2be0f227ca3090
https://github.com/WebKit/WebKit/commit/2c57b3458aa21f937d17c8f3ac2be0f227ca3090
Author: Wenson Hsieh <[email protected]>
Date: 2026-02-26 (Thu, 26 Feb 2026)
Changed paths:
M Source/WebKit/Shared/EditorState.cpp
M Source/WebKit/Shared/EditorState.h
M Source/WebKit/UIProcess/mac/WebViewImpl.h
M Source/WebKit/UIProcess/mac/WebViewImpl.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/EditorStateTests.mm
Log Message:
-----------
[macOS] Update the system text input context after clearing out a
user-visible selection
https://bugs.webkit.org/show_bug.cgi?id=308778
rdar://171209443
Reviewed by Abrar Rahman Protyasha.
Call `-textInputClientDidUpdateSelection` to update the system input context
following a selection
change, in the case where the selection was previously visible, and the
selection is no longer
visible ("visible" in this context, meaning that the selection is either
editable, or a ranged non-
editable selection).
* Source/WebKit/Shared/EditorState.cpp:
(WebKit::EditorState::isEditableOrRanged const):
Add a helper method on `EditorState` to represent "user visible selection".
* Source/WebKit/Shared/EditorState.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::handleProcessSwapOrExit):
(WebKit::WebViewImpl::selectionDidChange):
(WebKit::WebViewImpl::inputContextForSelectionUpdates):
(WebKit::WebViewImpl::inputContextIncludingNonEditable): Deleted.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/EditorStateTests.mm:
(TestWebKitAPI::TEST(EditorStateTests,
UnionRectInVisibleSelectedRangeAndDocumentVisibleRect)):
(TestWebKitAPI::TEST(EditorStateTests,
UnionRectInVisibleSelectedRangeForEditableCaretSelection)):
(TestWebKitAPI::TEST(EditorStateTests,
UnionRectInVisibleSelectedRangeForNonEditableRangeSelection)):
Augment existing API tests to verify that the selection is updated again, after
programmatically
clearing the selection.
Canonical link: https://commits.webkit.org/308313@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications