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

Unified Diff: Source/core/editing/iterators/CharacterIterator.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/FindOptions.h ('k') | Source/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/iterators/CharacterIterator.cpp
diff --git a/Source/core/editing/iterators/CharacterIterator.cpp b/Source/core/editing/iterators/CharacterIterator.cpp
index 0ee5357cc42b47e66e28d36b2801d4b02709247f..2e296b6320cf42ff13ce6116e7084e92f34a9103 100644
--- a/Source/core/editing/iterators/CharacterIterator.cpp
+++ b/Source/core/editing/iterators/CharacterIterator.cpp
@@ -473,7 +473,11 @@ inline bool SearchBuffer::isWordStartMatch(size_t start, size_t length) const
size_t wordBreakSearchStart = start + length;
while (wordBreakSearchStart > start)
wordBreakSearchStart = findNextWordFromIndex(m_buffer.data(), m_buffer.size(), wordBreakSearchStart, false /* backwards */);
- return wordBreakSearchStart == start;
+ if (wordBreakSearchStart != start)
+ return false;
+ if (m_options & WholeWord)
+ return static_cast<int>(start + length) == findWordEndBoundary(m_buffer.data(), m_buffer.size(), wordBreakSearchStart);
+ return true;
}
inline size_t SearchBuffer::search(size_t& start)
« no previous file with comments | « Source/core/editing/FindOptions.h ('k') | Source/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698