Chromium Code Reviews| 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)'); | |
| 19 | |
| 20 test(() => { | |
| 21 var slider1 = document.getElementById('slider1'); | |
| 22 var slider2 = document.getElementById('slider2'); | |
| 23 var slider3 = document.getElementById('slider3') | |
| 24 var ctner1 = internals.shadowRoot(slider1).getElementById('container'); | |
|
majidvp
2016/08/12 03:35:43
ctner does not read that well. how about just usin
| |
| 25 var ctner2 = internals.shadowRoot(slider2).getElementById('container'); | |
| 26 var ctner3 = internals.shadowRoot(slider3).getElementById('container'); | |
| 27 assert_equals(getComputedStyle(ctner1).touchAction, 'pan-y'); | |
| 28 assert_equals(getComputedStyle(ctner2).touchAction, 'pan-x'); | |
| 29 assert_equals(getComputedStyle(ctner3).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(ctner1).touchAction, 'pan-x'); | |
| 36 assert_equals(getComputedStyle(ctner2).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 |