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; |