<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@apple.com" title="Beth Dakin <bdakin@apple.com>"> <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">> Comment on <span class="bz_obsolete"><a href="attachment.cgi?id=299290&action=diff" name="attach_299290" title="Patch">attachment 299290</a> <a href="attachment.cgi?id=299290&action=edit" title="Patch">[details]</a></span>
> Patch
>
> View in context:
> <a href="https://bugs.webkit.org/attachment.cgi?id=299290&action=review">https://bugs.webkit.org/attachment.cgi?id=299290&action=review</a>
>
> > Source/WebKit2/UIProcess/API/Cocoa/WKSnapshotConfiguration.mm:35
> > + return [self retain];
>
> That's no copy :) Why is this OK?
> </span >
Not okay. Fixed!
<span class="quote">> > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:224
> > +/*! @abstract Get the snapshot for the visible viewport of WKWebView asynchronously.
>
> s/the snapshot/a snapshot/, I think?
> </span >
Oops, forgot to fix that in this patch, I'll upload a new one shortly.
<span class="quote">> > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:226
> > + @param imageWidth The width in points of the image to return.
>
> Points! Interesting choice. I guess it's reasonable?
> </span >
I'm open to alternatives.
<span class="quote">> > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:918
> > + void(^handler)(NSImage *, NSError *) = [completionHandler copy];
>
> BlockPtr?</span >
Fixed.
<span class="quote">>
> > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:939
> > + RetainPtr<NSImage> nsImage = adoptNS( [[NSImage alloc] initWithCGImage:cgImage.get() size:NSMakeSize(snapshotWidth, imageHeight)]);
>
> weird space between adoptNS( and the [</span >
Fixed.
<span class="quote">>
> > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:948
> > + void(^handler)(UIImage *, NSError *) = [completionHandler copy];
>
> BlockPtr?</span >
Fixed.
<span class="quote">>
> > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:955
> > + RetainPtr<UIImage> uiImage;
>
> 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>