[webkit-gtk] Gtk and html content in the same scroll view

Robert Schroll rschroll at gmail.com
Tue Sep 22 20:45:29 PDT 2015

On Tue, Sep 22, 2015 at 5:02 PM, Matthew Watson <mattdangerw at gmail.com> 
> Thanks! This looks like a WebKit1 solution right?

Correct.  I had assumed that it'd be easy to move to WebKit2, but I 
didn't know about this:

> We were looking for a way to do this with WebKit2, which gets a lot 
> trickier because webkit handles all scrolling internally


Another approach that I toyed with in Geary was to increase the height 
of the webview until it required no scrolling.  This could be put in a 
Gtk.Layout or similar, which would handle scrolling.  Unfortunately, 
this fails if your HTML content ever decreases in height.  I could find 
no way (short of polling) to find out when this happens and adjust the 
webview's size.  Maybe this isn't a concern for you.

Of course, you need to access the DOM to find the content height, and...

> and you can't access the dom without registering a plugin inside the 
> WebProcess.

This may not be quite as bad as you're imagining it, at least if you're 
developing new code.  Michael Catanzaro and I put together a 
demonstration of communicating with a plugin in the web process over 
DBus [1].  But as you say, trying to synchronize scrolling between two 
processes is a scary proposition.

Good luck,

[1] https://github.com/rschroll/webkitdom/tree/extension

More information about the webkit-gtk mailing list