Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(764)

Unified Diff: Source/core/html/HTMLButtonElement.cpp

Issue 16194013: Mouse press should focus on any types of form controls. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/html/HTMLButtonElement.cpp
diff --git a/Source/core/html/HTMLButtonElement.cpp b/Source/core/html/HTMLButtonElement.cpp
index 855af6438c4991db8b5910ca96126744a58eec95..cc581d2bf6fe27f46fde664b52f20817b9bb6c49 100644
--- a/Source/core/html/HTMLButtonElement.cpp
+++ b/Source/core/html/HTMLButtonElement.cpp
@@ -125,10 +125,13 @@ void HTMLButtonElement::defaultEventHandler(Event* event)
}
if (event->isKeyboardEvent()) {
- if (event->type() == eventNames().keydownEvent && static_cast<KeyboardEvent*>(event)->keyIdentifier() == "U+0020") {
- setActive(true, true);
- // No setDefaultHandled() - IE dispatches a keypress in this case.
- return;
+ if (event->type() == eventNames().keydownEvent) {
+ willHandleKeyDownEvent();
+ if (static_cast<KeyboardEvent*>(event)->keyIdentifier() == "U+0020") {
+ setActive(true, true);
+ // No setDefaultHandled() - IE dispatches a keypress in this case.
+ return;
+ }
}
if (event->type() == eventNames().keypressEvent) {
switch (static_cast<KeyboardEvent*>(event)->charCode()) {

Powered by Google App Engine
This is Rietveld 408576698