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
67
68
69
70
71
72
73
74
75
76
|
<!DOCTYPE html>
<head>
<script src="../../resources/js-test.js"></script>
<script src="resources/spatial-navigation-utils.js"></script>
</head>
<style>
body a {
position: absolute;
height: 50px;
width: 100px;
border: 1px solid black;
}
#e1 {
left: 50px;
top: 250px;
}
#e2 {
left: 200px;
top: 300px;
height: 100px;
}
#e3 {
left: 350px;
top: 300px;
}
#e4 {
left: 500px;
top: 200px;
height: 100px;
}
#e5 {
left: 650px;
top: 250px;
}
</style>
<body id="some-content" onload="runTest()">
<p id="description"></p>
<div id="elements">
<a id="e1" href="#e1">E1</a>
<a id="e2" href="#e2">E2</a>
<a id="e3" href="#e3">E3</a>
<a id="e4" href="#e4">E4</a>
<a id="e5" href="#e5">E5</a>
</div>
<div id="console"></div>
<script type="application/javascript">
description('This test ensures that Spatial Navigation works with symmetrically positoned rects');
jsTestIsAsync = true;
var resultMap = [
["Right", "e4"],
["Right", "e5"],
["Left", "e4"],
["Left", "e1"],
["Down", "e2"],
["Right", "e3"],
["Right", "e4"],
["DONE", "DONE"]
];
if (window.testRunner) {
testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
window.internals.settings.setSpatialNavigationEnabled(true);
}
function runTest()
{
// starting the test itself: get to a known place.
document.getElementById("e1").focus();
initTest(resultMap, finishJSTest);
}
</script>
</body>
</html>
|