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

Unified Diff: WebCore/page/EventHandler.cpp

Issue 2155003: Merge 58829 - Reviewed by Adele Peterson.... (Closed) Base URL: svn://chrome-svn/chrome/branches/WebKit/375/
Patch Set: Created 10 years, 7 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
« no previous file with comments | « WebCore/manual-tests/focus-change-between-key-events.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/page/EventHandler.cpp
===================================================================
--- WebCore/page/EventHandler.cpp (revision 48065)
+++ WebCore/page/EventHandler.cpp (working copy)
@@ -2162,7 +2162,9 @@
if (initialKeyEvent.type() == PlatformKeyboardEvent::RawKeyDown) {
node->dispatchEvent(keydown, ec);
- return keydown->defaultHandled() || keydown->defaultPrevented();
+ // If frame changed as a result of keydown dispatch, then return true to avoid sending a subsequent keypress message to the new frame.
+ bool changedFocusedFrame = m_frame->page() && m_frame != m_frame->page()->focusController()->focusedOrMainFrame();
+ return keydown->defaultHandled() || keydown->defaultPrevented() || changedFocusedFrame;
}
// Run input method in advance of DOM event handling. This may result in the IM
@@ -2182,7 +2184,9 @@
}
node->dispatchEvent(keydown, ec);
- bool keydownResult = keydown->defaultHandled() || keydown->defaultPrevented();
+ // If frame changed as a result of keydown dispatch, then return early to avoid sending a subsequent keypress message to the new frame.
+ bool changedFocusedFrame = m_frame->page() && m_frame != m_frame->page()->focusController()->focusedOrMainFrame();
+ bool keydownResult = keydown->defaultHandled() || keydown->defaultPrevented() || changedFocusedFrame;
if (handledByInputMethod || (keydownResult && !backwardCompatibilityMode))
return keydownResult;
« no previous file with comments | « WebCore/manual-tests/focus-change-between-key-events.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698