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

Unified Diff: Source/core/frame/LocalDOMWindow.cpp

Issue 868463002: Support WholeWord in window.find() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: bug fix Created 5 years, 11 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 | « Source/core/editing/iterators/CharacterIterator.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/LocalDOMWindow.cpp
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
index ee80a05b0ddfa044471e6f6a30942a0f01963611..b68dbe884441194cc1e657bd282f5f173c616a62 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -1101,7 +1101,7 @@ String LocalDOMWindow::prompt(const String& message, const String& defaultValue)
return String();
}
-bool LocalDOMWindow::find(const String& string, bool caseSensitive, bool backwards, bool wrap, bool /*wholeWord*/, bool /*searchInFrames*/, bool /*showDialog*/) const
+bool LocalDOMWindow::find(const String& string, bool caseSensitive, bool backwards, bool wrap, bool wholeWord, bool /*searchInFrames*/, bool /*showDialog*/) const
{
if (!isCurrentlyDisplayedInFrame())
return false;
@@ -1110,8 +1110,9 @@ bool LocalDOMWindow::find(const String& string, bool caseSensitive, bool backwar
// |Document::updateLayout()|, e.g. event handler removes a frame.
RefPtrWillBeRawPtr<LocalFrame> protectFrame(frame());
- // FIXME (13016): Support wholeWord, searchInFrames and showDialog
- return frame()->editor().findString(string, !backwards, caseSensitive, wrap, false);
+ // FIXME (13016): Support searchInFrames and showDialog
+ FindOptions options = (backwards ? Backwards : 0) | (caseSensitive ? 0 : CaseInsensitive) | (wrap ? WrapAround : 0) | (wholeWord ? WholeWord | AtWordStarts: 0);
Yuta Kitamura 2015/04/30 07:51:51 nit: Space needed between "AtWordStarts" and ":"
+ return frame()->editor().findString(string, options);
}
bool LocalDOMWindow::offscreenBuffering() const
« no previous file with comments | « Source/core/editing/iterators/CharacterIterator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698