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

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

Issue 303263006: Make sure end position of selection to delete editable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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/deleting/delete-selection-with-non-editable-end-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/DeleteSelectionCommand.cpp
diff --git a/Source/core/editing/DeleteSelectionCommand.cpp b/Source/core/editing/DeleteSelectionCommand.cpp
index 7b886c7b906e021ee6878f1542062a7f14ae1e41..6e8690f5d57b1668596292107cb5eb7ee970db2a 100644
--- a/Source/core/editing/DeleteSelectionCommand.cpp
+++ b/Source/core/editing/DeleteSelectionCommand.cpp
@@ -164,6 +164,10 @@ void DeleteSelectionCommand::initializePositionData()
Position start, end;
initializeStartEnd(start, end);
+ ASSERT(isEditablePosition(start, ContentIsEditable, DoNotUpdateStyle));
+ if (!isEditablePosition(end, ContentIsEditable, DoNotUpdateStyle))
+ end = lastEditablePositionBeforePositionInRoot(end, highestEditableRoot(start)).deepEquivalent();
+
m_upstreamStart = start.upstream();
m_downstreamStart = start.downstream();
m_upstreamEnd = end.upstream();
« no previous file with comments | « LayoutTests/editing/deleting/delete-selection-with-non-editable-end-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698