OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <html> |
| 3 <head> |
| 4 <title>Pointerleave + descendant</title> |
| 5 <meta name="viewport" content="width=device-width"> |
| 6 <link rel="stylesheet" type="text/css" href="pointerevent_styles.css"> |
| 7 <script src="/resources/testharness.js"></script> |
| 8 <script src="/resources/testharnessreport.js"></script> |
| 9 <script src="pointerevent_support.js"></script> |
| 10 </head> |
| 11 <body onload="run()"> |
| 12 <h1>pointerleave</h1> |
| 13 <h4> |
| 14 Test Description: This test checks if pointerleave event works prope
rly. |
| 15 <p>Put your mouse over the black rectangle and then move it out thro
ugh purple rectangle boundaries.</p> |
| 16 </h4> |
| 17 <p> |
| 18 <div id="target0" style="background:black; height: 47px;"> |
| 19 <div style="background:purple; height: 35px; width: 90%; position: a
bsolute"></div> |
| 20 </div> |
| 21 <script> |
| 22 var eventTested = false; |
| 23 var detected_pointertypes = {}; |
| 24 |
| 25 add_completion_callback(showPointerTypes); |
| 26 |
| 27 function run() { |
| 28 var target0 = document.getElementById("target0"); |
| 29 var test_pointerleave = async_test("pointerleave event received"
); |
| 30 |
| 31 on_event(target0, "pointerover", function(event) { |
| 32 detected_pointertypes[ event.pointerType ] = true; |
| 33 }); |
| 34 |
| 35 // When a pointing device is moved off of the hit test boundarie
s of an element and all of its descendants, the pointerleave event must be dispa
tched. |
| 36 // TA: 9.1 |
| 37 on_event(target0, "pointerleave", function (event) { |
| 38 if (eventTested == false) { |
| 39 test_pointerleave.done(); |
| 40 eventTested = true; |
| 41 } |
| 42 }); |
| 43 } |
| 44 </script> |
| 45 <h1>Pointer Events pointerleave tests</h1> |
| 46 <div id="complete-notice"> |
| 47 <p>The following pointer types were detected: <span id="pointertype-
log"></span>.</p> |
| 48 <p>Refresh the page to run the tests again with a different pointer
type.</p> |
| 49 </div> |
| 50 <div id="log"></div> |
| 51 </body> |
| 52 </html> |
OLD | NEW |