Changeset 105855 in webkit


Ignore:
Timestamp:
Jan 25, 2012 12:54:19 AM (12 years ago)
Author:
sergio@webkit.org
Message:

[WK2] FindController should not assume that ports do not want to highlight text matches
https://bugs.webkit.org/show_bug.cgi?id=76921

Reviewed by Darin Adler.

FindController must obey the FindOptionsShowHighlight flag instead
of assuming that ports do not want to highlight search matches.

  • Shared/API/c/WKFindOptions.h: added kWKFindOptionsShowHighlight.
  • Shared/API/c/WKSharedAPICast.h:

(WebKit::toFindOptions): Ditto.

  • Shared/WebFindOptions.h: added FindOptionsShowHighlight.
  • WebProcess/WebPage/FindController.cpp:

(WebKit::FindController::findString):

Location:
trunk/Source/WebKit2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r105854 r105855  
     12012-01-24  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [WK2] FindController should not assume that ports do not want to highlight text matches
     4        https://bugs.webkit.org/show_bug.cgi?id=76921
     5
     6        Reviewed by Darin Adler.
     7
     8        FindController must obey the FindOptionsShowHighlight flag instead
     9        of assuming that ports do not want to highlight search matches.
     10
     11        * Shared/API/c/WKFindOptions.h: added kWKFindOptionsShowHighlight.
     12        * Shared/API/c/WKSharedAPICast.h:
     13        (WebKit::toFindOptions): Ditto.
     14        * Shared/WebFindOptions.h: added FindOptionsShowHighlight.
     15        * WebProcess/WebPage/FindController.cpp:
     16        (WebKit::FindController::findString):
     17
    1182012-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
    219
  • trunk/Source/WebKit2/Shared/API/c/WKFindOptions.h

    r95901 r105855  
    3838    kWKFindOptionsWrapAround = 1 << 4,
    3939    kWKFindOptionsShowOverlay = 1 << 5,
    40     kWKFindOptionsShowFindIndicator = 1 << 6
     40    kWKFindOptionsShowFindIndicator = 1 << 6,
     41    kWKFindOptionsShowHighlight = 1 << 7
    4142};
    4243typedef uint32_t WKFindOptions;
  • trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h

    r100336 r105855  
    689689    if (wkFindOptions & kWKFindOptionsShowFindIndicator)
    690690        findOptions |= FindOptionsShowFindIndicator;
     691    if (wkFindOptions & kWKFindOptionsShowHighlight)
     692        findOptions |= FindOptionsShowHighlight;
    691693
    692694    return static_cast<FindOptions>(findOptions);
  • trunk/Source/WebKit2/Shared/WebFindOptions.h

    r95901 r105855  
    3636    FindOptionsWrapAround = 1 << 4,
    3737    FindOptionsShowOverlay = 1 << 5,
    38     FindOptionsShowFindIndicator = 1 << 6
     38    FindOptionsShowFindIndicator = 1 << 6,
     39    FindOptionsShowHighlight = 1 << 7
    3940};
    4041
  • trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp

    r99911 r105855  
    112112
    113113        if (shouldShowOverlay) {
     114            bool shouldShowHighlight = options & FindOptionsShowHighlight;
     115
    114116            if (maxMatchCount == numeric_limits<unsigned>::max())
    115117                --maxMatchCount;
    116118           
    117             unsigned matchCount = m_webPage->corePage()->markAllMatchesForText(string, core(options), false, maxMatchCount + 1);
     119            unsigned matchCount = m_webPage->corePage()->markAllMatchesForText(string, core(options), shouldShowHighlight, maxMatchCount + 1);
    118120
    119121            // Check if we have more matches than allowed.
Note: See TracChangeset for help on using the changeset viewer.