Add WKWebView private API to save a back/forward snapshot so that the client can make sure a back/forward snapshot is available even when swapping WKWebView upon navigation.
rdar://problem/21584231
Is this something the existing session state API can do?
(In reply to comment #2) > Is this something the existing session state API can do? I will check. I was trying to match the way we currently do this on Mac: in WKViewPrivate.h - (void)saveBackForwardSnapshotForItem:(WKBackForwardListItemRef)item;
(In reply to comment #2) > Is this something the existing session state API can do? Please see comment on radar.
Created attachment 255729 [details] Patch
Comment on attachment 255729 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=255729&action=review > Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h:212 > +- (void)_saveBackForwardSnapshotForItem:(WKBackForwardListItem *)item WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA); Can this be used on an item that isn’t the current item? What does it do in that case?
Comment on attachment 255729 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=255729&action=review >> Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h:212 >> +- (void)_saveBackForwardSnapshotForItem:(WKBackForwardListItem *)item WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA); > > Can this be used on an item that isn’t the current item? What does it do in that case? Yes, it can and it is the intended use. On Mac, we have both saveBackForwardSnapshotForItem(item) and saveBackForwardSnapshotForCurrentItem(). What it does in this case is take a snapshot of the current view and save it on the WKBackForwardListItem that is given. The WKBackForwardListItem being given in this case would be from another WKWebView.
Comment on attachment 255729 [details] Patch Clearing flags on attachment: 255729 Committed r186077: <http://trac.webkit.org/changeset/186077>
All reviewed patches have been landed. Closing bug.