[webkit-changes] [WebKit/WebKit] 0dab99: [macOS] All Writing Tools menu items are enabled i...

Aditya Keerthi noreply at github.com
Wed Jan 22 10:11:25 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0dab99e9279ea0df37f64c3613c6bb7a637fc2d8
      https://github.com/WebKit/WebKit/commit/0dab99e9279ea0df37f64c3613c6bb7a637fc2d8
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2025-01-22 (Wed, 22 Jan 2025)

  Changed paths:
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm
    M Source/WebKit/UIProcess/mac/WebPageProxyMac.mm
    M Source/WebKit/UIProcess/mac/WebViewImpl.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WritingTools.mm

  Log Message:
  -----------
  [macOS] All Writing Tools menu items are enabled in app menus for empty editable content
https://bugs.webkit.org/show_bug.cgi?id=286310
rdar://143332082

Reviewed by Wenson Hsieh.

284869 at main fixed an issue where all Writing Tools menu items were enabled
in the context menu for empty editable content.

Implement the same policy for the menu items in the app menu:

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.

This is achieved by implementing by checking for `showWritingTools:` in
`validateUserInterfaceItem:`, and sharing the code introduced in 284869 at main.

* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::getContextMenuItem):
* Source/WebKit/UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::shouldEnableWritingToolsRequestedTool const):
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::validateUserInterfaceItem):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WritingTools.mm:
(TEST(WritingTools, AppMenuNonEditable)):
(TEST(WritingTools, AppMenuEditable)):
(TEST(WritingTools, AppMenuEditableEmpty)):

Canonical link: https://commits.webkit.org/289243@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