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

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: Check if element is nullptr to fix the crash 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 99734bd5547b0238af4bcdb2e3335dc97b336e15..06a4be9aa064ee6d75525ab5d0ae94db5501f744 100644
--- a/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp
@@ -36,13 +36,10 @@
#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"
@@ -168,29 +165,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 +236,7 @@ void RangeInputType::createShadowSubtree()
track->appendChild(SliderThumbElement::create(document));
HTMLElement* container = SliderContainerElement::create(document);
container->appendChild(track);
+ container->setAttribute(styleAttr, "-webkit-appearance:inherit");
element().userAgentShadowRoot()->appendChild(container);
}

Powered by Google App Engine
This is Rietveld 408576698