Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a3cb1059253c11dbd1dab16a3e98ced39ef52e1d
      
https://github.com/WebKit/WebKit/commit/a3cb1059253c11dbd1dab16a3e98ced39ef52e1d
  Author: Aditya Keerthi <[email protected]>
  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
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to