Bug 190529
| Summary: | [Cocoa] Snapshot of WKWebView after Presentation Updates | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jeffrey Deng <jeffrey> |
| Component: | WebKit API | Assignee: | 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
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/45238525>