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