[Webkit-unassigned] [Bug 27443] [Gtk] Combobox should support "find-as-you-type" search

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Aug 8 01:27:22 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=27443





--- Comment #20 from Xan Lopez <xan.lopez at gmail.com>  2010-08-08 01:27:22 PST ---
(In reply to comment #19)
> >  #elif PLATFORM(GTK)
> > +    GList* m_searchDomain;
> > +    GString* m_searchedWord;
> 
> Please use GOwnPtr for these types and be sure to write template
> specializations for them if they do not exist yet. This will reduce
> the risk of memory leaks greatly.
> 

(...)

> > +        g_list_free(m_searchDomain);
> > +        g_string_free(m_searchedWord, TRUE);
> 
> This kind of stuff can be omitted entirely if you switch to
> GOwnPtr, or even switching to using WebCore types (though I
> know that you just switched it to GObject types, so maybe that
> kind of change could happen in a later cleanup).

I suggested moving to glib string types (from a previous suggestion where I said to use the WebCore types :D)), because here we are going to be doing substring comparison against glib utf8 C strings all the time, and going back and forth between webcore types and that seems a bit pointless. I think using GString + GOwnPtr is the best compromise.

> I'm not sure I understand exactly why you are caching the menu items
> here (m_searchDomain), is the performance gain worth it? If you didn't,
> it seems like you could get rid of the filterDomain method. Take a look
> at PopupListBox::typeAheadFind in the chromium directory for where they
> implement this same behavior in one method. Maybe we should match that?
> 

I'm not sure if the gain is noticeable (it might be in big combos, since this code should be filtering the list in ~real-time) but now that this is written, and since it's not that complex, I think it's reasonable to just keep it. We could do a first version without it and then add the optimization in a follow-up (I think I might have suggested this at some point), but no strong feelings here.

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



More information about the webkit-unassigned mailing list