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 190e88218b378dece8e4ddf0295ad76780987722..c37a04d43cfc20bdc3f2e2115a1b8c210c11a969 100644 |
--- a/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp |
+++ b/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp |
@@ -190,7 +190,7 @@ void RangeInputType::handleKeydownEvent(KeyboardEvent* event) { |
const Decimal bigStep = |
std::max((stepRange.maximum() - stepRange.minimum()) / 10, step); |
- TextDirection dir = LTR; |
+ TextDirection dir = TextDirection::Ltr; |
bool isVertical = false; |
if (element().layoutObject()) { |
dir = computedTextDirection(); |
@@ -199,24 +199,27 @@ void RangeInputType::handleKeydownEvent(KeyboardEvent* event) { |
} |
Decimal newValue; |
- if (key == "ArrowUp") |
+ if (key == "ArrowUp") { |
newValue = current + step; |
- else if (key == "ArrowDown") |
+ } else if (key == "ArrowDown") { |
newValue = current - step; |
- else if (key == "ArrowLeft") |
- newValue = (isVertical || dir == RTL) ? current + step : current - step; |
- else if (key == "ArrowRight") |
- newValue = (isVertical || dir == RTL) ? current - step : current + step; |
- else if (key == "PageUp") |
+ } else if (key == "ArrowLeft") { |
+ newValue = (isVertical || dir == TextDirection::Rtl) ? current + step |
+ : current - step; |
+ } else if (key == "ArrowRight") { |
+ newValue = (isVertical || dir == TextDirection::Rtl) ? current - step |
+ : current + step; |
+ } else if (key == "PageUp") { |
newValue = current + bigStep; |
- else if (key == "PageDown") |
+ } else if (key == "PageDown") { |
newValue = current - bigStep; |
- else if (key == "Home") |
+ } else if (key == "Home") { |
newValue = isVertical ? stepRange.maximum() : stepRange.minimum(); |
- else if (key == "End") |
+ } else if (key == "End") { |
newValue = isVertical ? stepRange.minimum() : stepRange.maximum(); |
- else |
+ } else { |
return; // Did not match any key binding. |
+ } |
newValue = stepRange.clampValue(newValue); |