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

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

Issue 2847763004: Make InsertTextCommand not to apply style for empty selection (Closed)
Patch Set: 2017-04-28T14:41:08 Created 3 years, 8 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 aeeb8480ee596117640bd197264a8bbc83df9d15..e803959aaee2f344fcc794d62bfc02d30ea125f5 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