From 4576aa36e9a9671459299c7963ac95aa94beaea9 Mon Sep 17 00:00:00 2001 From: "Shimeng (Simon) Wang" Date: Tue, 7 Dec 2010 17:22:45 -0800 Subject: Merge WebKit at r73109: Initial merge by git. Change-Id: I61f1a66d9642e3d8405d3ac6ccab2a53421c75d8 --- WebCore/html/BaseCheckableInputType.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'WebCore/html/BaseCheckableInputType.cpp') diff --git a/WebCore/html/BaseCheckableInputType.cpp b/WebCore/html/BaseCheckableInputType.cpp index 009e8e4..940acf4 100644 --- a/WebCore/html/BaseCheckableInputType.cpp +++ b/WebCore/html/BaseCheckableInputType.cpp @@ -34,6 +34,7 @@ #include "FormDataList.h" #include "HTMLInputElement.h" #include "HTMLNames.h" +#include "KeyboardEvent.h" #include "RegularExpression.h" namespace WebCore { @@ -57,4 +58,25 @@ bool BaseCheckableInputType::appendFormData(FormDataList& encoding, bool) const return true; } +bool BaseCheckableInputType::handleKeydownEvent(KeyboardEvent* event) +{ + const String& key = event->keyIdentifier(); + if (key == "U+0020") { + element()->setActive(true, true); + // No setDefaultHandled(), because IE dispatches a keypress in this case + // and the caller will only dispatch a keypress if we don't call setDefaultHandled(). + } + return false; +} + +bool BaseCheckableInputType::handleKeypressEvent(KeyboardEvent* event) +{ + if (event->charCode() == ' ') { + // Prevent scrolling down the page. + event->setDefaultHandled(); + return true; + } + return false; +} + } // namespace WebCore -- cgit v1.1