Index: third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp |
diff --git a/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp b/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp |
index 5b7dd0e1a3e4376187624a221a4a81cb560c1320..48708180e3489c23bddee971e11f990ed318916e 100644 |
--- a/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp |
+++ b/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp |
@@ -26,6 +26,7 @@ |
#include "core/editing/Editor.h" |
+#include "core/events/InputEvent.h" |
#include "core/events/KeyboardEvent.h" |
#include "core/frame/LocalFrame.h" |
#include "core/page/EditorClient.h" |
@@ -60,6 +61,15 @@ bool Editor::handleEditingKeyboardEvent(KeyboardEvent* evt) |
if (!behavior().shouldInsertCharacter(*evt) || !canEdit()) |
return false; |
+ if (RuntimeEnabledFeatures::inputEventEnabled()) { |
+ if (EventTarget* target = evt->target()) { |
+ RefPtrWillBeRawPtr<InputEvent> beforeInputEvent = InputEvent::createBeforeInput("insertText", evt->keyEvent()->text()); |
chongz
2016/03/01 20:41:10
Will replace "insertText" with constant command na
dtapuska
2016/03/01 21:49:51
you can likely store the atomic string in a static
|
+ DispatchEventResult dispatchResult = target->dispatchEvent(beforeInputEvent); |
+ if (dispatchResult != DispatchEventResult::NotCanceled) |
+ return true; |
dtapuska
2016/03/01 21:49:51
I'm not certain returning true here is correct. As
chongz
2016/03/04 19:46:50
To my understanding the return value here should b
|
+ } |
+ } |
+ |
return insertText(evt->keyEvent()->text(), evt); |
} |