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); |