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

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

Issue 2209773002: Remove the blocking touch handlers for the input[type=range] and add touch-action instead (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move the touch event handlers to the container in the shadow dom Created 4 years, 4 months 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 e91b6744e21b01b7d9fde5abab14d158326bc22a..e68d715e0f5a7f3fbbc45c73106d74dd28ddb4cb 100644
--- a/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp
@@ -151,6 +151,11 @@ bool RangeInputType::isSteppable() const
return true;
}
+bool RangeInputType::hasPassiveTouchEventHandler() const
+{
+ return true;
+}
+
void RangeInputType::handleMouseDownEvent(MouseEvent* event)
{
if (element().isDisabledOrReadOnly())
@@ -168,29 +173,6 @@ void RangeInputType::handleMouseDownEvent(MouseEvent* event)
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)
{
if (element().isDisabledOrReadOnly())
@@ -262,6 +244,7 @@ void RangeInputType::createShadowSubtree()
track->appendChild(SliderThumbElement::create(document));
HTMLElement* container = SliderContainerElement::create(document);
container->appendChild(track);
+ container->setAttribute(idAttr, ShadowElementNames::sliderContainer());
element().userAgentShadowRoot()->appendChild(container);
}

Powered by Google App Engine
This is Rietveld 408576698