OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <html> |
| 3 <head> |
| 4 <title>Pointer Event: Dispatch pointerleave (touch). </title> |
| 5 <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> |
| 6 <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> |
| 7 <meta name="assert" content="When a pointing device that does not suppor
t hover (such as a finger) leaves the hit test boundaries as a result of a point
erup event, the pointerleave event must be dispatched. "/> |
| 8 <link rel="stylesheet" type="text/css" href="pointerevent_styles.css"> |
| 9 <!-- /resources/testharness.js --> |
| 10 <script src="/resources/testharness.js"></script> |
| 11 <script src="/resources/testharnessreport.js"></script> |
| 12 <!-- Additional helper script for common checks across event types --> |
| 13 <script type="text/javascript" src="pointerevent_support.js"></script> |
| 14 <script type="text/javascript"> |
| 15 var detected_pointertypes = {}; |
| 16 var test_pointerEvent = async_test("pointerleave event"); |
| 17 // showPointerTypes is defined in pointerevent_support.js |
| 18 // Requirements: the callback function will reference the test_point
erEvent object and |
| 19 // will fail unless the async_test is created with the var name "tes
t_pointerEvent". |
| 20 add_completion_callback(showPointerTypes); |
| 21 |
| 22 function run() { |
| 23 var target0 = document.getElementById("target0"); |
| 24 |
| 25 on_event(target0, "pointerleave", function (event) { |
| 26 detected_pointertypes[event.pointerType] = true; |
| 27 check_PointerEvent(event); |
| 28 test_pointerEvent.step(function () { |
| 29 assert_equals(event.pointerType, "touch", "Test should b
e run using touch input"); |
| 30 assert_equals(event.type, "pointerleave", "The " + event
.type + " event received"); |
| 31 }); |
| 32 test_pointerEvent.done(); // complete test |
| 33 }); |
| 34 } |
| 35 </script> |
| 36 </head> |
| 37 <body onload="run()"> |
| 38 <h1>Pointer Event: Dispatch pointerleave (touch)</h1> |
| 39 <h4> |
| 40 Test Description: |
| 41 When a pointing device that does not support hover (such as a finger
) leaves the hit test boundaries as a result of a pointerup event, the pointerle
ave event must be dispatched. |
| 42 </h4> |
| 43 <br /> |
| 44 <div id="target0"> |
| 45 Use touch to tap on this box. |
| 46 </div> |
| 47 <div id="complete-notice"> |
| 48 <p>Test complete: Scroll to Summary to view Pass/Fail Results.</p> |
| 49 <p>The following pointer types were detected: <span id="pointertype-
log"></span>.</p> |
| 50 </div> |
| 51 <div id="log"></div> |
| 52 </body> |
| 53 </html> |
OLD | NEW |