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

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

Issue 1395693009: [Editing][BugFix] Fix if condition in ReplaceSelectionCommand (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/ReplaceSelectionCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
index 5eef8486a3ba1f1926a0aaf780173a5a5a686a53..5add5329865fd6ba67eda705e647cb0efc4247c8 100644
--- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
@@ -1013,10 +1013,11 @@ void ReplaceSelectionCommand::doApply()
applyCommandToComposite(BreakBlockquoteCommand::create(document()));
// This will leave a br between the split.
Node* br = endingSelection().start().anchorNode();
- ASSERT(isHTMLBRElement(br));
- // Insert content between the two blockquotes, but remove the br (since it was just a placeholder).
- insertionPos = positionInParentBeforeNode(*br);
- removeNode(br);
+ if (isHTMLBRElement(br)) {
yosin_UTC9 2015/10/15 05:57:18 It seems this can fix issue 541402 too. However, i
+ // Insert content between the two blockquotes, but remove the br (since it was just a placeholder).
+ insertionPos = positionInParentBeforeNode(*br);
+ removeNode(br);
+ }
}
// Inserting content could cause whitespace to collapse, e.g. inserting <div>foo</div> into hello^ world.

Powered by Google App Engine
This is Rietveld 408576698