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

Unified Diff: Source/core/editing/UndoStack.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
« no previous file with comments | « Source/core/editing/UndoStack.h ('k') | Source/core/html/HTMLTextFormControlElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/UndoStack.cpp
diff --git a/Source/core/editing/UndoStack.cpp b/Source/core/editing/UndoStack.cpp
index 1ffd4273e98587e652a99fd26b6cc4afcb380c04..4359edbed61b8fc1bb573e639a55bb144c0c340f 100644
--- a/Source/core/editing/UndoStack.cpp
+++ b/Source/core/editing/UndoStack.cpp
@@ -121,4 +121,13 @@ void UndoStack::redo()
}
}
+void UndoStack::clear()
+{
+ if (canUndo())
eseidel 2014/03/04 02:08:16 Why check canUndo here?
+ m_undoStack.clear();
+
+ if (canRedo())
+ m_redoStack.clear();
+}
+
} // namesace WebCore
« no previous file with comments | « Source/core/editing/UndoStack.h ('k') | Source/core/html/HTMLTextFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698