views:

4

answers:

0

I'm just starting to explore the use of libwebkit in GTK+ applications on Ubuntu 10.04. I was curious about whether SVG with SMIL animation would be supported, so I created a small test using python-webkit:

import gtk 
import webkit 

view = webkit.WebView() 

sw = gtk.ScrolledWindow() 
sw.add(view) 

win = gtk.Window(gtk.WINDOW_TOPLEVEL) 
win.add(sw) 
win.show_all() 

view.open("http://live.echo-flow.com/svg/scrolling-colors.svg") 

gtk.main()

This opens a GTK window, instantiates the webkit renderer, and navigates to http://live.echo-flow.com/svg/scrolling-colors.svg

The expected behaviour is for the colors to scroll horizontally. Unfortunately, the colors are static. Furthermore, for some reason the program also starts the JVM, as can be seen by the output in the console:

** (browser.py:3731): DEBUG: NP_Initialize
** (browser.py:3731): DEBUG: NP_Initialize succeeded
** (browser.py:3731): DEBUG: NP_Initialize
** (browser.py:3731): DEBUG: NP_Initialize succeeded
** (browser.py:3731): DEBUG: NP_Initialize
** (browser.py:3731): DEBUG: NP_Initialize succeeded
** (browser.py:3731): DEBUG: NP_Initialize
** (browser.py:3731): DEBUG: NP_Initialize succeeded
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8.1) (6b18-1.8.1-0ubuntu1)
OpenJDK Client VM (build 16.0-b13, mixed mode, sharing)

It seems like the lack of SMIL support could be caused by three things: a limitation in the python webkit bindings; my misuse of the webkit API (perhaps I need to explicitly turn on SMIL support when instantiating the renderer); or, constraints in the Ubuntu version of libwebkit (perhaps it is an old version, or it has not been compiled with support for SMIL).

It seems unlikely to me that it would be a limitation in the python bindings; and, because chromium-browser supports SMIL animation (and I think chromium-browser depends on libwebkit), it seems unlikely to be a limitation in libwebkit; so the most likely problem is I somehow need to explicitly turn on SMIL support when instantiating the renderer.

Ubuntu 10.04 uses libwebkit-1.0-2 and python-webkit 1.1.7-1.

I'd appreciate any guidance anyone can offer. Thanks.