[webkit-changes] [WebKit/WebKit] a3cb10: [Writing Tools] Only "Compose" and "Show Writing T...
Aditya Keerthi
noreply at github.com
Tue Oct 8 22:22:25 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a3cb1059253c11dbd1dab16a3e98ced39ef52e1d
https://github.com/WebKit/WebKit/commit/a3cb1059253c11dbd1dab16a3e98ced39ef52e1d
Author: Aditya Keerthi <akeerthi at apple.com>
Date: 2024-10-08 (Tue, 08 Oct 2024)
Changed paths:
M Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/WritingTools.mm
Log Message:
-----------
[Writing Tools] Only "Compose" and "Show Writing Tools" menu items should be enabled for empty editable content
https://bugs.webkit.org/show_bug.cgi?id=281043
rdar://137477065
Reviewed by Abrar Rahman Protyasha and Richard Robinson.
Currently, all items in the Writing Tools submenu are always enabled. This patch
adjusts the behavior to match the rest of the system.
1. "Show Writing Tools" should always be enabled.
2. "Compose" should only be enabled in editable content.
3. Other tools should be enabled if the content is non-editable, or if the editable content is non-empty.
* Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::getContextMenuItem):
Use `paragraphContextForCandidateRequest` as a proxy to detect whether or not
the editable content is empty.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WritingTools.mm:
(TEST(WritingTools, ContextMenuItemsNonEditable)):
(TEST(WritingTools, ContextMenuItemsEditable)):
(TEST(WritingTools, ContextMenuItemsEditableEmpty)):
Canonical link: https://commits.webkit.org/284869@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list