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

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

Issue 2749313002: Move slider implemention to use pointer capture (Closed)
Patch Set: Created 3 years, 9 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 d67be4f11948261b48c0ffedaea89485069d91f8..b24700293578bc3654f8fac1378a5348450c2b5a 100644
--- a/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp
@@ -31,6 +31,7 @@
#include "core/html/forms/RangeInputType.h"
+#include <limits>
#include "bindings/core/v8/ExceptionState.h"
#include "core/HTMLNames.h"
#include "core/InputTypeNames.h"
@@ -39,6 +40,7 @@
#include "core/dom/shadow/ShadowRoot.h"
#include "core/events/KeyboardEvent.h"
#include "core/events/MouseEvent.h"
+#include "core/events/PointerEvent.h"
#include "core/events/ScopedEventQueue.h"
#include "core/html/HTMLDataListElement.h"
#include "core/html/HTMLDataListOptionsCollection.h"
@@ -52,7 +54,6 @@
#include "core/layout/LayoutSlider.h"
#include "wtf/MathExtras.h"
#include "wtf/NonCopyingSort.h"
-#include <limits>
namespace blink {
@@ -148,7 +149,7 @@ bool RangeInputType::isSteppable() const {
return true;
}
-void RangeInputType::handleMouseDownEvent(MouseEvent* event) {
+void RangeInputType::handlePointerDownEvent(PointerEvent* event) {
if (element().isDisabledFormControl())
return;
@@ -164,7 +165,7 @@ void RangeInputType::handleMouseDownEvent(MouseEvent* event) {
SliderThumbElement* thumb = sliderThumbElement();
if (targetNode == thumb)
return;
- thumb->dragFrom(LayoutPoint(event->absoluteLocation()));
+ thumb->dragFrom(event);
}
void RangeInputType::handleKeydownEvent(KeyboardEvent* event) {
@@ -314,7 +315,7 @@ void RangeInputType::warnIfValueIsInvalid(const String& value) const {
void RangeInputType::disabledAttributeChanged() {
if (element().isDisabledFormControl())
- sliderThumbElement()->stopDragging();
+ sliderThumbElement()->releasePointerCapture();
}
bool RangeInputType::shouldRespectListAttribute() {

Powered by Google App Engine
This is Rietveld 408576698