Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / web / TextFinder.cpp
index a21dfa4..82b48c3 100644 (file)
@@ -240,7 +240,7 @@ void TextFinder::scopeStringMatches(int identifier, const WebString& searchText,
         // This is a continuation of a scoping operation that timed out and didn't
         // complete last time around, so we should start from where we left off.
         ASSERT(m_resumeScopingFromRange->collapsed());
-        searchStart = m_resumeScopingFromRange->startPosition().next();
+        searchStart = m_resumeScopingFromRange->endPosition();
         if (searchStart.document() != searchEnd.document())
             return;
     }
@@ -271,7 +271,7 @@ void TextFinder::scopeStringMatches(int identifier, const WebString& searchText,
         if (resultRange->collapsed()) {
             // resultRange will be collapsed if the matched text spans over multiple TreeScopes.
             // FIXME: Show such matches to users.
-            searchStart = resultStart.next();
+            searchStart = resultEnd;
             continue;
         }
 
@@ -316,9 +316,9 @@ void TextFinder::scopeStringMatches(int identifier, const WebString& searchText,
         // result range. There is no need to use a VisiblePosition here,
         // since findPlainText will use a TextIterator to go over the visible
         // text nodes.
-        searchStart = resultStart.next();
+        searchStart = resultEnd;
 
-        m_resumeScopingFromRange = Range::create(*resultStart.document(), resultStart, resultStart);
+        m_resumeScopingFromRange = Range::create(*resultStart.document(), resultEnd, resultEnd);
         timedOut = (currentTime() - startTime) >= maxScopingDuration;
     } while (!timedOut);