[Webkit-unassigned] [Bug 215943] New: WKUIDelegate's contextMenuConfigurationForElement API method isn't called for images

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 28 12:15:49 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=215943

            Bug ID: 215943
           Summary: WKUIDelegate's contextMenuConfigurationForElement API
                    method isn't called for images
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit API
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ajuma at chromium.org
                CC: achristensen at apple.com, beidson at apple.com,
                    dino at apple.com, gambard at chromium.org,
                    rohitrao at google.com

The public API method -[WKUIDelegate webView:contextMenuConfigurationForElement:completionHandler] is only called for links, not for images. The SPI version (-[WKUIDelegate _webView:contextMenuConfigurationForElement:completionHandler]) does get called for images.

This means that WKWebView embedders cannot easily customize the context menu shown for images.

The logic for this is in -[WKContentViewInteraction continueContextMenuInteraction:], which does:
 if (_positionInformation.isLink && [uiDelegate respondsToSelector:@selector(webView:contextMenuConfigurationForElement:completionHandler:)]) {
     .....
 } else if ([uiDelegate respondsToSelector:@selector(_webView:contextMenuConfigurationForElement:completionHandler:)]) {
     .....
 }

Could we change the first condition to also include |_positionInformation.isImage|?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200828/75f921e5/attachment.htm>


More information about the webkit-unassigned mailing list