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

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: Automatic tests added 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
Index: Source/core/html/HTMLElement.cpp
diff --git a/Source/core/html/HTMLElement.cpp b/Source/core/html/HTMLElement.cpp
index f3bb23f5d87a5c1eb010ab48051ef3e549b5c562..dfb506218f9d2bb6d4f490a192458e7eb270941f 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 "click" action.
esprehn 2013/07/26 11:00:02 as a "click"
Krzysztof Olczyk 2013/07/26 11:10:46 Done.
+ if (isTextFormControl() || isContentEditable())
+ return;
int charCode = event->charCode();
if (charCode == '\r' || charCode == ' ') {
dispatchSimulatedClick(event);

Powered by Google App Engine
This is Rietveld 408576698