Changeset 152430 in webkit


Ignore:
Timestamp:
Jul 5, 2013 4:21:22 PM (11 years ago)
Author:
weinig@apple.com
Message:

WKPageFindStringMatches with kWKFindOptionsBackwards still doesn't work
<rdar://problem/13881024>
https://bugs.webkit.org/show_bug.cgi?id=118436

Reviewed by Tim Horton.

  • page/Page.cpp:

(WebCore::Page::findStringMatchingRanges):

  • When searching backwards, use END_TO_START rather than START_TO_END.
  • If there is no selection and we are searching backwards, we now select the last item, not the first.
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r152428 r152430  
     12013-07-05  Sam Weinig  <sam@webkit.org>
     2
     3        WKPageFindStringMatches with kWKFindOptionsBackwards still doesn't work
     4        <rdar://problem/13881024>
     5        https://bugs.webkit.org/show_bug.cgi?id=118436
     6
     7        Reviewed by Tim Horton.
     8
     9        * page/Page.cpp:
     10        (WebCore::Page::findStringMatchingRanges):
     11        - When searching backwards, use END_TO_START rather than START_TO_END.
     12        - If there is no selection and we are searching backwards, we now select the last item,
     13          not the first.
     14
    1152013-07-05  Tullio Lucena  <tullio.lucena@openbossa.org>
    216
  • trunk/Source/WebCore/page/Page.cpp

    r152384 r152430  
    613613        if (options & Backwards) {
    614614            for (size_t i = matchRanges->size(); i > 0; --i) {
    615                 if (selectedRange->compareBoundaryPoints(Range::START_TO_END, matchRanges->at(i - 1).get(), IGNORE_EXCEPTION) > 0) {
     615                if (selectedRange->compareBoundaryPoints(Range::END_TO_START, matchRanges->at(i - 1).get(), IGNORE_EXCEPTION) > 0) {
    616616                    indexForSelection = i - 1;
    617617                    break;
     
    626626            }
    627627        }
     628    } else {
     629        if (options & Backwards)
     630            indexForSelection = matchRanges->size() - 1;
     631        else
     632            indexForSelection = 0;
    628633    }
    629634}
Note: See TracChangeset for help on using the changeset viewer.