[webkit-reviews] review granted: [Bug 227240] [macOS] [WebKitLegacy] Non-actionable "Look Up" action appears when right clicking images : [Attachment 431927] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 21 16:39:37 PDT 2021


Devin Rousso <drousso at apple.com> has granted Wenson Hsieh
<wenson_hsieh at apple.com>'s request for review:
Bug 227240: [macOS] [WebKitLegacy] Non-actionable "Look Up" action appears when
right clicking images
https://bugs.webkit.org/show_bug.cgi?id=227240

Attachment 431927: Patch

https://bugs.webkit.org/attachment.cgi?id=431927&action=review




--- Comment #2 from Devin Rousso <drousso at apple.com> ---
Comment on attachment 431927
  --> https://bugs.webkit.org/attachment.cgi?id=431927
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=431927&action=review

r=me

> Source/WebCore/loader/EmptyClients.cpp:135
> +    bool supportsLookUpInImages() final { return true; }

Is this `true` because it's used in tests?  Or are we assuming it's supported
everywhere but WK1?

> LayoutTests/fast/events/contextmenu-lookup-action-for-image.html:15
> +    foundLookUpItem = false;
> +    for (let item of eventSender.contextClick()) {
> +	   let title = item.title || item;
> +	   if (title.includes?.("Look Up"))
> +	       foundLookUpItem = true;
> +    }

FYI you could rework this to be on one line :)
```
    let foundLookUpItem = eventSender.contextClick().some((item) => (item.title
|| item).includes?.("Look Up"));
```


More information about the webkit-reviews mailing list