Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(725)

Unified Diff: Source/core/editing/Editor.cpp

Issue 34503002: Remove code in Editor::rangeOfString() that resets the searchRange irrespective of findNext value. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/Editor.cpp
diff --git a/Source/core/editing/Editor.cpp b/Source/core/editing/Editor.cpp
index 8b1284666713805be0850d8c373739671c180f39..13ac5ce8a5e517bad273a7859ea2e354916427b1 100644
--- a/Source/core/editing/Editor.cpp
+++ b/Source/core/editing/Editor.cpp
@@ -1270,25 +1270,6 @@ PassRefPtr<Range> Editor::rangeOfString(const String& target, Range* referenceRa
}
RefPtr<Range> resultRange(findPlainText(searchRange.get(), target, options));
- // If we started in the reference range and the found range exactly matches the reference range, find again.
- // Build a selection with the found range to remove collapsed whitespace.
- // Compare ranges instead of selection objects to ignore the way that the current selection was made.
- if (startInReferenceRange && areRangesEqual(VisibleSelection(resultRange.get()).toNormalizedRange().get(), referenceRange)) {
- searchRange = rangeOfContents(m_frame.document());
- if (forward)
- searchRange->setStart(referenceRange->endPosition());
- else
- searchRange->setEnd(referenceRange->startPosition());
-
- if (shadowTreeRoot) {
- if (forward)
- searchRange->setEnd(shadowTreeRoot.get(), shadowTreeRoot->childNodeCount());
- else
- searchRange->setStart(shadowTreeRoot.get(), 0);
- }
-
- resultRange = findPlainText(searchRange.get(), target, options);
- }
// If nothing was found in the shadow tree, search in main content following the shadow tree.
if (resultRange->collapsed(ASSERT_NO_EXCEPTION) && shadowTreeRoot) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698