Bug 36347

Summary: [chromium] querying the current HistoryItem during a back/forward navigation causes loss of scroll offset and other state
Product: WebKit Reporter: Darin Fisher (:fishd, Google) <fishd>
Component: WebKit APIAssignee: Darin Fisher (:fishd, Google) <fishd>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
v1 patch dglazkov: review+

Description Darin Fisher (:fishd, Google) 2010-03-19 00:12:57 PDT
[chromium] querying the current HistoryItem during a back/forward
navigation causes loss of scroll offset and other state

which explains bugs like this:
http://code.google.com/p/chromium/issues/detail?id=12084

chrome periodically records the current history item for crash
recovery purposes, but that actually causes loss of data if the
page the user is navigating back to is even slightly slow to load.
Comment 1 Darin Fisher (:fishd, Google) 2010-03-19 00:23:59 PDT
Created attachment 51131 [details]
v1 patch

The basic fix here is to suppress updating the current history item while we are still loading.  I decided to exclude normal, new navigations since a user might start interacting with the page before it is fully loaded.  Obviously, this could be the case for other types of navigations as well, so there may be a better overall solution.  This patch is however a significant improvement for a pretty nasty data-loss bug.
Comment 2 Dimitri Glazkov (Google) 2010-03-19 08:43:16 PDT
Comment on attachment 51131 [details]
v1 patch

nice find!

Can this be regression-proofed with a test?
Comment 3 Darin Fisher (:fishd, Google) 2010-03-19 09:46:31 PDT
It would require an API test.  I was going to add such a test to Chromium.
Comment 4 Dimitri Glazkov (Google) 2010-03-19 09:56:16 PDT
Sounds good.
Comment 5 Darin Fisher (:fishd, Google) 2010-03-19 10:31:29 PDT
Landed as http://trac.webkit.org/changeset/56244