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

Unified Diff: third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp

Issue 2805553003: DocumentMarkerList refactor as an interface (Closed)
Patch Set: Rebase on renaming patch, respond to comments Created 3 years, 8 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/commands/SplitTextNodeCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp b/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp
index 1c1b703fd3ad1b967b873f17c4d2da315d10f76c..fb8a01a066742342f3607e8655573a2cf7f7eea8 100644
--- a/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp
@@ -58,8 +58,7 @@ void SplitTextNodeCommand::DoApply(EditingState*) {
text1_ = Text::Create(GetDocument(), prefix_text);
DCHECK(text1_);
- GetDocument().Markers().CopyMarkers(text2_.Get(), 0, offset_, text1_.Get(),
- 0);
+ GetDocument().Markers().MoveMarkers(text2_.Get(), offset_, text1_.Get());
InsertText1AndTrimText2();
}
@@ -75,8 +74,8 @@ void SplitTextNodeCommand::DoUnapply() {
text2_->insertData(0, prefix_text, ASSERT_NO_EXCEPTION);
GetDocument().UpdateStyleAndLayout();
- GetDocument().Markers().CopyMarkers(text1_.Get(), 0, prefix_text.length(),
- text2_.Get(), 0);
+ GetDocument().Markers().MoveMarkers(text1_.Get(), prefix_text.length(),
+ text2_.Get());
text1_->remove(ASSERT_NO_EXCEPTION);
}
@@ -88,6 +87,8 @@ void SplitTextNodeCommand::DoReapply() {
if (!parent || !HasEditableStyle(*parent))
return;
+ GetDocument().Markers().MoveMarkers(text2_.Get(), offset_, text1_.Get());
+
InsertText1AndTrimText2();
}

Powered by Google App Engine
This is Rietveld 408576698