Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / spatial-navigation / snav-symmetrically-positioned.html
blob85986fa2edd335eabf128303b7e9af3dc439343f
1 <!DOCTYPE html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 <script src="resources/spatial-navigation-utils.js"></script>
5 </head>
6 <style>
7 body a {
8 position: absolute;
9 height: 40px;
10 width: 80px;
11 border: 1px solid black;
13 #e1 {
14 left: calc(100px - 100px / 2);
15 top: calc(150px - 100px / 2);
17 #e2 {
18 left: calc(400px - 100px / 2);
19 top: calc(150px - 100px / 2);
21 #e3 {
22 left: calc((400px + 100px) / 2 - 100px / 2);
23 top: calc((450px + 150px) / 2 - 100px / 2);
25 #e4 {
26 left: calc(100px - 100px / 2);
27 top: calc(450px - 100px / 2);
29 #e5 {
30 left: calc(400px - 100px / 2);
31 top: calc(450px - 100px / 2);
33 </style>
34 <body id="some-content" onload="runTest()">
35 <p id="description"></p>
36 <div id="elements">
37 <a id="e1" href="#e1">E1</a>
38 <a id="e2" href="#e2">E2</a>
39 <a id="e3" href="#e3">E3</a>
40 <a id="e4" href="#e4">E4</a>
41 <a id="e5" href="#e5">E5</a>
42 </div>
43 <div id="console"></div>
44 <script type="application/javascript">
45 description('This test ensures that Spatial Navigation works with symmetrically positoned rects');
47 jsTestIsAsync = true;
49 var resultMap = [
50 ["Down", "e3"],
51 ["Down", "e4"],
52 ["Up", "e3"],
53 ["Up", "e1"],
54 ["Right", "e2"],
55 ["Down", "e3"],
56 ["Down", "e4"],
57 ["Right", "e5"],
58 ["DONE", "DONE"]
61 if (window.testRunner) {
62 testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
63 window.internals.settings.setSpatialNavigationEnabled(true);
66 function runTest()
68 // starting the test itself: get to a known place.
69 document.getElementById("e1").focus();
71 initTest(resultMap, finishJSTest);
73 </script>
74 </body>
75 </html>