Changeset 151404 in webkit


Ignore:
Timestamp:
Jun 10, 2013, 2:36:51 PM (12 years ago)
Author:
akling@apple.com
Message:

REGRESSION(r150633): Find on page non-focused text highlight color is bright yellow.
<rdar://problem/14098882>
<http://webkit.org/b/117371>

Reviewed by Anders Carlsson.

There was a mistake in the parameter ordering which still compiled because of
implicit bool/unsigned conversion.
Changed the interface of Page::findMatchesForText() to use enums instead of bools.

No test because the color of the highlighted matches is not available through APIs.

  • page/Page.h:
  • page/Page.cpp:

(WebCore::Page::findMatchesForText):
(WebCore::Page::markAllMatchesForText):
(WebCore::Page::countFindMatches):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r151402 r151404  
     12013-06-10  Andreas Kling  <akling@apple.com>
     2
     3        REGRESSION(r150633): Find on page non-focused text highlight color is bright yellow.
     4        <rdar://problem/14098882>
     5        <http://webkit.org/b/117371>
     6
     7        Reviewed by Anders Carlsson.
     8
     9        There was a mistake in the parameter ordering which still compiled because of
     10        implicit bool/unsigned conversion.
     11        Changed the interface of Page::findMatchesForText() to use enums instead of bools.
     12
     13        No test because the color of the highlighted matches is not available through APIs.
     14
     15        * page/Page.h:
     16        * page/Page.cpp:
     17        (WebCore::Page::findMatchesForText):
     18        (WebCore::Page::markAllMatchesForText):
     19        (WebCore::Page::countFindMatches):
     20
    1212013-06-10  Bear Travis  <betravis@adobe.com>
    222
  • trunk/Source/WebCore/page/Page.cpp

    r151244 r151404  
    649649}
    650650
    651 unsigned Page::findMatchesForText(const String& target, FindOptions options, unsigned maxMatchCount, bool shouldHighlight, bool markMatches)
     651unsigned Page::findMatchesForText(const String& target, FindOptions options, unsigned maxMatchCount, ShouldHighlightMatches shouldHighlightMatches, ShouldMarkMatches shouldMarkMatches)
    652652{
    653653    if (target.isEmpty() || !mainFrame())
     
    658658    Frame* frame = mainFrame();
    659659    do {
    660         if (markMatches)
    661             frame->editor().setMarkedTextMatchesAreHighlighted(shouldHighlight);
    662         matchCount += frame->editor().countMatchesForText(target, 0, options, maxMatchCount ? (maxMatchCount - matchCount) : 0, markMatches, 0);
     660        if (shouldMarkMatches == MarkMatches)
     661            frame->editor().setMarkedTextMatchesAreHighlighted(shouldHighlightMatches == HighlightMatches);
     662        matchCount += frame->editor().countMatchesForText(target, 0, options, maxMatchCount ? (maxMatchCount - matchCount) : 0, shouldMarkMatches == MarkMatches, 0);
    663663        frame = incrementFrame(frame, true, false);
    664664    } while (frame);
     
    669669unsigned Page::markAllMatchesForText(const String& target, FindOptions options, bool shouldHighlight, unsigned maxMatchCount)
    670670{
    671     return findMatchesForText(target, options, shouldHighlight, maxMatchCount, /*markMatches*/ true);
     671    return findMatchesForText(target, options, maxMatchCount, shouldHighlight ? HighlightMatches : DoNotHighlightMatches, MarkMatches);
    672672}
    673673
    674674unsigned Page::countFindMatches(const String& target, FindOptions options, unsigned maxMatchCount)
    675675{
    676     return findMatchesForText(target, options, /*shouldHighlight*/ false, maxMatchCount, /*markMatches*/ false);
     676    return findMatchesForText(target, options, maxMatchCount, DoNotHighlightMatches, DoNotMarkMatches);
    677677}
    678678
  • trunk/Source/WebCore/page/Page.h

    r151244 r151404  
    420420#endif
    421421
    422     unsigned findMatchesForText(const String&, FindOptions, unsigned maxMatchCount, bool shouldHighlight, bool markMatches);
     422    enum ShouldHighlightMatches { DoNotHighlightMatches, HighlightMatches };
     423    enum ShouldMarkMatches { DoNotMarkMatches, MarkMatches };
     424
     425    unsigned findMatchesForText(const String&, FindOptions, unsigned maxMatchCount, ShouldHighlightMatches, ShouldMarkMatches);
    423426
    424427    MediaCanStartListener* takeAnyMediaCanStartListener();
Note: See TracChangeset for help on using the changeset viewer.