Bug 18992 - Reset scroll position when loading new page
: Reset scroll position when loading new page
Status: RESOLVED FIXED
: WebKit
WebKit wx
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-05-10 21:44 PST by
Modified: 2008-05-11 22:10 PST (History)


Attachments
one liner for resetting the scrollbar (456 bytes, patch)
2008-05-10 21:46 PST, Robin Dunn
mrowe: review-
Review Patch | Details | Formatted Diff | Diff
new patch to fix scrolling (11.67 KB, patch)
2008-05-11 18:02 PST, Robin Dunn
kevino: review+
Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-05-10 21:44:22 PST
In wxWebKit the scrollbar is not reset when loading a new page.  This patch fixes that.
------- Comment #1 From 2008-05-10 21:46:00 PST -------
Created an attachment (id=21060) [details]
one liner for resetting the scrollbar
------- Comment #2 From 2008-05-10 23:30:44 PST -------
(From update of attachment 21060 [details])
windowObjectCleared is definitely not the right place to be doing this.  It's likely there is some underlying issue that is leading to the incorrect behaviour you're seeing -- none of the other ports call setContentsPos from within WebKit, which suggests to me that doing so for wx is papering over an issue elsewhere.
------- Comment #3 From 2008-05-11 00:30:04 PST -------
(In reply to comment #2)
> (From update of attachment 21060 [details] [edit])
> windowObjectCleared is definitely not the right place to be doing this.  It's
> likely there is some underlying issue that is leading to the incorrect
> behaviour you're seeing -- none of the other ports call setContentsPos from
> within WebKit, which suggests to me that doing so for wx is papering over an
> issue elsewhere.
> 

Yeah, poking around some more, I think the real issue is that we don't handle FrameLoaderClientWx::transitionToCommittedForNewPage(), which deletes and re-creates the FrameView, and that's probably how all the other ports end up having their scroll positions reset.
------- Comment #4 From 2008-05-11 18:02:58 PST -------
Created an attachment (id=21075) [details]
new patch to fix scrolling

This patch does it by implementing transitionToCommittedNewPage() so the scroll positions are reset when a new page is loaded, and also maintained so that back and next restore the scroll positions as well. This also simplifies the logic for initializing and managing wxWebView.
------- Comment #5 From 2008-05-11 22:03:59 PST -------
(From update of attachment 21075 [details])
This does the trick! :-)
------- Comment #6 From 2008-05-11 22:10:18 PST -------
landed in r33036, thanks! :)