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

Unified Diff: third_party/WebKit/Source/web/TextFinder.cpp

Issue 2428613002: Removed limitation on searching frames for the same string prefix.
Patch Set: Created 4 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
Index: third_party/WebKit/Source/web/TextFinder.cpp
diff --git a/third_party/WebKit/Source/web/TextFinder.cpp b/third_party/WebKit/Source/web/TextFinder.cpp
index b1248f001ad01b0097ea6a2f6e9b8c45879e212e..fc303db3ea9c4c0d4ff5048c754121f6bc6d2755 100644
--- a/third_party/WebKit/Source/web/TextFinder.cpp
+++ b/third_party/WebKit/Source/web/TextFinder.cpp
@@ -449,7 +449,6 @@ void TextFinder::finishCurrentScopingEffort(int identifier) {
flushCurrentScopingEffort(identifier);
m_scopingInProgress = false;
- m_lastFindRequestCompletedWithNoMatches = !m_lastMatchCount;
// This frame is done, so show any scrollbar tickmarks we haven't drawn yet.
ownerFrame().frameView()->invalidatePaintForTickmarks();
@@ -462,10 +461,6 @@ void TextFinder::cancelPendingScopingEffort() {
m_activeMatchIndex = -1;
- // Last request didn't complete.
- if (m_scopingInProgress)
- m_lastFindRequestCompletedWithNoMatches = false;
-
m_scopingInProgress = false;
}
@@ -677,7 +672,6 @@ TextFinder::TextFinder(WebLocalFrameImpl& ownerFrame)
m_findMatchMarkersVersion(0),
m_locatingActiveRect(false),
m_scopingInProgress(false),
- m_lastFindRequestCompletedWithNoMatches(false),
m_findMatchRectsAreValid(false) {}
TextFinder::~TextFinder() {}
@@ -707,26 +701,7 @@ bool TextFinder::shouldScopeMatches(const String& searchText,
DCHECK(frame->document());
DCHECK(frame->view());
- if (options.force)
- return true;
-
- if (!ownerFrame().hasVisibleContent())
- return false;
-
- // If the frame completed the scoping operation and found 0 matches the last
- // time it was searched, then we don't have to search it again if the user is
- // just adding to the search string or sending the same search string again.
- if (m_lastFindRequestCompletedWithNoMatches &&
- !m_lastSearchString.isEmpty()) {
- // Check to see if the search string prefixes match.
- String previousSearchPrefix =
- searchText.substring(0, m_lastSearchString.length());
-
- if (previousSearchPrefix == m_lastSearchString)
- return false; // Don't search this frame, it will be fruitless.
- }
-
- return true;
+ return options.force || ownerFrame().hasVisibleContent();
}
void TextFinder::scopeStringMatchesSoon(int identifier,
« third_party/WebKit/Source/web/TextFinder.h ('K') | « third_party/WebKit/Source/web/TextFinder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698