Bug 190529

Summary: [Cocoa] Snapshot of WKWebView after Presentation Updates
Product: WebKit Reporter: Jeffrey Deng <jeffrey>
Component: WebKit APIAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Enhancement CC: simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: iPhone / iPad   
OS: iOS 11   

Jeffrey Deng
Reported 2018-10-12 11:18:46 PDT
The current implementation of WKWebView's take snapshot, - (void)takeSnapshotWithConfiguration:(nullable WKSnapshotConfiguration *)snapshotConfiguration completionHandler:(void (^)(UIImage * _Nullable snapshotImage, NSError * _Nullable error))completionHandler WK_API_AVAILABLE(ios(11.0));, does not allow us to wait for any presentation updates that may be pending before it takes the snapshot of the WKWebView. This causes certain snapshots to render blank or incorrect if taken at an inappropriate time. For example, when you take a snapshot after receiving `didFinishNavigation` the snapshot will result in a white image. A potential solution is to queue the take snapshot function via WKWebView's do after next presentation update function, - (void)_doAfterNextPresentationUpdate:(void (^)(void))updateBlock WK_API_AVAILABLE(macosx(10.13.4));
Attachments
Radar WebKit Bug Importer
Comment 1 2018-10-12 14:58:33 PDT
Note You need to log in before you can comment on or make changes to this bug.