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

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: fix nit Created 5 years, 7 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 067c985ecd7caaca12b1f9de5ad9aa181e367acc..f38739471d637bc6d978cee7ff17ab6f32a319ea 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -892,7 +892,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;
@@ -901,8 +901,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);
+ 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