| 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 06a4be9aa064ee6d75525ab5d0ae94db5501f744..99734bd5547b0238af4bcdb2e3335dc97b336e15 100644
|
| --- a/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp
|
| +++ b/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp
|
| @@ -36,10 +36,13 @@
|
| #include "core/InputTypeNames.h"
|
| #include "core/dom/AXObjectCache.h"
|
| #include "core/dom/NodeComputedStyle.h"
|
| +#include "core/dom/Touch.h"
|
| +#include "core/dom/TouchList.h"
|
| #include "core/dom/shadow/ShadowRoot.h"
|
| #include "core/events/KeyboardEvent.h"
|
| #include "core/events/MouseEvent.h"
|
| #include "core/events/ScopedEventQueue.h"
|
| +#include "core/events/TouchEvent.h"
|
| #include "core/html/HTMLDataListElement.h"
|
| #include "core/html/HTMLDataListOptionsCollection.h"
|
| #include "core/html/HTMLDivElement.h"
|
| @@ -163,6 +166,29 @@
|
| if (targetNode == thumb)
|
| return;
|
| thumb->dragFrom(event->absoluteLocation());
|
| +}
|
| +
|
| +void RangeInputType::handleTouchEvent(TouchEvent* event)
|
| +{
|
| + if (element().isDisabledOrReadOnly())
|
| + return;
|
| +
|
| + if (event->type() == EventTypeNames::touchend) {
|
| + element().dispatchFormControlChangeEvent();
|
| + event->setDefaultHandled();
|
| + return;
|
| + }
|
| +
|
| + TouchList* touches = event->targetTouches();
|
| + if (touches->length() == 1) {
|
| + sliderThumbElement()->setPositionFromPoint(touches->item(0)->absoluteLocation());
|
| + event->setDefaultHandled();
|
| + }
|
| +}
|
| +
|
| +bool RangeInputType::hasTouchEventHandler() const
|
| +{
|
| + return true;
|
| }
|
|
|
| void RangeInputType::handleKeydownEvent(KeyboardEvent* event)
|
| @@ -236,7 +262,6 @@
|
| track->appendChild(SliderThumbElement::create(document));
|
| HTMLElement* container = SliderContainerElement::create(document);
|
| container->appendChild(track);
|
| - container->setAttribute(styleAttr, "-webkit-appearance:inherit");
|
| element().userAgentShadowRoot()->appendChild(container);
|
| }
|
|
|
|
|