[WebKit-devel] Patch: restore scrollbar position and more

Dawit A. adawit at kde.org
Tue Oct 20 23:40:57 CEST 2009


Cedric,

Well, your patch takes the right approach to solve this problem, but I wish it 
was that easy to implement/fix the history navigation syncing issue. Anyhow, 
here are few scenarios where your patch in its current form will simply fail:

#1. Navigating back or forth to the nth item instead of the very last one.
In such cases, your check for history navigation will likely fail even though 
the url is in history and you will end up simply opening the page as we do now 
which will result in the history lists being out of sync.

#2. When navigating sites that use frames to separate content and navigation. 
In such cases, the main url stored by Konqueror, well actually 
KParts::BrowserExtension::saveState(...), is the parent url which never 
changes since the site is frame based. As such you cannot easily tell which 
direction the user is attempting to navigate as both the variables you stored 
can be exactly the same at a given point.

#3. The user types a url that matches the ones stored in either one of those 
two variables. In such cases, you inadvertantly navigate to those locations 
which results in the history lists being out of sync.

You run into even more complicated issues when you attempt to deal with some 
of the problems outlined above. It is relatively easy to fix #3 by saving some 
sort of meta data in WebKitPartExtension::saveState to indicate where the 
openUrl request originated...

Anyhow, a new patch will be forth coming to address most of the issues 
outlined above as well as "the page is not restored to the correct scrolled 
position" bug soon...


On Tuesday 20 October 2009 13:35:16 Cédric Bellegarde wrote:
> https://bugs.kde.org/show_bug.cgi?id=211065
> 
> I've worked on fixing my bug report...
> 
> I first try to enhance  Dawit commit but having full navigation scrollbar
> position history was a really bad option.
> 
> I search another way to do, in fact, qtwebkit already store navigation
> scrollbar position history.
> 
> So, here a patch making openUrl in kpart use QWebPage::Forward and
> QWebPage::Back instead of loading a new page.
> 
> Side effect:
> - Qt webkit history is now in sync with konqueror: With current code,
>  history is never managed, it contain all visited pages
> - Scrollbar position is restored via qtwebkit
> 
> Cédric
> 


More information about the WebKit-devel mailing list