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

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

Issue 2872243002: Reland of Make InsertTextCommand not to apply style for empty selection (patchset #1 id:1 of https:… (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/commands/InsertTextCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp
index 8a305b1eac5eab902e00955c6f9404dbb777778d..f1d15fef30f21d621a5b836edf416d57b2ae65a0 100644
--- a/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp
@@ -276,7 +276,7 @@ void InsertTextCommand::DoApply(EditingState* editing_state) {
GetDocument().GetFrame()->GetEditor().TypingStyle()) {
typing_style->PrepareToApplyAt(end_position,
EditingStyle::kPreserveWritingDirection);
- if (!typing_style->IsEmpty()) {
+ if (!typing_style->IsEmpty() && !EndingSelection().IsNone()) {
ApplyStyle(typing_style, editing_state);
if (editing_state->IsAborted())
return;

Powered by Google App Engine
This is Rietveld 408576698