Chromium Code Reviews| 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(); |
| } |