Index: third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp |
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp |
index b569a1f12776a9a837a7e280f150bec825747e2c..2e995686b61755d113276724d972d25c8f021115 100644 |
--- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp |
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp |
@@ -784,6 +784,16 @@ void TextIteratorAlgorithm<Strategy>::HandleTextBox() { |
text_box_end) |
return; |
+ if (behavior_.DoesNotEmitSpaceBeyondRangeEnd()) { |
+ // If the subrun went to the text box end and this end is also the end |
+ // of the range, do not advance to the next text box and do not |
+ // generate a space, just stop. |
+ if (text_box_end == end) { |
+ text_box_ = nullptr; |
+ return; |
+ } |
+ } |
+ |
// Advance and return |
unsigned next_run_start = |
next_text_box ? next_text_box->Start() : str.length(); |