summaryrefslogtreecommitdiffstats
path: root/WebCore/html/TextFieldInputType.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/html/TextFieldInputType.cpp')
-rw-r--r--WebCore/html/TextFieldInputType.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/WebCore/html/TextFieldInputType.cpp b/WebCore/html/TextFieldInputType.cpp
index d93f972..8b74359 100644
--- a/WebCore/html/TextFieldInputType.cpp
+++ b/WebCore/html/TextFieldInputType.cpp
@@ -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());