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

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

Issue 2540613002: Re-factor Editor::unappliedEditing() (Closed)
Patch Set: 2016-11-29T17:47:51 Created 4 years, 1 month 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 | « no previous file | 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/Editor.cpp
diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp
index 96b5a6583540f6e4ff7a31130bd3d47b32f41e7a..93f0e2a4535eaedd77b800c188d7a62d5ce01e3d 100644
--- a/third_party/WebKit/Source/core/editing/Editor.cpp
+++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -875,13 +875,14 @@ void Editor::unappliedEditing(EditCommandComposition* cmd) {
// VisibleSelections as starting and ending selections.
frame().document()->updateStyleAndLayoutIgnorePendingStylesheets();
- VisibleSelection newSelection =
+ const VisibleSelection& newSelection =
correctedVisibleSelection(cmd->startingSelection());
- if (newSelection.start().document() == frame().document() &&
- newSelection.end().document() == frame().document())
+ DCHECK(newSelection.isValidFor(*frame().document())) << newSelection;
+ if (!newSelection.isNone()) {
changeSelectionAfterCommand(
newSelection,
FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle);
+ }
m_lastEditCommand = nullptr;
m_undoStack->registerRedoStep(cmd);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698