[webkit-changes] [WebKit/WebKit] 4d608c: "Look Up" and "Copy Subject" context menu items ar...

Richard Robinson noreply at github.com
Wed Jan 10 15:01:28 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4d608c217abcf334bf7ffd7b0848dece20489494
      https://github.com/WebKit/WebKit/commit/4d608c217abcf334bf7ffd7b0848dece20489494
  Author: Richard Robinson <richard_robinson2 at apple.com>
  Date:   2024-01-10 (Wed, 10 Jan 2024)

  Changed paths:
    M Source/WebKit/Shared/WebContextMenuItemData.h
    M Source/WebKit/UIProcess/API/Cocoa/_WKElementAction.h
    M Source/WebKit/UIProcess/API/Cocoa/_WKElementAction.mm
    M Source/WebKit/UIProcess/API/Cocoa/_WKElementActionInternal.h
    M Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
    M Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm

  Log Message:
  -----------
  "Look Up" and "Copy Subject" context menu items are added after the menu is visible, which changes the current item under the cursor
https://bugs.webkit.org/show_bug.cgi?id=267138
rdar://111049353

Reviewed by Aditya Keerthi.

Show the items as disabled instead of hiding the "Copy Subject" and "Look Up" items until they are
ready to be used.

Note that this has the consequence that these items may never change from the disabled state to the
enabled state if it turns out an image isn't actually eligible for a given item.

* Source/WebKit/Platform/cocoa/ImageAnalysisUtilities.mm:
(WebKit::requestBackgroundRemoval):
* Source/WebKit/Shared/WebContextMenuItemData.h:
(WebKit::WebContextMenuItemData::setEnabled):
* Source/WebKit/UIProcess/API/Cocoa/_WKElementAction.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKElementAction.mm:
(-[_WKElementAction _initWithTitle:actionHandler:type:assistant:disabled:]):
(+[_WKElementAction elementActionWithTitle:actionHandler:]):
(+[_WKElementAction _elementActionWithType:title:actionHandler:]):
(+[_WKElementAction _elementActionWithType:customTitle:assistant:disabled:]):
(+[_WKElementAction _elementActionWithType:info:assistant:]):
(+[_WKElementAction _elementActionWithType:info:assistant:disabled:]):
(+[_WKElementAction elementActionWithType:customTitle:]):
(-[_WKElementAction uiActionForElementInfo:]):
(-[_WKElementAction _initWithTitle:actionHandler:type:assistant:]): Deleted.
(+[_WKElementAction _elementActionWithType:customTitle:assistant:]): Deleted.
* Source/WebKit/UIProcess/API/Cocoa/_WKElementActionInternal.h:
* Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
(-[WKActionSheetAssistant defaultActionsForImageSheet:]):
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _insertDynamicImageAnalysisContextMenuItemsIfPossible]):
* Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::getContextMenuFromItems):

Canonical link: https://commits.webkit.org/272869@main




More information about the webkit-changes mailing list