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