OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script src="../../../resources/testharness.js"></script> | |
3 <script src="../../../resources/testharnessreport.js"></script> | |
4 <div><input type="range" id="slider1"></input></div> | |
5 <div><input type="range" id="slider2" style="-webkit-appearance: slider-vertical ;"></div> | |
6 <div><input type="range" id="slider3" style="touch-action:none;"></div> | |
7 <script> | |
8 function forceLayoutUpdate() { | |
9 document.body.offsetTop; | |
10 } | |
11 | |
12 forceLayoutUpdate(); | |
13 | |
14 test(() => { | |
15 assert_equals(internals.blockingTouchStartOrMoveEventHandlerCount(document), 4 ); | |
16 assert_equals(internals.passiveTouchStartOrMoveEventHandlerCount(document), 3) ; | |
17 }, | |
18 '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)'); | |
tkent
2016/08/17 01:32:00
We should test user-facing behavior instead of int
| |
19 | |
20 test(() => { | |
21 var slider1 = document.getElementById('slider1'); | |
22 var slider2 = document.getElementById('slider2'); | |
23 var slider3 = document.getElementById('slider3') | |
24 var container1 = internals.shadowRoot(slider1).children[0]; | |
25 var container2 = internals.shadowRoot(slider2).children[0]; | |
26 var container3 = internals.shadowRoot(slider3).children[0]; | |
27 assert_equals(getComputedStyle(container1).touchAction, 'pan-y'); | |
28 assert_equals(getComputedStyle(container2).touchAction, 'pan-x'); | |
29 assert_equals(getComputedStyle(container3).touchAction, 'pan-y'); | |
30 assert_equals(getComputedStyle(slider3).touchAction, 'none'); | |
31 | |
32 slider1.style="-webkit-appearance: slider-vertical;"; | |
33 slider2.style=""; | |
34 forceLayoutUpdate(); | |
35 assert_equals(getComputedStyle(container1).touchAction, 'pan-x'); | |
36 assert_equals(getComputedStyle(container2).touchAction, 'pan-y'); | |
37 }, "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-speci fied touch-action, and will update with the -webkit-appearance."); | |
38 </script> | |
OLD | NEW |