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

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

Issue 326323003: Fix a crash caused by invalid selection set by Undo command. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix minor issues in test. 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/undo/undo-set-selection-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/Editor.cpp
diff --git a/Source/core/editing/Editor.cpp b/Source/core/editing/Editor.cpp
index f1044e816a0bd4b4274aaabdc61bc328b00aa359..5314562e3b67897ffd840a8cadc788845dfb678a 100644
--- a/Source/core/editing/Editor.cpp
+++ b/Source/core/editing/Editor.cpp
@@ -719,7 +719,8 @@ void Editor::unappliedEditing(PassRefPtrWillBeRawPtr<EditCommandComposition> cmd
VisibleSelection newSelection(cmd->startingSelection());
newSelection.validatePositionsIfNeeded();
- changeSelectionAfterCommand(newSelection, FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle);
+ if (newSelection.start().document() == m_frame.document() && newSelection.end().document() == m_frame.document())
+ changeSelectionAfterCommand(newSelection, FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle);
m_lastEditCommand = nullptr;
if (UndoStack* undoStack = this->undoStack())
« no previous file with comments | « LayoutTests/editing/undo/undo-set-selection-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698