-
Notifications
You must be signed in to change notification settings - Fork 9
/
pointerover-span.html
66 lines (61 loc) · 2 KB
/
pointerover-span.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!doctype html>
<html>
<!--
Test cases for Pointer Events v1 spec
This document references Test Assertions (abbrev TA below)
-->
<head>
<title>Pointer Events pointerdown Tests</title>
<meta name="viewport" content="width=device-width">
<link rel="author" href="mailto:[email protected]">
<link rel="help" href="http://www.w3.org/wiki/PointerEvents/TestAssertions">
<!-- http://w3c-test.org/resources/testharness.js -->
<script src="./testharness.js"></script>
<script src="pointer-prefix.js"></script>
<script>
// Pointer event test template (common) functions
setup({ explicit_done: true });
// Check for conformance to Pointer interface pointerover event on span element
// TA: 6.1 When a pointing device is moved into the hit test boundaries of an element, the pointerover event must be dispatched.
// An img is rendered on the screen.
// Starting with the pointer outside the element, moving the pointer over the element should trigger the pointerover event.
var test_pointerover = async_test("pointerover event received");
var pointerover = function(event) {
assert_equals(event.type,"MSPointerOver","event type is pointerover");
test_pointerover.done();
}
// run() must be called on the load event because target elements are undefined until the document is loaded
function run() {
var target0 = document.getElementById("target0");
test_pointerover.step(function() { target0.addEventListener("MSPointerOver", pointerover, false);});
}
</script>
<style>
div {
margin: 0em;
padding: 2em;
}
#target0 {
background: yellow;
border: 1px solid orange;
}
#complete-notice {
background: #afa;
border: 1px solid #0a0;
display: none;
}
#pointertype-log {
font-weight: bold;
}
</style>
</head>
<body onload="run()">
<h1>Pointer Events pointerover Tests</h1>
<span id="target0" src="http://www.w3.org/Icons/w3c_home">
Start with your pointing device<br/>
outside of this paragraph,<br/>
and then move it over the text.
</span>
<div id="log"></div>
</body>
</html>