<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>16624</bug_id>
          
          <creation_ts>2007-12-27 07:33:18 -0800</creation_ts>
          <short_desc>[GTK] Improvements to search API</short_desc>
          <delta_ts>2014-04-08 17:54:10 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Gtk</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>14141</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Cosimo Cecchi">cosimoc</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>christian</cc>
    
    <cc>mrobinson</cc>
    
    <cc>svillar</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>65395</commentid>
    <comment_count>0</comment_count>
    <who name="Cosimo Cecchi">cosimoc</who>
    <bug_when>2007-12-27 07:33:18 -0800</bug_when>
    <thetext>Hi, currently we have the following search API in WebKit/GTK

gboolean webkit_web_view_search_text (WebKitWebView* web_view, const gchar* string, gboolean case_sensitive, gboolean forward, gboolean wrap);

guint webkit_web_view_mark_text_matches (WebKitWebView* web_view, const gchar* string, gboolean case_sensitive, guint limit);

void webkit_web_view_set_highlight_text_matches (WebKitWebView* web_view, gboolean highlight);

void webkit_web_view_unmark_text_matches (WebKitWebView* web_view);

which IMHO is not optimal.
webkit_web_view_search_text directly looks for a provided string, returning a bool value is found/not found, and one match at a time is selected in the web view, with the possibility to go forward/backwards and wrap. This API misses the possibility to highlight all the occurrencies of the string, and also to un-highlight.
webkit_web_view_mark_text_matches and the other functions, look for a provided string and highlight a maximum provided number of occurrences (|limit|). This API also provides a function to highlight/unhighlight the found occurrencies, but lacks a way to go forward/backwards in highliting the occurrencies, to wrap the search and returns an int.

I think all this is confusing, and we should merge the two APIs together like this:
webkit_web_view_mark_text_matches should not have &quot;limit&quot; as an argument.
Then we would have:
enum
{
  NOT_FOUND,
  FOUND,
  FOUND_WRAPPED
} Result
- Result webkit_web_view_highlight_single_match (WebKitWebView *, direction)
- guint webkit_web_view_highlight_matches (WebKitWebView *, limit)
- void webkit_web_view_unhighlight_matches (WebKitWebView *)
- void webkit_web_view_unmark_matches (WebKitWebView *)

This would also cover bug #16584.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>537143</commentid>
    <comment_count>1</comment_count>
    <who name="Sergio Villar Senin">svillar</who>
    <bug_when>2012-01-17 09:11:04 -0800</bug_when>
    <thetext>Cosimo maybe you&apos;d like to take a look at the new find API for WebKit2, see https://bugs.webkit.org/show_bug.cgi?id=76070</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>998937</commentid>
    <comment_count>2</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2014-04-08 17:54:10 -0700</bug_when>
    <thetext>WebKit1GTK+ has been removed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>