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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 297343003: Fix for the input element contains extra '\t' TAB symbol after pressing TAB key when JS pop-up is a… Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added layout tests. Created 6 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: 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 =

Powered by Google App Engine
This is Rietveld 408576698