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

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

Issue 315513003: Make sure calling moveParagaph() with proper parameters in CompositeEditCommand::moveParagraphConten (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2014-06-05T10:29:01 Created 6 years, 6 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/apply-style-empty-paragraph-start-crash-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/CompositeEditCommand.cpp
diff --git a/Source/core/editing/CompositeEditCommand.cpp b/Source/core/editing/CompositeEditCommand.cpp
index 69c7748e65f2f8ac8d192db9a258e9078de4fdb5..5b5047996820dda81e90247e2c88a85d682dcc96 100644
--- a/Source/core/editing/CompositeEditCommand.cpp
+++ b/Source/core/editing/CompositeEditCommand.cpp
@@ -950,6 +950,11 @@ PassRefPtrWillBeRawPtr<Node> CompositeEditCommand::moveParagraphContentsToNewBlo
bool endWasBr = isHTMLBRElement(*visibleParagraphEnd.deepEquivalent().deprecatedNode());
+ // Inserting default paragraph element can change visible position. We
+ // should update visible positions before use them.
+ visiblePos = VisiblePosition(pos, VP_DEFAULT_AFFINITY);
+ visibleParagraphStart = VisiblePosition(startOfParagraph(visiblePos));
+ visibleParagraphEnd = VisiblePosition(endOfParagraph(visiblePos));
moveParagraphs(visibleParagraphStart, visibleParagraphEnd, VisiblePosition(firstPositionInNode(newBlock.get())));
if (newBlock->lastChild() && isHTMLBRElement(*newBlock->lastChild()) && !endWasBr)
« no previous file with comments | « LayoutTests/editing/execCommand/apply-style-empty-paragraph-start-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698