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

Side by Side Diff: Source/core/editing/Editor.cpp

Issue 315493004: reset VisibleSelection at the Undo command. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add the VisibleSelection::validateIfNeeded method 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 unified diff | Download patch
« no previous file with comments | « Source/core/dom/Range.cpp ('k') | Source/core/editing/VisibleSelection.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 } 711 }
712 712
713 void Editor::unappliedEditing(PassRefPtrWillBeRawPtr<EditCommandComposition> cmd ) 713 void Editor::unappliedEditing(PassRefPtrWillBeRawPtr<EditCommandComposition> cmd )
714 { 714 {
715 EventQueueScope scope; 715 EventQueueScope scope;
716 m_frame.document()->updateLayout(); 716 m_frame.document()->updateLayout();
717 717
718 dispatchEditableContentChangedEvents(cmd->startingRootEditableElement(), cmd ->endingRootEditableElement()); 718 dispatchEditableContentChangedEvents(cmd->startingRootEditableElement(), cmd ->endingRootEditableElement());
719 719
720 VisibleSelection newSelection(cmd->startingSelection()); 720 VisibleSelection newSelection(cmd->startingSelection());
721 newSelection.validatePositionsIfNeeded();
721 changeSelectionAfterCommand(newSelection, FrameSelection::CloseTyping | Fram eSelection::ClearTypingStyle); 722 changeSelectionAfterCommand(newSelection, FrameSelection::CloseTyping | Fram eSelection::ClearTypingStyle);
722 723
723 m_lastEditCommand = nullptr; 724 m_lastEditCommand = nullptr;
724 if (UndoStack* undoStack = this->undoStack()) 725 if (UndoStack* undoStack = this->undoStack())
725 undoStack->registerRedoStep(cmd); 726 undoStack->registerRedoStep(cmd);
726 respondToChangedContents(newSelection); 727 respondToChangedContents(newSelection);
727 } 728 }
728 729
729 void Editor::reappliedEditing(PassRefPtrWillBeRawPtr<EditCommandComposition> cmd ) 730 void Editor::reappliedEditing(PassRefPtrWillBeRawPtr<EditCommandComposition> cmd )
730 { 731 {
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); 1236 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled);
1236 } 1237 }
1237 1238
1238 void Editor::trace(Visitor* visitor) 1239 void Editor::trace(Visitor* visitor)
1239 { 1240 {
1240 visitor->trace(m_lastEditCommand); 1241 visitor->trace(m_lastEditCommand);
1241 visitor->trace(m_mark); 1242 visitor->trace(m_mark);
1242 } 1243 }
1243 1244
1244 } // namespace WebCore 1245 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Range.cpp ('k') | Source/core/editing/VisibleSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698