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

Unified Diff: third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.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
« no previous file with comments | « third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp
index 6971b1fc9e918a5f2e15a57132022c8cca5842ee..060b53887d09d0f5e076f789f45ff07e82681cde 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp
@@ -28,7 +28,7 @@
#include "core/editing/iterators/TextIteratorTextState.h"
#include "core/editing/iterators/TextIteratorBehavior.h"
-#include "core/layout/LayoutText.h"
+#include "platform/wtf/text/StringBuilder.h"
namespace blink {
@@ -141,15 +141,17 @@ void TextIteratorTextState::SpliceBuffer(UChar c,
last_character_ = c;
}
-// TODO(xiaochengh): Remove the dependency on LayoutText, so that the class can
-// also be used by Layout NG.
void TextIteratorTextState::EmitText(Node* text_node,
- LayoutText* layout_object,
+ int position_start_offset,
yosin_UTC9 2017/06/05 03:42:21 This is yet another example I would like to have T
+ int position_end_offset,
+ const String& string,
int text_start_offset,
int text_end_offset) {
DCHECK(text_node);
- text_ = behavior_.EmitsOriginalText() ? layout_object->OriginalText()
- : layout_object->GetText();
+ text_ = string;
+
+ // TODO(xiaochengh): Hoist the conversion to TextIteratorTextNodeHandler, so
yosin_UTC9 2017/06/05 03:42:21 Goot catch! I love it!
+ // that we can remove |behavior_| from TextIteratorTextState.
if (behavior_.EmitsSpaceForNbsp())
text_.Replace(kNoBreakSpaceCharacter, kSpaceCharacter);
@@ -162,8 +164,8 @@ void TextIteratorTextState::EmitText(Node* text_node,
position_node_ = text_node;
position_offset_base_node_ = nullptr;
- position_start_offset_ = text_start_offset + layout_object->TextStartOffset();
- position_end_offset_ = text_end_offset + layout_object->TextStartOffset();
+ position_start_offset_ = position_start_offset;
+ position_end_offset_ = position_end_offset;
single_character_buffer_ = 0;
text_start_offset_ = text_start_offset;
text_length_ = text_end_offset - text_start_offset;
« no previous file with comments | « third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698