Index: Source/web/WebViewImpl.cpp |
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp |
index 6e2085bdb363d92e0573da816a9c952436ebeece..5edb2e537221bcde08d316c511d0824b500e14ef 100644 |
--- a/Source/web/WebViewImpl.cpp |
+++ b/Source/web/WebViewImpl.cpp |
@@ -915,6 +915,19 @@ bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event) |
RefPtr<LocalFrame> frame = toLocalFrame(focusedFrame.get()); |
+ PlatformKeyboardEventBuilder evt(event); |
+ |
+ if (frame->eventHandler().keyEvent(evt)) { |
+ if (WebInputEvent::RawKeyDown == event.type) { |
+ // Suppress the next keypress event unless the focused node is a plug-in node. |
+ // (Flash needs these keypress events to handle non-US keyboards.) |
+ Element* element = focusedElement(); |
+ if (!element || !element->renderer() || !element->renderer()->isEmbeddedObject()) |
+ m_suppressNextKeypressEvent = true; |
+ } |
+ return true; |
+ } |
+ |
#if !OS(MACOSX) |
const WebInputEvent::Type contextMenuTriggeringEventType = |
#if OS(WIN) |
@@ -931,19 +944,6 @@ bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event) |
} |
#endif // !OS(MACOSX) |
- PlatformKeyboardEventBuilder evt(event); |
- |
- if (frame->eventHandler().keyEvent(evt)) { |
- if (WebInputEvent::RawKeyDown == event.type) { |
- // Suppress the next keypress event unless the focused node is a plug-in node. |
- // (Flash needs these keypress events to handle non-US keyboards.) |
- Element* element = focusedElement(); |
- if (!element || !element->renderer() || !element->renderer()->isEmbeddedObject()) |
- m_suppressNextKeypressEvent = true; |
- } |
- return true; |
- } |
- |
return keyEventDefault(event); |
} |