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

Unified Diff: Source/core/html/HTMLTextFormControlElement.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
« Source/core/editing/UndoStack.cpp ('K') | « Source/core/editing/UndoStack.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLTextFormControlElement.cpp
diff --git a/Source/core/html/HTMLTextFormControlElement.cpp b/Source/core/html/HTMLTextFormControlElement.cpp
index 916142fb8104317dde9c0ad81fbbf9b799dc550a..f1083f4bb37ffabba9d11350da5260f1bbae7bdb 100644
--- a/Source/core/html/HTMLTextFormControlElement.cpp
+++ b/Source/core/html/HTMLTextFormControlElement.cpp
@@ -33,6 +33,7 @@
#include "core/dom/NodeTraversal.h"
#include "core/dom/Text.h"
#include "core/dom/shadow/ShadowRoot.h"
+#include "core/editing/Editor.h"
#include "core/editing/FrameSelection.h"
#include "core/editing/TextIterator.h"
#include "core/events/Event.h"
@@ -513,6 +514,9 @@ void HTMLTextFormControlElement::setInnerTextValue(const String& value)
if (value.endsWith('\n') || value.endsWith('\r'))
innerTextElement()->appendChild(HTMLBRElement::create(document()));
+
+ if (LocalFrame* frame = document().frame())
+ frame->editor().clearUndoStack();
}
setFormControlValueMatchesRenderer(true);
« Source/core/editing/UndoStack.cpp ('K') | « Source/core/editing/UndoStack.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698