[Webkit-unassigned] [Bug 16624] New: [GTK] Improvements to search API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 27 07:33:18 PST 2007


http://bugs.webkit.org/show_bug.cgi?id=16624

           Summary: [GTK] Improvements to search API
           Product: WebKit
           Version: 525+ (Nightly build)
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebKit Gtk
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: anarki at lilik.it


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 "limit" 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.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list