Title: [152430] trunk/Source/WebCore
Revision
152430
Author
[email protected]
Date
2013-07-05 16:21:22 -0700 (Fri, 05 Jul 2013)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (152429 => 152430)


--- trunk/Source/WebCore/ChangeLog	2013-07-05 23:12:21 UTC (rev 152429)
+++ trunk/Source/WebCore/ChangeLog	2013-07-05 23:21:22 UTC (rev 152430)
@@ -1,3 +1,17 @@
+2013-07-05  Sam Weinig  <[email protected]>
+
+        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.
+
 2013-07-05  Tullio Lucena  <[email protected]>
 
         Nix upstreaming - Adding Nix render theme files

Modified: trunk/Source/WebCore/page/Page.cpp (152429 => 152430)


--- trunk/Source/WebCore/page/Page.cpp	2013-07-05 23:12:21 UTC (rev 152429)
+++ trunk/Source/WebCore/page/Page.cpp	2013-07-05 23:21:22 UTC (rev 152430)
@@ -612,7 +612,7 @@
         RefPtr<Range> selectedRange = frameWithSelection->selection()->selection().firstRange();
         if (options & Backwards) {
             for (size_t i = matchRanges->size(); i > 0; --i) {
-                if (selectedRange->compareBoundaryPoints(Range::START_TO_END, matchRanges->at(i - 1).get(), IGNORE_EXCEPTION) > 0) {
+                if (selectedRange->compareBoundaryPoints(Range::END_TO_START, matchRanges->at(i - 1).get(), IGNORE_EXCEPTION) > 0) {
                     indexForSelection = i - 1;
                     break;
                 }
@@ -625,6 +625,11 @@
                 }
             }
         }
+    } else {
+        if (options & Backwards)
+            indexForSelection = matchRanges->size() - 1;
+        else
+            indexForSelection = 0;
     }
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to