VERIFIED FIXED Bug 13422
REGRESSION: Page reload loses page position
https://bugs.webkit.org/show_bug.cgi?id=13422
Summary REGRESSION: Page reload loses page position
Justin
Reported 2007-04-20 16:08:44 PDT
In the last several nightly builds (a few weeks, I believe), page reload behavior has changed slightly (in my opinion, it has broken). Reloading the page usually has normally returned the user to the position on the page the user was viewing prior to reloading, but now, the page is reloaded and the very top is displayed. I did find an open bug (http://bugs.webkit.org/show_bug.cgi?id=10223) related to seemingly sporadic reload behavior scroll position on pages with frames, but that bug is much older than this one, and this one occurs on pages without frames.
Attachments
Proposed patch (1.81 KB, patch)
2007-08-06 01:10 PDT, Cameron Zwarich (cpst)
beidson: review-
Proposed patch with test case (3.07 KB, patch)
2007-08-07 20:28 PDT, Cameron Zwarich (cpst)
beidson: review+
Brady Eidson
Comment 1 2007-04-20 16:19:15 PDT
Oh no, this is not good! Can you regress this using the nightlies to find out when this broke?
Justin
Comment 2 2007-04-20 16:48:53 PDT
Why certainly. It worked up through revision 17354, and stopped working in 17388.
Brady Eidson
Comment 3 2007-04-20 17:02:04 PDT
Thanks! That'll probably be a big help. Unfortunately, I know off the top of my hand thats when major loader refactoring was going on - many large patches completely upsetting the balance. I'll take a look at that range
Brady Eidson
Comment 4 2007-04-20 17:08:34 PDT
Yup, my fears confirmed http://trac.webkit.org/projects/webkit/changeset/17365 seems to be an extremely likely culrpit, though a few others in that range might be as well... These "moving and renaming" patches often do more than just that (unintentionally of course)
Darin Adler
Comment 5 2007-04-23 08:39:50 PDT
Cameron Zwarich (cpst)
Comment 6 2007-08-05 02:13:58 PDT
I can confirm that this regression is indeed caused by r17365. I will try to hunt down the exact change that causes it and hopefully come up with a patch.
Cameron Zwarich (cpst)
Comment 7 2007-08-06 01:10:53 PDT
Created attachment 15846 [details] Proposed patch Here is a patch that fixes the bug. In revision 17365, many Objective C method bodies in WebFrame were moved to the C++ wrapper class WebFrameLoaderClient for performance reasons. However, in copying the updateHistoryForReload() method, a small error was introduced. In the original method, currItem is made the current history item of the frame: WebHistoryItem *currItem = _private->currentItem; In the copied version, this is changed to WebHistoryItem *currItem = m_webFrame->_private->previousItem; This patch corrects that change, which was carried over into the new loader code.
Mark Rowe (bdash)
Comment 8 2007-08-06 02:34:42 PDT
Comment on attachment 15846 [details] Proposed patch This feels like it should be testable in a layout test. It'd be handy to have a test around so we can be sure we don't reintroduce this regression in the future.
Brady Eidson
Comment 9 2007-08-07 13:06:12 PDT
Comment on attachment 15846 [details] Proposed patch Looks like a good fix, and good catch on the mistake in the patch that caused the original regression. r- because there is no layout test and this should be layout-testable We'd be happy to help you write one (#webkit on irc.freenode.net) but you can also refer to the other layout tests for guidance
Cameron Zwarich (cpst)
Comment 10 2007-08-07 20:28:11 PDT
Created attachment 15863 [details] Proposed patch with test case Here is the patch with a test case. It turns out that the success200-reload test was designed to scroll the document and record the change, but nobody ever checked if it scrolled in the test output when it was made. I always run the layout tests after adding a fix, so I must have accidentally been running them for the older version of the tree I was using to find the bug.
Brady Eidson
Comment 11 2007-08-08 09:38:02 PDT
Comment on attachment 15863 [details] Proposed patch with test case HAH. Very cool.
Brady Eidson
Comment 12 2007-08-08 09:44:04 PDT
Justin
Comment 13 2007-08-09 11:24:08 PDT
Thanks all, I've confirmed that this is working now. It's not clear to me whether I'm supposed to change the status, but I consider the bug fixed.
Brady Eidson
Comment 14 2007-08-09 11:27:46 PDT
Mark it as verified, since you've VERIFIED it is fixed =D
Justin
Comment 15 2007-08-09 12:42:02 PDT
Verified :)
Cameron Zwarich (cpst)
Comment 16 2007-08-12 22:36:05 PDT
I should note that this bug was actually noticed the day it was introduced by the person who introduced it: http://trac.webkit.org/projects/webkit/changeset/17368 We should probably be more careful to check changed test results in the future.
Darin Adler
Comment 17 2007-08-22 18:12:46 PDT
(In reply to comment #16) > I should note that this bug was actually noticed the day it was introduced by > the person who introduced it: > > http://trac.webkit.org/projects/webkit/changeset/17368 > > We should probably be more careful to check changed test results in the future. My bad!
Note You need to log in before you can comment on or make changes to this bug.