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

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

Issue 2883073002: Remove selected text when committing empty text (Closed)
Patch Set: Created 3 years, 7 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: third_party/WebKit/Source/core/editing/Editor.cpp
diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp
index b714e43aba2e8bbce46d7ea185d76799a76db025..3f37d6ba0e1e3d9d124d28e52e0e6943f7260790 100644
--- a/third_party/WebKit/Source/core/editing/Editor.cpp
+++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -1071,15 +1071,12 @@ bool Editor::InsertTextWithoutSendingTextEvent(
bool select_inserted_text,
TextEvent* triggering_event,
InputEvent::InputType input_type) {
- if (text.IsEmpty())
- return false;
-
const VisibleSelection& selection = SelectionForCommand(triggering_event);
if (!selection.IsContentEditable())
return false;
GetSpellChecker().UpdateMarkersForWordsAffectedByEditing(
- IsSpaceOrNewline(text[0]));
+ !text.IsEmpty() && IsSpaceOrNewline(text[0]));
// Insert the text
TypingCommand::InsertText(

Powered by Google App Engine
This is Rietveld 408576698