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

Unified Diff: third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp

Issue 2700913002: Fix undo stack ordering with TypingCommand (Closed)
Patch Set: Also put insert...InQuotedContent in EventQueueScope Created 3 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 | « third_party/WebKit/LayoutTests/editing/undo/type_with_mutation_event_undo_order.html ('k') | 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/commands/TypingCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
index a1a928da1632941dbc395da6407c053508b5799b..7313874cb3719a3740746c01431fd621de89ba60 100644
--- a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
@@ -42,6 +42,7 @@
#include "core/editing/commands/InsertTextCommand.h"
#include "core/editing/spellcheck/SpellChecker.h"
#include "core/events/BeforeTextInsertedEvent.h"
+#include "core/events/ScopedEventQueue.h"
#include "core/events/TextEvent.h"
#include "core/frame/LocalFrame.h"
#include "core/html/HTMLBRElement.h"
@@ -343,9 +344,11 @@ void TypingCommand::insertText(Document& document,
options & RetainAutocorrectionIndicator);
lastTypingCommand->setShouldPreventSpellChecking(options &
PreventSpellChecking);
- EditingState editingState;
lastTypingCommand->m_isIncrementalInsertion = isIncrementalInsertion;
lastTypingCommand->m_selectionStart = selectionStart;
+
+ EditingState editingState;
+ EventQueueScope eventQueueScope;
lastTypingCommand->insertText(newText, options & SelectInsertedText,
&editingState);
return;
@@ -373,6 +376,7 @@ bool TypingCommand::insertLineBreak(Document& document) {
lastTypingCommandIfStillOpenForTyping(document.frame())) {
lastTypingCommand->setShouldRetainAutocorrectionIndicator(false);
EditingState editingState;
+ EventQueueScope eventQueueScope;
lastTypingCommand->insertLineBreak(&editingState);
return !editingState.isAborted();
}
@@ -385,6 +389,7 @@ bool TypingCommand::insertParagraphSeparatorInQuotedContent(
if (TypingCommand* lastTypingCommand =
lastTypingCommandIfStillOpenForTyping(document.frame())) {
EditingState editingState;
+ EventQueueScope eventQueueScope;
lastTypingCommand->insertParagraphSeparatorInQuotedContent(&editingState);
return !editingState.isAborted();
}
@@ -399,6 +404,7 @@ bool TypingCommand::insertParagraphSeparator(Document& document) {
lastTypingCommandIfStillOpenForTyping(document.frame())) {
lastTypingCommand->setShouldRetainAutocorrectionIndicator(false);
EditingState editingState;
+ EventQueueScope eventQueueScope;
lastTypingCommand->insertParagraphSeparator(&editingState);
return !editingState.isAborted();
}
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/undo/type_with_mutation_event_undo_order.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698