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

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

Issue 184103011: Clear undo stack when text control is set programatically Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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
Index: Source/core/editing/Editor.cpp
diff --git a/Source/core/editing/Editor.cpp b/Source/core/editing/Editor.cpp
index ba4484d2aac3492583c216773431702b3b8b7d96..6cb7b61b0bc469897fbc8366c4e3465159f0da3a 100644
--- a/Source/core/editing/Editor.cpp
+++ b/Source/core/editing/Editor.cpp
@@ -953,6 +953,12 @@ void Editor::redo()
undoStack->redo();
}
+void Editor::clearUndoStack()
+{
+ if (UndoStack* undoStack = this->undoStack())
+ undoStack->clear();
+}
+
void Editor::setBaseWritingDirection(WritingDirection direction)
{
Node* focusedElement = frame().document()->focusedElement();

Powered by Google App Engine
This is Rietveld 408576698