[webkit-gtk] WK2: WebKitWebViel scrolling

Julian Scheel julian at jusst.de
Sun Jul 29 09:18:14 PDT 2012


Hi,

Am 29.07.2012 um 11:47 schrieb Carlos Garcia Campos <cgarcia at igalia.com>:
>> I am just porting an application which we wrote with WebKit1 gtk API to
>> the new WebKit2 API. While doing this I ran into some trouble with the
>> scrolling behaviour. As of WebKit1 the WebKitWebView component did not
>> seem to be scrollable at all, so one hat to contain it in a
>> GtkScrolledWindow using a Viewport. 
> 
> you shouldn't need a viewport in WebKit1, just a GtkScrolledWindow,
> since WebKitWebView implements GtkScrollable.

Ok, agreed - but it actually worked with a Viewport as well.

>> Now WebKit2 seems to be scrollable
>> itself.
> 
> Yes.
> 
>> This would not be a problem, if if would implement the
>> GtkScrollable interface, which it does not seem to do?
> 
> No, since it's scrollable by itself, you don't need to add the view to a
> GtkScrolledWindow, and that's the reason why it doesn't implement the
> GtkScrollable interface.

Ok.

>> Due to this it is not possible to embed the WebKitWebView in a
>> GtkScrolledWindow anymore, which prevents us from using the nice
>> features like kinetic-scrolling which GtkScrolledWindow provides as of
>> gtk 3.4.
> 
> Those features will be implemented in WebKit itself. 

Does this really make sense? In the end it will lead to code duplication - or even worse a different implementation of kinetic-scrolling then Gtk itself does. This may lead to an inconsistent feeling for the enduser when the WebKitWebView scrolling behaviour (speed, etc.) is different to what Gtk itself implements.

>> So am I actually missing anything and what I want to do is still
>> possible? Or should we try to patch the WebKitWebView to implement
>> GtkScrollable?
> 
> We don't have enough information in the UI process about the scrollbars
> to be able to implement the GtkScrollable interface. So, for now you can
> just port your application to WebKit2 and those features will be added
> in the future. If you want to contribute, it would be more useful to
> work on adding touch and kinetic scrolling support to WebKit rather than
> trying to make WebKitWebView implement the GtkScrollable interface.
> Tomeu already has a patch to add initial touch support to WebKit clutter
> that can be reused in WebKitGTK+.

Is this patch posted anywhere yet? I would take a look at it and port to WebKitGTK if it does what we need.

> Thanks for the feedback, feel free to ask here anything you need to port
> your application or any comment about the new API.

Thanks, our port is already complete and seems to be working quite well. Just the missing kinetic-scrolling (in gtk2 we had our own implementation of it) is stopping us from finally switching to WebKit2 API with gtk3.

Regards,
Julian


More information about the webkit-gtk mailing list