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

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

Issue 2373483003: Ensure valid VisiblePosition input for absoluteCaretBoundsOf (Closed)
Patch Set: Ensure valid VP for absoluteCaretBoundsOf Created 4 years, 3 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 | « third_party/WebKit/Source/core/editing/VisibleUnits.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp
index c2614e5db7ac9ee1518d313168510d24652391d6..9ca3595bcabd1aee25f14fe4519671ed7ab4e283 100644
--- a/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp
@@ -658,10 +658,12 @@ void DeleteSelectionCommand::mergeParagraphs(EditingState* editingState)
// We need to merge into m_upstreamStart's block, but it's been emptied out and collapsed by deletion.
if (!mergeDestination.deepEquivalent().anchorNode() || (!mergeDestination.deepEquivalent().anchorNode()->isDescendantOf(enclosingBlock(m_upstreamStart.computeContainerNode())) && (!mergeDestination.deepEquivalent().anchorNode()->hasChildren() || !m_upstreamStart.computeContainerNode()->hasChildren())) || (m_startsAtEmptyLine && mergeDestination.deepEquivalent() != startOfParagraphToMove.deepEquivalent())) {
+ PositionWithAffinity storedStartOfParagraphToMove = startOfParagraphToMove.toPositionWithAffinity();
insertNodeAt(HTMLBRElement::create(document()), m_upstreamStart, editingState);
if (editingState->isAborted())
return;
mergeDestination = createVisiblePositionDeprecated(m_upstreamStart);
+ startOfParagraphToMove = createVisiblePosition(storedStartOfParagraphToMove);
yosin_UTC9 2016/09/28 01:24:06 Rational of converting VP: |startOfParagraphToMove
}
if (mergeDestination.deepEquivalent() == startOfParagraphToMove.deepEquivalent())
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisibleUnits.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698