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

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

Issue 2915013005: Stop TextIteratorTextState from using LayoutText (Closed)
Patch Set: Thu Jun 1 18:55:15 PDT 2017 Created 3 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
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();
}

Powered by Google App Engine
This is Rietveld 408576698