OSDN Git Service

Merge WebKit at r73109: Initial merge by git.
[android-x86/external-webkit.git] / WebCore / html / TextFieldInputType.cpp
index d93f972..8b74359 100644 (file)
@@ -35,6 +35,7 @@
 #include "HTMLInputElement.h"
 #include "KeyboardEvent.h"
 #include "RenderTextControlSingleLine.h"
+#include "TextEvent.h"
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
@@ -75,6 +76,11 @@ bool TextFieldInputType::handleKeydownEventForSpinButton(KeyboardEvent* event)
     return true;
 }
 
+bool TextFieldInputType::shouldSubmitImplicitly(Event* event)
+{
+    return (event->type() == eventNames().textInputEvent && event->isTextEvent() && static_cast<TextEvent*>(event)->data() == "\n") || InputType::shouldSubmitImplicitly(event);
+}
+
 RenderObject* TextFieldInputType::createRenderer(RenderArena* arena, RenderStyle*) const
 {
     return new (arena) RenderTextControlSingleLine(element(), element()->placeholderShouldBeVisible());