Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp |
| diff --git a/third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp b/third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp |
| index 8d9d3f157686106527291c1d3c1f15c6a4c3c210..7c3a1b5884a9f3e055fb52483082f2383eab1b15 100644 |
| --- a/third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp |
| +++ b/third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp |
| @@ -143,6 +143,24 @@ void SliderThumbElement::setPositionFromPoint(const LayoutPoint& point) |
| } |
| position = std::min(position, trackSize).clampNegativeToZero(); |
| const Decimal ratio = Decimal::fromDouble(static_cast<double>(position) / trackSize); |
| + HTMLInputElement* host = hostInput(); |
|
majidvp
2016/08/04 15:20:36
I don't think this component should be involved wi
|
| + if (!isVertical) { |
|
majidvp
2016/08/04 15:20:36
Good catch handling the vertical case. I think the
|
| + if (ratio <= Decimal(0)) { |
| + host->setAttribute(styleAttr, "touch-action:pan-y pan-left"); |
| + } else if (ratio >= Decimal(1)) { |
| + host->setAttribute(styleAttr, "touch-action:pan-y pan-right"); |
| + } else { |
| + host->setAttribute(styleAttr, "touch-action:pan-y"); |
| + } |
| + } else { |
| + if (ratio <= Decimal(0)) { |
| + host->setAttribute(styleAttr, "touch-action:pan-x pan-down"); |
| + } else if (ratio >= Decimal(1)) { |
| + host->setAttribute(styleAttr, "touch-action:pan-x pan-up"); |
| + } else { |
| + host->setAttribute(styleAttr, "touch-action:pan-x"); |
| + } |
| + } |
| const Decimal fraction = isVertical || !isLeftToRightDirection ? Decimal(1) - ratio : ratio; |
| StepRange stepRange(input->createStepRange(RejectAny)); |
| Decimal value = stepRange.clampValue(stepRange.valueFromProportion(fraction)); |