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

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

Issue 2919433006: Stop using TextIteratorBehavior in TextIteratorTextState (Closed)
Patch Set: Sun Jun 4 22:44:20 PDT 2017 Created 3 years, 6 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 d4656e6ed0f046f541236b2e0d5486c4a0933e11..10d340b977448843fabff0bbf4e62664593e10a2 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp
@@ -450,9 +450,10 @@ void TextIteratorTextNodeHandler::EmitText(Node* text_node,
LayoutText* layout_object,
int text_start_offset,
int text_end_offset) {
- const String& string = behavior_.EmitsOriginalText()
- ? layout_object->OriginalText()
- : layout_object->GetText();
+ String string = behavior_.EmitsOriginalText() ? layout_object->OriginalText()
+ : layout_object->GetText();
+ if (behavior_.EmitsSpaceForNbsp())
+ string.Replace(kNoBreakSpaceCharacter, kSpaceCharacter);
text_state_->EmitText(text_node,
text_start_offset + layout_object->TextStartOffset(),
text_end_offset + layout_object->TextStartOffset(),

Powered by Google App Engine
This is Rietveld 408576698