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

Unified Diff: Source/core/editing/IndentOutdentCommand.cpp

Issue 305143002: Don't call moveParagraph() with null |VisiblePositon| (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2014-05-30T05:23:36 Created 6 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 | « LayoutTests/editing/execCommand/outdent-collapse-table-crash-2-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/IndentOutdentCommand.cpp
diff --git a/Source/core/editing/IndentOutdentCommand.cpp b/Source/core/editing/IndentOutdentCommand.cpp
index c37dd3c63ee08da3a97ee3888fae6a3f1d01c073..3b0963ed29ce004492186b0654859f65d818502e 100644
--- a/Source/core/editing/IndentOutdentCommand.cpp
+++ b/Source/core/editing/IndentOutdentCommand.cpp
@@ -185,9 +185,13 @@ void IndentOutdentCommand::outdentParagraph()
Node* highestInlineNode = highestEnclosingNodeOfType(visibleStartOfParagraph.deepEquivalent(), isInline, CannotCrossEditingBoundary, enclosingBlockFlow);
splitElement(toElement(enclosingNode), (highestInlineNode) ? highestInlineNode : visibleStartOfParagraph.deepEquivalent().deprecatedNode());
}
+ VisiblePosition startOfParagraphToMove(startOfParagraph(visibleStartOfParagraph));
+ VisiblePosition endOfParagraphToMove(endOfParagraph(visibleEndOfParagraph));
+ if (startOfParagraphToMove.isNull() || endOfParagraphToMove.isNull())
+ return;
RefPtrWillBeRawPtr<Node> placeholder = createBreakElement(document());
insertNodeBefore(placeholder, splitBlockquoteNode);
- moveParagraph(startOfParagraph(visibleStartOfParagraph), endOfParagraph(visibleEndOfParagraph), VisiblePosition(positionBeforeNode(placeholder.get())), true);
+ moveParagraph(startOfParagraphToMove, endOfParagraphToMove, VisiblePosition(positionBeforeNode(placeholder.get())), true);
}
// FIXME: We should merge this function with ApplyBlockElementCommand::formatSelection
« no previous file with comments | « LayoutTests/editing/execCommand/outdent-collapse-table-crash-2-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698