GNOME Bugzilla – Bug 589205
help-browser uses deprecated (and sometimes broken) webkit call
Last modified: 2009-07-22 00:00:58 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.
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.
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().
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.
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?
Yes, file:/// URIs are what the new function wants.