NEW 33931
pushstate() from within a popstate handler might lead to improper scroll/view state being incorrect later
https://bugs.webkit.org/show_bug.cgi?id=33931
Summary pushstate() from within a popstate handler might lead to improper scroll/view...
Brady Eidson
Reported 2010-01-20 18:07:13 PST
pushstate() from within a popstate handler might lead to improper scroll/view state being incorrect later See the test case in https://bugs.webkit.org/show_bug.cgi?id=33830 for reference. Since the popstate event - fired from within FrameLoader::loadInSameDocument() called from FrameLoader::navigateWithinDocument() - can effectively change the current history item, the later call to history()->restoreScrollPositionAndViewState() will be operating on the wrong "current history item" from the perspective of the load. There's a lot of complexity here in getting this precisely right, especially since popstate events might nest and we'd probably only want to restore the scroll/view state from the most recently popped item.
Attachments
Darin Fisher (:fishd, Google)
Comment 1 2010-01-22 00:27:58 PST
We should be very careful here since history()->restoreScrollPositionAndViewState() may lead to the scroll event being dispatched. Can the app do other things within the popstate event that could cause the scroll event to be confusing to the app? (This re-entrancy stuff gives me a headache!)
Justin Lebar
Comment 2 2010-06-29 14:13:53 PDT
Justin Lebar
Comment 3 2010-06-29 14:14:15 PDT
Oops, wrong bug. Sorry!
Note You need to log in before you can comment on or make changes to this bug.