Changeset 109228 in webkit


Ignore:
Timestamp:
Feb 29, 2012 10:15:32 AM (12 years ago)
Author:
sergio@webkit.org
Message:

DidFindString should be emitted even if FindOptionsShowOverlay is not enabled
https://bugs.webkit.org/show_bug.cgi?id=76522

Reviewed by Darin Adler.

DidFindString message should be issued always even if neither
FindOptionsShowOverlay or FindOptionsShowHighlight are
provided. The difference is that if any of those flags are present
the find operation will look for all the appearances of the text
in the web view, otherwise it will just look and report the next
occurrence.

This patch removes the temporary workaround added in r109222 to
the WebKitFindController unit tests.

  • UIProcess/API/gtk/tests/TestWebKitFindController.cpp:
  • WebProcess/WebPage/FindController.cpp:

(WebKit::FindController::findString):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r109222 r109228  
     12012-02-29  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        DidFindString should be emitted even if FindOptionsShowOverlay is not enabled
     4        https://bugs.webkit.org/show_bug.cgi?id=76522
     5
     6        Reviewed by Darin Adler.
     7
     8        DidFindString message should be issued always even if neither
     9        FindOptionsShowOverlay or FindOptionsShowHighlight are
     10        provided. The difference is that if any of those flags are present
     11        the find operation will look for all the appearances of the text
     12        in the web view, otherwise it will just look and report the next
     13        occurrence.
     14
     15        This patch removes the temporary workaround added in r109222 to
     16        the WebKitFindController unit tests.
     17
     18        * UIProcess/API/gtk/tests/TestWebKitFindController.cpp:
     19        * WebProcess/WebPage/FindController.cpp:
     20        (WebKit::FindController::findString):
     21
    1222012-01-19  Sergio Villar Senin  <svillar@igalia.com>
    223
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitFindController.cpp

    r109222 r109228  
    4646    void find(const char* searchText, guint32 findOptions, guint maxMatchCount)
    4747    {
    48         // Due to http://weakit.org/b/76522 we have to artificially
    49         // add here the show overlay option (that we do not even
    50         // expose in the API) to get the DidFindString messsage
    51         // issued. Remove this once 76522 is fixed.
    52         findOptions = findOptions | 1 << 5;
    53 
    5448        g_signal_connect(m_findController.get(), "found-text", G_CALLBACK(foundTextCallback), this);
    5549        g_signal_connect(m_findController.get(), "failed-to-find-text", G_CALLBACK(failedToFindTextCallback), this);
  • trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp

    r105855 r109228  
    110110    } else {
    111111        shouldShowOverlay = options & FindOptionsShowOverlay;
    112 
    113         if (shouldShowOverlay) {
    114             bool shouldShowHighlight = options & FindOptionsShowHighlight;
     112        bool shouldShowHighlight = options & FindOptionsShowHighlight;
     113        unsigned matchCount = 1;
     114
     115        if (shouldShowOverlay || shouldShowHighlight) {
    115116
    116117            if (maxMatchCount == numeric_limits<unsigned>::max())
    117118                --maxMatchCount;
    118            
    119             unsigned matchCount = m_webPage->corePage()->markAllMatchesForText(string, core(options), shouldShowHighlight, maxMatchCount + 1);
     119
     120            matchCount = m_webPage->corePage()->markAllMatchesForText(string, core(options), shouldShowHighlight, maxMatchCount + 1);
    120121
    121122            // Check if we have more matches than allowed.
     
    124125                matchCount = static_cast<unsigned>(kWKMoreThanMaximumMatchCount);
    125126            }
    126 
    127             m_webPage->send(Messages::WebPageProxy::DidFindString(string, matchCount));
    128         }
     127        }
     128
     129        m_webPage->send(Messages::WebPageProxy::DidFindString(string, matchCount));
    129130
    130131        if (!(options & FindOptionsShowFindIndicator) || !updateFindIndicator(selectedFrame, shouldShowOverlay)) {
Note: See TracChangeset for help on using the changeset viewer.