[webkit-gtk] WebKit not rendering images of a local resource (from within Gedit)

Peter Bittner peter.bittner at gmx.net
Mon Jan 19 12:56:29 PST 2015


Hi,

I'm using WebKit to render HTML in a plugin of Gedit, the Gnome text
editor. The source code is available from
https://github.com/bittner/gedit-reST-plugin/blob/gedit-3.14/reST/restructuredtext.py#L56

Now it looks like WebKit is rendering images from remote resources
(e.g. http://farm3.static.flickr.com/2256/2259897373_d47ecf0983_o_d.png)
fine, but local images (e.g. docs/reStPlugin.png) just display as an
empty box. Interestingly, the size of the box corresponds to the real
size of the image, but the image itself is not displayed.

The box around the image is displayed only when the file exists,
otherwise only the ALT-text is visible. Looks like WebKit reads the
image dimensions out of the image file. I've tried setting a <base
href="file://..."> tag in the HTML head section, but that makes things
worse ("** Message: console message:  @318: Not allowed to load local
resource: file:///home/.../doc/reStPlugin.png")

Some details and a screenshot are available from a bug report at
https://github.com/bittner/gedit-reST-plugin/issues/7
Carlos from the webkit-dev mailing list suggested "passing the right
base URL to the load method" may be missing
(https://lists.webkit.org/pipermail/webkit-dev/2015-January/027156.html).

Does this problem sound familiar to someone?

Thanks in advance for any hints,
Peter


More information about the webkit-gtk mailing list