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

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

Issue 2241183003: Revert of Fix find-in-page re-scope across frame boundaries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « content/test/data/find_in_long_page.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index 7bd8462316426be94c893f14a1ffbe83d5efeac3..fc1a846d6d6379fd01d8e89ad50fd1f2a924087c 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -1989,6 +1989,7 @@
}
WebRange currentSelection = selectionRange();
+
bool result = false;
bool activeNow = false;
@@ -2006,25 +2007,19 @@
// There are three cases in which scoping is needed:
//
- // (1) This is an initial find request (|options.findNext| is false). This
+ // 1) This is an initial find request (|options.findNext| is false). This
// will be the first scoping effort for this find session.
//
- // (2) Something has been selected since the last search. This means that we
+ // 2) Something has been selected since the last search. This means that we
// cannot just increment the current match ordinal; we need to re-generate
// it.
//
- // (3) TextFinder::Find() found what should be the next match (|result| is
- // true), but was unable to activate it (|activeNow| is false). This means
- // that the text containing this match was dynamically added since the last
- // scope of the frame. The frame needs to be re-scoped so that any matches
- // in the new text can be highlighted and included in the reported number of
- // matches.
+ // 3) TextFinder::Find() could not locate the next active find match, so it
+ // needs to be re-scoped.
//
// If none of these cases are true, then we just report the current match
// count without scoping.
- if (/* (1) */ options.findNext
- && /* (2) */ currentSelection.isNull()
- && /* (3) */ !(result && !activeNow)) {
+ if (options.findNext && currentSelection.isNull() && activeNow) {
// Force report of the actual count.
increaseMatchCount(0, identifier);
return;
« no previous file with comments | « content/test/data/find_in_long_page.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698