Index: third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html |
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html b/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5084ee6af9e22362f4b4a49eda9edf5e4d6b0ffd |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html |
@@ -0,0 +1,38 @@ |
+<!DOCTYPE html> |
+<script src="../../../resources/testharness.js"></script> |
+<script src="../../../resources/testharnessreport.js"></script> |
+<div><input type="range" id="slider1"></input></div> |
+<div><input type="range" id="slider2" style="-webkit-appearance: slider-vertical;"></div> |
+<div><input type="range" id="slider3" style="touch-action:none;"></div> |
+<script> |
+function forceLayoutUpdate() { |
+ document.body.offsetTop; |
+} |
+ |
+forceLayoutUpdate(); |
+ |
+test(() => { |
+ assert_equals(internals.blockingTouchStartOrMoveEventHandlerCount(document), 4); |
+ assert_equals(internals.passiveTouchStartOrMoveEventHandlerCount(document), 3); |
+}, |
+'Tests that there are 4 blocking touch handlers in total(each slider has its own blocking touch-action, plus one blocking action defined by the user), and that there are 3 passive touch handlers(each slider has its own handler to deal with the dragging event)'); |
+ |
+test(() => { |
+ var slider1 = document.getElementById('slider1'); |
+ var slider2 = document.getElementById('slider2'); |
+ var slider3 = document.getElementById('slider3') |
+ var ctner1 = internals.shadowRoot(slider1).getElementById('container'); |
majidvp
2016/08/12 03:35:43
ctner does not read that well. how about just usin
|
+ var ctner2 = internals.shadowRoot(slider2).getElementById('container'); |
+ var ctner3 = internals.shadowRoot(slider3).getElementById('container'); |
+ assert_equals(getComputedStyle(ctner1).touchAction, 'pan-y'); |
+ assert_equals(getComputedStyle(ctner2).touchAction, 'pan-x'); |
+ assert_equals(getComputedStyle(ctner3).touchAction, 'pan-y'); |
+ assert_equals(getComputedStyle(slider3).touchAction, 'none'); |
+ |
+ slider1.style="-webkit-appearance: slider-vertical;"; |
+ slider2.style=""; |
+ forceLayoutUpdate(); |
+ assert_equals(getComputedStyle(ctner1).touchAction, 'pan-x'); |
+ assert_equals(getComputedStyle(ctner2).touchAction, 'pan-y'); |
+}, "Tests that each range input type has the correct pan-x or pan-y touch-action inside its shadow element: container. This touch-action is under the user-specified touch-action, and will update with the -webkit-appearance."); |
+</script> |