[webkit-reviews] review granted: [Bug 236628] [macOS] Add a "Markup Image" item to the sharing services picker context menu : [Attachment 452098] Fix Big Sur build

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 15 15:44:56 PST 2022


Darin Adler <darin at apple.com> has granted Wenson Hsieh
<wenson_hsieh at apple.com>'s request for review:
Bug 236628: [macOS] Add a "Markup Image" item to the sharing services picker
context menu
https://bugs.webkit.org/show_bug.cgi?id=236628

Attachment 452098: Fix Big Sur build

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




--- Comment #4 from Darin Adler <darin at apple.com> ---
Comment on attachment 452098
  --> https://bugs.webkit.org/attachment.cgi?id=452098
Fix Big Sur build

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

> Source/WebCore/dom/mac/ImageControlsMac.cpp:144
>      if (ImageControlsMac::isImageControlsButtonElement(node)) {
> -	   auto shadowHost = node.shadowHost();
> +	   RefPtr shadowHost = node.shadowHost();
>	   if (!is<HTMLImageElement>(*shadowHost))
>	       return false;
>	   if (auto* image = imageFromImageElementNode(*shadowHost)) {

This mix of early return and nested if doesn’t seem logical. Either 3 nested if
statements or 3 early returns would be better than 2 and 1.


More information about the webkit-reviews mailing list