Changeset 70510 in webkit


Ignore:
Timestamp:
Oct 25, 2010 6:51:53 PM (14 years ago)
Author:
andersca@apple.com
Message:

WebKit2 callbacks for findString() and countMatchesForString() should report whether the match count was exceeded
https://bugs.webkit.org/show_bug.cgi?id=48285
<rdar://problem/8576318>

Reviewed by Sam Weinig.

  • UIProcess/API/C/WKPage.h:

Add a kWKMoreThanMaximumMatchCount constant.

  • WebProcess/WebPage/FindController.cpp:

(WebKit::FindController::findString):
If we get back more matches than allowed, send kWKMoreThanMaximumMatchCount as the match constant.

Location:
trunk/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r70506 r70510  
     12010-10-25  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        WebKit2 callbacks for findString() and countMatchesForString() should report whether the match count was exceeded
     6        https://bugs.webkit.org/show_bug.cgi?id=48285
     7        <rdar://problem/8576318>
     8
     9        * UIProcess/API/C/WKPage.h:
     10        Add a kWKMoreThanMaximumMatchCount constant.
     11
     12        * WebProcess/WebPage/FindController.cpp:
     13        (WebKit::FindController::findString):
     14        If we get back more matches than allowed, send kWKMoreThanMaximumMatchCount as the match constant.
     15
    1162010-10-25  Dan Bernstein  <mitz@apple.com>
    217
  • trunk/WebKit2/UIProcess/API/C/WKPage.h

    r70504 r70510  
    179179typedef struct WKPageFindClient WKPageFindClient;
    180180
     181enum {
     182    kWKMoreThanMaximumMatchCount = -1
     183};
     184
    181185WK_EXPORT WKTypeID WKPageGetTypeID();
    182186
  • trunk/WebKit2/WebProcess/WebPage/FindController.cpp

    r70491 r70510  
    2828#include "BackingStore.h"
    2929#include "FindPageOverlay.h"
     30#include "WKPage.h"
    3031#include "WebPage.h"
    3132#include "WebPageProxyMessages.h"
     
    9091
    9192        if (shouldShowOverlay) {
    92             unsigned matchCount = m_webPage->corePage()->markAllMatchesForText(string, caseSensitivity, false, maxMatchCount);
     93            unsigned matchCount = m_webPage->corePage()->markAllMatchesForText(string, caseSensitivity, false, maxMatchCount + 1);
    9394
    9495            // Check if we have more matches than allowed.
    95             if (matchCount > maxMatchCount)
     96            if (matchCount > maxMatchCount) {
    9697                shouldShowOverlay = false;
     98                matchCount = static_cast<unsigned>(kWKMoreThanMaximumMatchCount);
     99            }
    97100
    98101            WebProcess::shared().connection()->send(Messages::WebPageProxy::DidFindString(string, matchCount), m_webPage->pageID());
Note: See TracChangeset for help on using the changeset viewer.