OLD | NEW |
| (Empty) |
1 <!doctype html> | |
2 <html> | |
3 <head> | |
4 <title>Pointer Event: Dispatch pointerenter. (nohover)</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 is moved into the hit test boundaries of an element | |
8 or one of its descendants as a result of a pointerdown event, the pointerenter e
vent must be dispatched. "/> | |
9 <link rel="stylesheet" type="text/css" href="pointerevent_styles.css"> | |
10 <!-- /resources/testharness.js --> | |
11 <script src="/resources/testharness.js"></script> | |
12 <script src="/resources/testharnessreport.js"></script> | |
13 <!-- Additional helper script for common checks across event types --> | |
14 <script type="text/javascript" src="pointerevent_support.js"></script> | |
15 <script type="text/javascript"> | |
16 var detected_pointertypes = {}; | |
17 var test_pointerEvent = async_test("pointerenter event"); // set up
test harness | |
18 // showPointerTypes is defined in pointerevent_support.js | |
19 // Requirements: the callback function will reference the test_point
erEvent object and | |
20 // will fail unless the async_test is created with the var name "tes
t_pointerEvent". | |
21 add_completion_callback(showPointerTypes); | |
22 | |
23 var test_pointerEnter; | |
24 var f_pointerenter_rcvd = false; | |
25 var pointerenter_event; | |
26 | |
27 function run() { | |
28 var target0 = document.getElementById("target0"); | |
29 | |
30 on_event(target0, "pointerdown", function (event) { | |
31 if(event.pointerType == 'touch') { | |
32 check_PointerEvent(event); | |
33 test_pointerEvent.step(function () { | |
34 assert_equals(event.type, "pointerdown", "pointer ev
ent received: " + event.type); | |
35 assert_true(f_pointerenter_rcvd, "pointerenter event
should have been received before pointerdown"); | |
36 assert_equals(event.pointerType, pointerenter_event.
pointerType, "pointerType is same for pointerenter and pointerdown"); | |
37 assert_equals(event.isPrimary, pointerenter_event.is
Primary, "isPrimary is same for pointerenter and pointerdown"); | |
38 }); | |
39 test_pointerEvent.done(); // complete test | |
40 } | |
41 }); | |
42 | |
43 on_event(target0, "pointerenter", function (event) { | |
44 detected_pointertypes[event.pointerType] = true; | |
45 if(event.pointerType == 'touch') { | |
46 pointerenter_event = event; | |
47 check_PointerEvent(event); | |
48 test_pointerEvent.step(function () { | |
49 assert_equals(event.type, "pointerenter", "pointer e
vent received: " + event.type); | |
50 }); | |
51 f_pointerenter_rcvd = true; | |
52 } | |
53 }); | |
54 } | |
55 </script> | |
56 </head> | |
57 <body onload="run()"> | |
58 <h1>Pointer Event: Dispatch pointerenter (nohover)</h1> | |
59 <h4> | |
60 Test Description: | |
61 When a pointing device that does not support hover is moved into the
hit test boundaries of an element or one of its | |
62 descendants as a result of a pointerdown event, the pointerenter eve
nt must be dispatched. | |
63 </h4> | |
64 <br /> | |
65 <div id="target0"> | |
66 Tap here. | |
67 </div> | |
68 <div id="complete-notice"> | |
69 <p>Test complete: Scroll to Summary to view Pass/Fail Results.</p> | |
70 <p>The following pointer types were detected: <span id="pointertype-
log"></span>.</p> | |
71 </div> | |
72 <div id="log"></div> | |
73 </body> | |
74 </html> | |
OLD | NEW |