OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>PointerEvent: Constructor test</title> | 4 <title>PointerEvent: Constructor test</title> |
5 <meta name="viewport" content="width=device-width"> | 5 <meta name="viewport" content="width=device-width"> |
6 <link rel="stylesheet" type="text/css" href="pointerevent_styles.css"> | 6 <link rel="stylesheet" type="text/css" href="pointerevent_styles.css"> |
7 <script src="/resources/testharness.js"></script> | 7 <script src="/resources/testharness.js"></script> |
8 <script src="/resources/testharnessreport.js"></script> | 8 <script src="/resources/testharnessreport.js"></script> |
9 <!-- Additional helper script for common checks across event types --> | 9 <!-- Additional helper script for common checks across event types --> |
10 <script type="text/javascript" src="pointerevent_support.js"></script> | 10 <script type="text/javascript" src="pointerevent_support.js"></script> |
(...skipping 15 matching lines...) Expand all Loading... |
26 ></div> | 26 ></div> |
27 <script> | 27 <script> |
28 window.eventHappened = ''; | 28 window.eventHappened = ''; |
29 | 29 |
30 All_Pointer_Events.forEach(function(event) { | 30 All_Pointer_Events.forEach(function(event) { |
31 var on_event = "on" + event; | 31 var on_event = "on" + event; |
32 | 32 |
33 test(function() { | 33 test(function() { |
34 const htmlElement = document.createElement("span"); | 34 const htmlElement = document.createElement("span"); |
35 const svgElement = document.createElementNS("http://www.w3.org/200
0/svg", "g"); | 35 const svgElement = document.createElementNS("http://www.w3.org/200
0/svg", "g"); |
36 for (const location of [window, htmlElement, svgElement, document]
) { | 36 for (var location of [window, htmlElement, svgElement, document])
{ |
37 assert_equals(location[on_event], null, | 37 assert_equals(location[on_event], null, |
38 `The default value of the property is null for a ${location.co
nstructor.name} instance`); | 38 `The default value of the property is null for a ${location.co
nstructor.name} instance`); |
39 } | 39 } |
40 }, "The default value of " + on_event + " is always null"); | 40 }, "The default value of " + on_event + " is always null"); |
41 | 41 |
42 test(function() { | 42 test(function() { |
43 window.eventHappened = ''; | 43 window.eventHappened = ''; |
44 const element = document.querySelector("#target0"); | 44 const element = document.querySelector("#target0"); |
45 const compiledHandler = element[on_event]; | 45 const compiledHandler = element[on_event]; |
46 assert_equals(typeof compiledHandler, "function", "The " + on_even
t + " property must be a function"); | 46 assert_equals(typeof compiledHandler, "function", "The " + on_even
t + " property must be a function"); |
(...skipping 11 matching lines...) Expand all Loading... |
58 }; | 58 }; |
59 element.dispatchEvent(new Event(event)); | 59 element.dispatchEvent(new Event(event)); |
60 }); | 60 }); |
61 </script> | 61 </script> |
62 <div id="complete-notice"> | 62 <div id="complete-notice"> |
63 <p>The following pointer types were detected: <span id="pointertype-log"></s
pan>.</p> | 63 <p>The following pointer types were detected: <span id="pointertype-log"></s
pan>.</p> |
64 </div> | 64 </div> |
65 <div id="log"></div> | 65 <div id="log"></div> |
66 </body> | 66 </body> |
67 </html> | 67 </html> |
OLD | NEW |