webkit_web_view_get_selected_text function was removed from webkit

Bug #799603 reported by Vladimir
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Midori Web Browser
Fix Released
Undecided
Unassigned

Bug Description

The `webkit_web_view_get_selected_text' function was removed from webkit source (see https://bugs.webkit.org/show_bug.cgi?id=62512).

Midori can't be compiled versus webkitgtk after rev. 88621.

Revision history for this message
Sylvain Fourmanoit (fourmanoit) wrote :

Enclosed is a temporary fix to remove the dependency on webkit_web_view_get_selected_text.

Once applied, you can successfully compile and run midori against the post r88621 Webkit GTK trunk.

It's only a workaround: it does not preserve the functionality previously covered by the call, whatever it was, which I did not investigate -- casual browsing and inspection seems to work fine without it.

Revision history for this message
tista (tista) wrote :

Thanks fourmanoit. :)

Now I'm using my PPA for webkitgtk 1.5.2 with extra options:
https://launchpad.net/~tista/+archive/webkit

And then I've modded midori's some scripts:
for wscript -> http://paste.ubuntu.com/688326/
for midori/wscript-build -> http://paste.ubuntu.com/688324/

So it seems to ok to build on local, but unfortunately main repository didn't have the "libjavascriptcoregtk-1.0-dev" package, so PPA failed to build...
https://launchpad.net/~tista/+archive/gtk3/+packages

Finally I'm now using such midori with webkit 1.5.2, it chashed whenever using "find" tool via Ctrl-F especially toggling it a couple of time... :(

Revision history for this message
Sylvain Fourmanoit (fourmanoit) wrote :

In response to comment #2:

I am pretty ignorant of webkit internals, but I can at least say that on my midori build against webkit 1.5.2 (r94040 -- svn head on 2011-08-30 02:29:25 UTC) the
"find" tool via Ctrl-F works as expected and doesn't seem to crash the browser, no matter how many times I invoke it. Running a valgrind session, the feature doesn't seem to leak any memory either -- I am not on ubuntu though, so it's I cannot make a blow-by-blow comparison of your dependencies with mine.

Revision history for this message
tista (tista) wrote :

Before applying above patch and toggling "find" tool 2 or 3 times, then crashed with attached traces...

Revision history for this message
tista (tista) wrote :

OK... I've applied workaround for "find" tool:
http://paste.ubuntu.com/688808/

and then midori didn't crash anymore... :-)

Revision history for this message
tista (tista) wrote :

Following #4 and #5...

Now bzr latest rev.3998 seems to fix it already?
http://bazaar.launchpad.net/~vcs-imports/midori/master/revision/3998
Yesterday I've updated the codes via bzr pull, build and run well!! :-)

Thanks devs!

Revision history for this message
Vladimir (lomov-vl) wrote :

Thank you for your attention to the issue.

Sylvain your patch allows to compile midori (taken from git) with webkit fetched ( svn, rev. 95201) and compiled on my system but it breaks one of midori function.
AFAIU, the commented function was used to provide ability to select text on a page and from context menu pass it to search engine. Now it is impossible, i.e. text can be selected but items from context menu doesn't open new window/tab with search results.

So, the problem remains.

Revision history for this message
chrono (gtk-monkey) wrote :

Patch replace webkit_web_view_get_selected_text call with WebKitDOM calls.

Revision history for this message
Vladimir (lomov-vl) wrote :

@chrono:
thank you. Your patch works perfectly
.

Revision history for this message
Sylvain Fourmanoit (fourmanoit) wrote :

Following #7 and #8:

chrono, thanks for writing this. I also works as expected here, as it restores context menu search from text selection, as described by Vladimir... Is there anything left to do to report it upstream?

Revision history for this message
Cris Dywan (kalikiana) wrote :

Thanks both Sylvain and Chrono for your investigation. Based on the patch from comment #8 I made a change to use DOM API with WebKitGTK+ 1.5.1 and fallback to the previous behavior otherwise, so that old versions continue to work.

Changed in midori:
status: New → Fix Committed
Revision history for this message
xapantu (xapantu) wrote :

@Christian: you put #if WEBKIT_CHECK_VERSION (1, 5, 1), maybe it could be #if WEBKIT_CHECK_VERSION (1, 4, 3)?

On Oneiric, there is 1.4.3 and webkit_web_view_get_selected_text doesn't work, so...

Changed in midori:
status: Fix Committed → In Progress
Revision history for this message
xapantu (xapantu) wrote :

Like on this patch...

Revision history for this message
Cris Dywan (kalikiana) wrote :

Sounds fine, thanks (although I didn't see that in the changelog of webkit).

Changed in midori:
status: In Progress → Fix Committed
Cris Dywan (kalikiana)
Changed in midori:
status: Fix Committed → Fix Released
Revision history for this message
Yves-Alexis Perez (corsac) wrote :

In fact, it'd be best to completely remove the call to webkit_web_view_get_selected_text() since it's supposed to be private and not used outside of Webkit.

I can't find API documentation indicating when the DOM functions where introduced so I don't know if they're available before 1.4.3.

Revision history for this message
Cris Dywan (kalikiana) wrote :

Supposed to be private yes. And it's not the first function which was the only way to use a feature for a long time. Another example would be webkit_web_frame_print which actually became public afterall. You can't exactly argue to not have access to the clipboard or printing.

If you build with >= 1.4.3 it's no longer an issue. I don't intend to take away features from older versions now.

Revision history for this message
Julian Andres Klode (juliank) wrote :

You could also just dlopen() webkit and call webkit_web_view_get_selected_text via a pointer, if that pointer is not NULL. This makes a binary compiled against an old webkit work with a new one.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.