Add afterScreenUpdates to WKSnapshotConfiguration
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Feb 2019 18:20:12 +0000 (18:20 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Feb 2019 18:20:12 +0000 (18:20 +0000)
commit07062fb886b14ce4916ed4b9baa10648f0466e32
tree72a24250f867e62a7fd7370c42a766733c6999b7
parentef80851836cc78d89e21d9fa194efab806fb6ef0
Add afterScreenUpdates to WKSnapshotConfiguration
https://bugs.webkit.org/show_bug.cgi?id=194362
-and corresponding-
<rdar://problem/40655528> Please add an "after screen updates" property to
WKSnapshotConfiguration (to solve blank snapshots)

Reviewed by Tim Horton.

Source/WebKit:

This is the WebKit equivalent of - (UIView *)snapshotViewAfterScreenUpdates:(BOOL)afterUpdates;
This makes our snapshotting API more predictable and reliable on iOS devices,
which is why the new configuration property defaults to YES.

New property that defaults to YES.
* UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
* UIProcess/API/Cocoa/WKSnapshotConfiguration.mm:
(-[WKSnapshotConfiguration init]):
(-[WKSnapshotConfiguration copyWithZone:]):

When afterScreenUpdates is set, invoke the snapshot via
callAfterNextPresentationUpdate.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
(-[WKWebView _callCompletionHandler:withSnapshotImage:atDeviceScale:]):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewSnapshot.mm:
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKSnapshotConfiguration.h
Source/WebKit/UIProcess/API/Cocoa/WKSnapshotConfiguration.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewSnapshot.mm