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

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

Issue 2555923002: Changed TextDirection to an enum class and renamed its members (Closed)
Patch Set: Rebase after reopen Created 4 years 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 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);

Powered by Google App Engine
This is Rietveld 408576698