[Webkit-unassigned] [Bug 161450] No reliable way to get a snapshot of WKWebView (macOS)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 17 11:52:27 PST 2017


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

Beth Dakin <bdakin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #292310|review?                     |review-
              Flags|                            |

--- Comment #37 from Beth Dakin <bdakin at apple.com> ---
Comment on attachment 292310
  --> https://bugs.webkit.org/attachment.cgi?id=292310
Patch

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

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:230
> +- (void)snapshotRect:(CGRect)rectInViewCoordinates intoImageOfWidth:(CGFloat)imageWidth completionHandler:(void(^)(UIImage * _Nullable snapshotImage, NSError * _Nullable error))completionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));

Dan, thanks so much for this patch. We have been discussing internally, and we think this signature needs to change. Instead of taking both a rect and a width, you should define a new configuration object. That will let us more easily extend this API in the future if we find that other clients have other things they want to specify about the snapshot. And we'll be able to add those features without changing the API. It should be something like:

- (void)snapshotWithConfiguration:(WKSnapshotConfiguration)snapshotConfiguration completionHandler:(void(^)(UIImage * _Nullable snapshotImage, NSError * _Nullable error))completionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));

You can take a look at WKWebViewConfiguration if you want to see a similar object and API pattern in the existing API.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170117/26f4ef8c/attachment.html>


More information about the webkit-unassigned mailing list