<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - No reliable way to get a snapshot of WKWebView (macOS)"
   href="https://bugs.webkit.org/show_bug.cgi?id=161450#c42">Comment # 42</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - No reliable way to get a snapshot of WKWebView (macOS)"
   href="https://bugs.webkit.org/show_bug.cgi?id=161450">bug 161450</a>
              from <span class="vcard"><a class="email" href="mailto:bdakin&#64;apple.com" title="Beth Dakin &lt;bdakin&#64;apple.com&gt;"> <span class="fn">Beth Dakin</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=161450#c39">comment #39</a>)
<span class="quote">&gt; Comment on <span class="bz_obsolete"><a href="attachment.cgi?id=299290&amp;action=diff" name="attach_299290" title="Patch">attachment 299290</a> <a href="attachment.cgi?id=299290&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=299290&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=299290&amp;action=review</a>
&gt; 
&gt; &gt; Source/WebKit2/UIProcess/API/Cocoa/WKSnapshotConfiguration.mm:35
&gt; &gt; +    return [self retain];
&gt; 
&gt; That's no copy :) Why is this OK?
&gt; </span >

Not okay. Fixed!

<span class="quote">&gt; &gt; Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:224
&gt; &gt; +/*! &#64;abstract Get the snapshot for the visible viewport of WKWebView asynchronously.
&gt; 
&gt; s/the snapshot/a snapshot/, I think?
&gt; </span >

Oops, forgot to fix that in this patch, I'll upload a new one shortly.

<span class="quote">&gt; &gt; Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:226
&gt; &gt; + &#64;param imageWidth The width in points of the image to return.
&gt; 
&gt; Points! Interesting choice. I guess it's reasonable?
&gt; </span >

I'm open to alternatives.

<span class="quote">&gt; &gt; Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:918
&gt; &gt; +    void(^handler)(NSImage *, NSError *) = [completionHandler copy];
&gt; 
&gt; BlockPtr?</span >

Fixed.

<span class="quote">&gt; 
&gt; &gt; Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:939
&gt; &gt; +        RetainPtr&lt;NSImage&gt; nsImage = adoptNS( [[NSImage alloc] initWithCGImage:cgImage.get() size:NSMakeSize(snapshotWidth, imageHeight)]);
&gt; 
&gt; weird space between adoptNS( and the [</span >

Fixed.

<span class="quote">&gt; 
&gt; &gt; Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:948
&gt; &gt; +    void(^handler)(UIImage *, NSError *) = [completionHandler copy];
&gt; 
&gt; BlockPtr?</span >

Fixed.

<span class="quote">&gt; 
&gt; &gt; Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:955
&gt; &gt; +        RetainPtr&lt;UIImage&gt;  uiImage;
&gt; 
&gt; weird space before uiImage</span >

Fixed.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>