After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 589205 - help-browser uses deprecated (and sometimes broken) webkit call
help-browser uses deprecated (and sometimes broken) webkit call
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.6.6
Other Mac OS
: Normal normal
: 2.6
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2009-07-21 05:03 UTC by Daniel Macks
Modified: 2009-07-22 00:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel Macks 2009-07-21 05:03:35 UTC
gimp-2.6.6/plug-ins/help-browser/dialog.c line 338 (and similar in trunk) has:

   webkit_web_view_open (WEBKIT_WEB_VIEW (view), uri);

webkit_web_view_open() is officially deprecated in webkit, and known to be broken on-and-off in different gtkwebkit releases. One particular breakage is when opening a uri to a local file pathname, and especially when opening to a named #anchor. If open fails, no telling how future actions on a presumed-to-have-opened view pane will act (or crash).

I have not traced how gimp calls this function to see how susceptible it is to which types of breakage, but anyway, best to upgrade to use supported rather than bit-rotted interface. Webkit devels told me "webkit_web_view_open is a deprecated API. Please use webkit webkit_web_view_load_uri." It appears to have been added in the SONAME 1.0.2 release (not present in 1.0.1) but I don't know exactly how that correlates with gtkwebkit package versions.
Comment 1 Sven Neumann 2009-07-21 20:41:44 UTC
Why don't they just map webkit_web_view_open() to webkit_web_view_load_uri() then? Would be trivial to just make webkit_web_view_open() call webkit_web_view_load_uri() if the former is really that broken.
Comment 2 Sven Neumann 2009-07-21 20:44:48 UTC
I've changed this in both branches now.

commit 87f25f29d83266c1ed805fc3dd2802aee30bf246
Author: Sven Neumann <sven@gimp.org>
Date:   Tue Jul 21 22:42:47 2009 +0200

    Bug 589205 – help-browser uses deprecated (and sometimes broken) webkit call
    
    Use webkit_web_view_load_uri() instead of webkit_web_view_open().
Comment 3 Daniel Macks 2009-07-21 21:10:13 UTC
Older function had some additional magic to it.

webkit_web_view_open code is commented "We used to support local paths, unlike the newer function webkit_web_view_load_uri" and is implemented as a wrapper than uses risky or broken heuristics to decide how and if to process local path (/a/local/file) vs formal uri that includes METHOD:// prefix (file:///a/local/file) before handing off to the new function. So the safe way is to use new function and make sure to pass it an actual uri rather than simple local pathname.
Comment 4 Sven Neumann 2009-07-21 21:17:34 UTC
I am pretty sure that we use proper URIs always. We use file:/// URIs though. These are supported by webkit_web_view_load_uri(), right?
Comment 5 Daniel Macks 2009-07-22 00:00:58 UTC
Yes, file:/// URIs are what the new function wants.