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

Unified Diff: Source/core/html/HTMLElement.cpp

Issue 20560005: (spatnav) Space&enter should be entered to box instead of simulating click on it. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review fixes Created 7 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
« no previous file with comments | « ManualTests/spatial-navigation/spatial-navigation-test-cases.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLElement.cpp
diff --git a/Source/core/html/HTMLElement.cpp b/Source/core/html/HTMLElement.cpp
index f3bb23f5d87a5c1eb010ab48051ef3e549b5c562..e5b018899b83bc73feb787413489d44fba996fa7 100644
--- a/Source/core/html/HTMLElement.cpp
+++ b/Source/core/html/HTMLElement.cpp
@@ -1076,6 +1076,11 @@ void HTMLElement::handleKeypressEvent(KeyboardEvent* event)
{
if (!document()->settings() || !document()->settings()->spatialNavigationEnabled() || !supportsFocus())
return;
+ // if the element is a text form control (like <input type=text> or <textarea>)
+ // or has contentEditable attribute on, we should enter a space or newline
+ // even in spatial navigation mode instead of handling it as a "click" action.
+ if (isTextFormControl() || isContentEditable())
+ return;
int charCode = event->charCode();
if (charCode == '\r' || charCode == ' ') {
dispatchSimulatedClick(event);
« no previous file with comments | « ManualTests/spatial-navigation/spatial-navigation-test-cases.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698