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

Unified Diff: third_party/WebKit/Source/core/html/forms/RangeInputType.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/RangeInputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp b/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp
index ca18f3aa53a0ef9bd8806f4848f74123d0af9ce2..ffb1bea547ced6d726fa0c49491ee02e294464b3 100644
--- a/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp
@@ -197,7 +197,7 @@ void RangeInputType::handleKeydownEvent(KeyboardEvent* event)
if (element().isDisabledOrReadOnly())
return;
- const String& key = event->keyIdentifier();
+ const String& key = event->key();
const Decimal current = parseToNumberOrNaN(element().value());
ASSERT(current.isFinite());
@@ -219,13 +219,13 @@ void RangeInputType::handleKeydownEvent(KeyboardEvent* event)
}
Decimal newValue;
- if (key == "Up")
+ if (key == "ArrowUp")
newValue = current + step;
- else if (key == "Down")
+ else if (key == "ArrowDown")
newValue = current - step;
- else if (key == "Left")
+ else if (key == "ArrowLeft")
newValue = (isVertical || dir == RTL) ? current + step : current - step;
- else if (key == "Right")
+ else if (key == "ArrowRight")
newValue = (isVertical || dir == RTL) ? current - step : current + step;
else if (key == "PageUp")
newValue = current + bigStep;

Powered by Google App Engine
This is Rietveld 408576698