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

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

Issue 2874783004: 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 930cd6f9595eb65950c02a1b1e8ea478822e327e..297830fa63ff2c44340bbf324eae6e91f2c28415 100644
--- a/third_party/WebKit/Source/core/editing/Editor.cpp
+++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -1055,15 +1055,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]));
yosin_UTC9 2017/05/12 05:06:14 Good catch!
// Insert the text
TypingCommand::InsertText(

Powered by Google App Engine
This is Rietveld 408576698