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

Unified Diff: third_party/WebKit/Source/core/html/forms/RadioInputType.cpp

Issue 2045603002: Handle the "key" field as opposed to keyIdentifier field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove initialization of the view Created 4 years, 6 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: third_party/WebKit/Source/core/html/forms/RadioInputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/RadioInputType.cpp b/third_party/WebKit/Source/core/html/forms/RadioInputType.cpp
index 78532406e42ad9857016003ed2b89de17e0740b1..656a6e9859bae0367eb17216eb7263ac3b3d21fa 100644
--- a/third_party/WebKit/Source/core/html/forms/RadioInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/RadioInputType.cpp
@@ -88,8 +88,8 @@ void RadioInputType::handleKeydownEvent(KeyboardEvent* event)
BaseCheckableInputType::handleKeydownEvent(event);
if (event->defaultHandled())
return;
- const String& key = event->keyIdentifier();
- if (key != "Up" && key != "Down" && key != "Left" && key != "Right")
+ const String& key = event->key();
+ if (key != "ArrowUp" && key != "ArrowDown" && key != "ArrowLeft" && key != "ArrowRight")
return;
if (event->ctrlKey() || event->metaKey() || event->altKey())
@@ -104,7 +104,7 @@ void RadioInputType::handleKeydownEvent(KeyboardEvent* event)
Document& document = element().document();
if (isSpatialNavigationEnabled(document.frame()))
return;
- bool forward = computedTextDirection() == RTL ? (key == "Down" || key == "Left") : (key == "Down" || key == "Right");
+ bool forward = computedTextDirection() == RTL ? (key == "ArrowDown" || key == "ArrowLeft") : (key == "ArrowDown" || key == "ArrowRight");
// We can only stay within the form's children if the form hasn't been demoted to a leaf because
// of malformed HTML.
@@ -128,8 +128,8 @@ void RadioInputType::handleKeydownEvent(KeyboardEvent* event)
void RadioInputType::handleKeyupEvent(KeyboardEvent* event)
{
- const String& key = event->keyIdentifier();
- if (key != "U+0020")
+ const String& key = event->key();
+ if (key != " ")
return;
// If an unselected radio is tabbed into (because the entire group has nothing
// checked, or because of some explicit .focus() call), then allow space to check it.

Powered by Google App Engine
This is Rietveld 408576698