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

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

Issue 2141133003: [InputEvent] Fire 'beforeinput'/'input' for 6 text styling actions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 46f0e4e9db3754df5c7ad65b9dba9c631ad73c87..79d037ff238861620054f87b13460c4a4a6d534f 100644
--- a/third_party/WebKit/Source/core/editing/Editor.cpp
+++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -138,8 +138,23 @@ InputEvent::InputType inputTypeFromCommand(const CompositeEditCommand* command)
}
}
- // TODO(chongz): Handle other edit actions.
- return InputEvent::InputType::None;
+ switch (command->editingAction()) {
+ // TODO(chongz): Handle remaining edit actions.
+ case EditActionBold:
+ return InputEvent::InputType::Bold;
+ case EditActionItalics:
+ return InputEvent::InputType::Italic;
+ case EditActionUnderline:
+ return InputEvent::InputType::Underline;
+ case EditActionStrikeThrough:
+ return InputEvent::InputType::StrikeThrough;
+ case EditActionSuperscript:
+ return InputEvent::InputType::Superscript;
+ case EditActionSubscript:
+ return InputEvent::InputType::Subscript;
+ default:
+ return InputEvent::InputType::None;
+ }
}
InputEvent::EventIsComposing isComposingFromCommand(const CompositeEditCommand* command)

Powered by Google App Engine
This is Rietveld 408576698