Chromium Code Reviews| 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 e91b6744e21b01b7d9fde5abab14d158326bc22a..c968e7573600d2148c231ca626758d4aa2c80c8d 100644 |
| --- a/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp |
| +++ b/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp |
| @@ -186,9 +186,9 @@ void RangeInputType::handleTouchEvent(TouchEvent* event) |
| } |
| } |
| -bool RangeInputType::hasTouchEventHandler() const |
| +TouchHandlerType RangeInputType::touchEventHandlerType() const |
| { |
| - return true; |
| + return Passive; |
| } |
| void RangeInputType::handleKeydownEvent(KeyboardEvent* event) |
| @@ -259,6 +259,16 @@ void RangeInputType::createShadowSubtree() |
| HTMLDivElement* track = HTMLDivElement::create(document); |
| track->setShadowPseudoId(AtomicString("-webkit-slider-runnable-track")); |
| track->setAttribute(idAttr, ShadowElementNames::sliderTrack()); |
| + bool isVertical = false; |
| + if (element().layoutObject()) { |
| + ControlPart part = element().layoutObject()->style()->appearance(); |
| + isVertical = part == SliderVerticalPart; |
| + } |
| + if (isVertical) { |
| + track->setAttribute(styleAttr, "touch-action:pan-x"); |
| + } else { |
| + track->setAttribute(styleAttr, "touch-action:pan-y"); |
| + } |
|
majidvp
2016/08/04 21:21:58
This logic looks reasonable but I think this does
|
| track->appendChild(SliderThumbElement::create(document)); |
| HTMLElement* container = SliderContainerElement::create(document); |
| container->appendChild(track); |