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

Unified Diff: third_party/WebKit/Source/core/html/shadow/DateTimeFieldElement.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/shadow/DateTimeFieldElement.cpp
diff --git a/third_party/WebKit/Source/core/html/shadow/DateTimeFieldElement.cpp b/third_party/WebKit/Source/core/html/shadow/DateTimeFieldElement.cpp
index 12586db3b5b07cecc9fde70d469ed6360d9a31dd..49ed736f024506fd35942f71f60b3c02fc764116 100644
--- a/third_party/WebKit/Source/core/html/shadow/DateTimeFieldElement.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/DateTimeFieldElement.cpp
@@ -95,9 +95,9 @@ void DateTimeFieldElement::defaultKeyboardEventHandler(KeyboardEvent* keyboardEv
if (isDisabled() || isFieldOwnerDisabled())
return;
- const String& keyIdentifier = keyboardEvent->keyIdentifier();
+ const String& key = keyboardEvent->key();
- if (keyIdentifier == "Left") {
+ if (key == "ArrowLeft") {
if (!m_fieldOwner)
return;
// FIXME: We'd like to use FocusController::advanceFocus(FocusDirectionLeft, ...)
@@ -107,7 +107,7 @@ void DateTimeFieldElement::defaultKeyboardEventHandler(KeyboardEvent* keyboardEv
return;
}
- if (keyIdentifier == "Right") {
+ if (key == "ArrowRight") {
if (!m_fieldOwner)
return;
// FIXME: We'd like to use FocusController::advanceFocus(FocusDirectionRight, ...)
@@ -120,7 +120,7 @@ void DateTimeFieldElement::defaultKeyboardEventHandler(KeyboardEvent* keyboardEv
if (isFieldOwnerReadOnly())
return;
- if (keyIdentifier == "Down") {
+ if (key == "ArrowDown") {
if (keyboardEvent->getModifierState("Alt"))
return;
keyboardEvent->setDefaultHandled();
@@ -128,13 +128,13 @@ void DateTimeFieldElement::defaultKeyboardEventHandler(KeyboardEvent* keyboardEv
return;
}
- if (keyIdentifier == "Up") {
+ if (key == "ArrowUp") {
keyboardEvent->setDefaultHandled();
stepUp();
return;
}
- if (keyIdentifier == "U+0008" || keyIdentifier == "U+007F") {
+ if (key == "Backspace" || key == "Delete") {
keyboardEvent->setDefaultHandled();
setEmptyValue(DispatchEvent);
return;

Powered by Google App Engine
This is Rietveld 408576698