Bug 36347 - [chromium] querying the current HistoryItem during a back/forward navigation causes loss of scroll offset and other state
Summary: [chromium] querying the current HistoryItem during a back/forward navigation ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Darin Fisher (:fishd, Google)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-19 00:12 PDT by Darin Fisher (:fishd, Google)
Modified: 2010-03-19 10:31 PDT (History)
1 user (show)

See Also:


Attachments
v1 patch (1.76 KB, patch)
2010-03-19 00:23 PDT, Darin Fisher (:fishd, Google)
dglazkov: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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