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

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

Issue 2810463002: Clean up DocumentMarkerController::copyMarkers() (now it's moveMarkers()) (Closed)
Patch Set: 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 3ed9063fdae7e8a5baafeb815e7befddbe175d61..ddc2e61e1d9d934df33e540177040ea76163957d 100644
--- a/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp
@@ -58,7 +58,7 @@ void SplitTextNodeCommand::doApply(EditingState*) {
m_text1 = Text::create(document(), prefixText);
DCHECK(m_text1);
- document().markers().copyMarkers(m_text2.get(), 0, m_offset, m_text1.get(),
+ document().markers().moveMarkers(m_text2.get(), 0, m_offset, m_text1.get(),
0);
insertText1AndTrimText2();
@@ -75,7 +75,7 @@ void SplitTextNodeCommand::doUnapply() {
m_text2->insertData(0, prefixText, ASSERT_NO_EXCEPTION);
document().updateStyleAndLayout();
- document().markers().copyMarkers(m_text1.get(), 0, prefixText.length(),
+ document().markers().moveMarkers(m_text1.get(), 0, prefixText.length(),
m_text2.get(), 0);
m_text1->remove(ASSERT_NO_EXCEPTION);
}
@@ -88,6 +88,8 @@ void SplitTextNodeCommand::doReapply() {
if (!parent || !hasEditableStyle(*parent))
return;
+ document().markers().moveMarkers(m_text2.get(), 0, m_offset, m_text1.get(),
rlanday 2017/04/08 02:30:09 I'm glad I wrote the test case in the dependent CL
Xiaocheng 2017/04/08 02:46:40 Good catch!
+ 0);
insertText1AndTrimText2();
}

Powered by Google App Engine
This is Rietveld 408576698