| OLD | NEW |
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <script src="../../../resources/js-test.js"></script> | 2 <script src="../../../resources/js-test.js"></script> |
| 3 <style> | 3 <style> |
| 4 div.test { | 4 div.test { |
| 5 margin: 10px; | 5 margin: 10px; |
| 6 width: 100px; | 6 width: 100px; |
| 7 height: 200px; | 7 height: 200px; |
| 8 overflow: scroll; | 8 overflow: scroll; |
| 9 border: solid 1px; | 9 border: solid 1px; |
| 10 float: left; | 10 float: left; |
| 11 } | 11 } |
| 12 </style> | 12 </style> |
| 13 | 13 |
| 14 <div id="target" class="test"></div> | 14 <div id="target" class="test"></div> |
| 15 | 15 |
| 16 <div id="console"></div> | 16 <div id="console"></div> |
| 17 | 17 |
| 18 <script> | 18 <script> |
| 19 description("Verifies that pointercancel events are fired correctly on touch."); | 19 description("Verifies that pointercancel events are fired correctly on touch."); |
| 20 | 20 |
| 21 var eventToPreventDefault = ""; | 21 var eventToPreventDefault = ""; |
| 22 | 22 |
| 23 function init() { | 23 function init() { |
| 24 var eventList = ["pointerdown", "pointerup", "pointermove", "pointercancel", | 24 var eventList = ["pointerdown", "pointerup", "pointermove", "pointercancel", "
pointerover", "pointerenter", "pointerout", "pointerleave", |
| 25 "touchstart", "touchend", "touchmove", "touchcancel"]; | 25 "touchstart", "touchend", "touchmove", "touchcancel"]; |
| 26 | 26 |
| 27 eventList.forEach(function(eventName) { | 27 eventList.forEach(function(eventName) { |
| 28 document.getElementById("target").addEventListener(eventName, function(event
) { | 28 document.getElementById("target").addEventListener(eventName, function(event
) { |
| 29 var idMsg; | 29 var idMsg; |
| 30 if (event.type.startsWith("pointer")) | 30 if (event.type.startsWith("pointer")) |
| 31 idMsg = ", pointerId=" + event.pointerId; | 31 idMsg = ", pointerId=" + event.pointerId; |
| 32 else { | 32 else { |
| 33 idMsg = ", touchIds="; | 33 idMsg = ", touchIds="; |
| 34 touches = event.changedTouches; | 34 touches = event.changedTouches; |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 } | 201 } |
| 202 | 202 |
| 203 | 203 |
| 204 init(); | 204 init(); |
| 205 if (window.eventSender) | 205 if (window.eventSender) |
| 206 runTests(); | 206 runTests(); |
| 207 else | 207 else |
| 208 debug("This test requires eventSender"); | 208 debug("This test requires eventSender"); |
| 209 | 209 |
| 210 </script> | 210 </script> |
| OLD | NEW |