Bug 146446

Summary: [WK2] Avoid taking a useless / blank navigation snapshot when navigating after restoring sessionState
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, benjamin, commit-queue, thorton
Priority: P1 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 159216    
Bug Blocks:    
Attachments:
Description Flags
Patch none

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.