Bug 146446 - [WK2] Avoid taking a useless / blank navigation snapshot when navigating after restoring sessionState
Summary: [WK2] Avoid taking a useless / blank navigation snapshot when navigating afte...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P1 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on: 159216
Blocks:
  Show dependency treegraph
 
Reported: 2015-06-29 18:55 PDT by Chris Dumez
Modified: 2016-06-28 10:39 PDT (History)
4 users (show)

See Also:


Attachments
Patch (4.36 KB, patch)
2015-06-29 19:13 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2015-06-29 18:55:47 PDT
We currently take a useless / blank navigation snapshot when navigating after restoring the back / forward list from a sessionState object. This is because we get a current HistoryItem from the sessionState which we have never really navigated to. We then take a navigation snapshot for the current HistoryItem when navigating away as we usually do. However, in this case, the HistoryItem was imported and there is nothing to snapshot.

Taking this snapshot is not only wasteful, it can also potentially overwrite the snapshot that was set by the client using WKWebView._saveBackForwardSnapshotForItem() SPI.

To address the problem, my proposal is to suppress navigation snapshotting after restoring the back / forward list from a session state until the next committed load.
Comment 1 Chris Dumez 2015-06-29 18:56:03 PDT
rdar://problem/21584231
Comment 2 Chris Dumez 2015-06-29 19:13:45 PDT
Created attachment 255805 [details]
Patch
Comment 3 Chris Dumez 2015-06-30 11:09:13 PDT
Comment on attachment 255805 [details]
Patch

Clearing flags on attachment: 255805

Committed r186122: <http://trac.webkit.org/changeset/186122>
Comment 4 Chris Dumez 2015-06-30 11:09:18 PDT
All reviewed patches have been landed.  Closing bug.