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