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

Unified Diff: webkit/api/src/WebFrameImpl.cpp

Issue 335012: Update the find result index "(m of n)" whenever there is an active selection... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: simplify test Created 11 years, 1 month 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 | « chrome/test/data/find_in_page/select_changes_ordinal.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/api/src/WebFrameImpl.cpp
===================================================================
--- webkit/api/src/WebFrameImpl.cpp (revision 31004)
+++ webkit/api/src/WebFrameImpl.cpp (working copy)
@@ -1106,7 +1106,8 @@
// to start from there. Otherwise, we start searching from where the last Find
// operation left off (either a Find or a FindNext operation).
VisibleSelection selection(frame()->selection()->selection());
- if (selection.isNone() && m_activeMatch) {
+ bool activeSelection = !selection.isNone();
+ if (!activeSelection && m_activeMatch) {
selection = VisibleSelection(m_activeMatch.get());
frame()->selection()->setSelection(selection);
}
@@ -1141,8 +1142,9 @@
executeCommand(WebString::fromUTF8("Unselect"));
}
- if (!options.findNext) {
- // This is a Find operation, so we set the flag to ask the scoping effort
+ if (!options.findNext || activeSelection) {
+ // This is either a Find operation or a Find-next from a new start point
+ // due to a selection, so we set the flag to ask the scoping effort
// to find the active rect for us so we can update the ordinal (n of m).
m_locatingActiveRect = true;
} else {
« no previous file with comments | « chrome/test/data/find_in_page/select_changes_ordinal.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698