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

Unified Diff: third_party/WebKit/Source/core/editing/iterators/CharacterIterator.cpp

Issue 2564763002: Fix calculateCharacterSubrange() when length == 0 (Closed)
Patch Set: Add a unit test Created 4 years 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 | « no previous file | third_party/WebKit/Source/core/editing/iterators/CharacterIteratorTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/iterators/CharacterIterator.cpp
diff --git a/third_party/WebKit/Source/core/editing/iterators/CharacterIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/CharacterIterator.cpp
index 73404bec56e04cc7316619bf03240e7864d90514..19b4b31007f8b577f060b5ca335f26f4eab7ebab 100644
--- a/third_party/WebKit/Source/core/editing/iterators/CharacterIterator.cpp
+++ b/third_party/WebKit/Source/core/editing/iterators/CharacterIterator.cpp
@@ -189,6 +189,8 @@ CharacterIteratorAlgorithm<Strategy>::calculateCharacterSubrange(int offset,
advance(offset);
const PositionTemplate<Strategy> startPos = startPosition();
+ if (!length)
+ return EphemeralRangeTemplate<Strategy>(startPos, startPos);
if (length > 1)
advance(length - 1);
return EphemeralRangeTemplate<Strategy>(startPos, endPosition());
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/iterators/CharacterIteratorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698