Bug 16584

Summary: [GTK] Need more fine grained return value for webkit_web_view_search_text
Product: WebKit Reporter: Xan Lopez <xan.lopez>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: christian, cosimoc, mrobinson
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.4   
Bug Depends on:    
Bug Blocks: 14141    

Description Xan Lopez 2007-12-23 05:39:43 PST
Sometimes it's useful to know not only if the search has succeeded, but whether it had to wrap or not to do so. Epiphany, for instance, expects to get this information from the search API (in order to update the UI with the wrap information). The only way to do this now is to something like:

+  if (webkit_web_view_search_text (priv->web_view, priv->find_string, priv->case_sensitive, forward, FALSE))
+  {
+    return EPHY_EMBED_FIND_FOUND;
+  }
+  else if (webkit_web_view_search_text (priv->web_view, priv->find_string, priv->case_sensitive, forward, TRUE))
+  {
+    return EPHY_EMBED_FIND_FOUNDWRAPPED;
+  }
+  else
+    return EPHY_EMBED_FIND_NOTFOUND;

which is ugly.

It would be nice to return an enum value with { NOT_FOUND, FOUND, FOUND_WRAPPED } possibilities.

Not sure how easy is to do this given the WebCore API, does not look trivial at first sight though.
Comment 1 Martin Robinson 2014-04-08 17:53:46 PDT
Going to close this one, but we should open a new bug if it's still an issue with ephy + WebKit2.