Index: third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp |
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp |
index 1fd0e41dd2f3dcfc29478eca35c9d4f5162c609a..d4656e6ed0f046f541236b2e0d5486c4a0933e11 100644 |
--- a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp |
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp |
@@ -450,8 +450,13 @@ void TextIteratorTextNodeHandler::EmitText(Node* text_node, |
LayoutText* layout_object, |
int text_start_offset, |
int text_end_offset) { |
- text_state_->EmitText(text_node, layout_object, text_start_offset, |
- text_end_offset); |
+ const String& string = behavior_.EmitsOriginalText() |
+ ? layout_object->OriginalText() |
+ : layout_object->GetText(); |
+ text_state_->EmitText(text_node, |
+ text_start_offset + layout_object->TextStartOffset(), |
+ text_end_offset + layout_object->TextStartOffset(), |
+ string, text_start_offset, text_end_offset); |
ResetCollapsedWhiteSpaceFixup(); |
} |