Git init
[framework/web/webkit-efl.git] / LayoutTests / fast / spatial-navigation / snav-fully-aligned-horizontally.html
1 <html>
2   <!--
3     This test ensures the correctness of the "Fully aligned" precedence
4     logic implemented by Spatial Navigation algorithm in an horizontal direction:
5     targets whose middle falls between the top and bottom of the current focused
6     element are preferably to move focus to, even if it is not the shortest distance.
7
8     * Pre-conditions:
9     1) DRT support for SNav enable/disable.
10
11     * Navigation steps:
12     1) Loads this page, focus goes to "start" automatically.
13     2) Focus moves preferably to elements right up or above the
14        current focused element, even when there are some other closer
15        but not vertically aligned elements in the same direction.
16   -->
17   <head>
18     <script src="../js/resources/js-test-pre.js"></script>
19     <script src="resources/spatial-navigation-utils.js"></script>
20     <script type="application/javascript">
21
22     var resultMap = [
23       ["Down", "1"],
24       ["Right", "2"],
25       ["Down", "4"],
26       ["Left", "3"],
27       ["Down", "5"],
28       ["Right", "6"],
29       ["Down", "8"],
30       ["Left", "7"],
31       ["Down", "9"],
32       ["Right", "10"],
33       ["Down", "12"],
34       ["Left", "11"],
35       ["Down", "13"],
36       ["Right", "14"],
37       ["Down", "16"],
38       ["Left", "15"],
39       ["Down", "17"],
40       ["Right", "18"],
41       ["Down", "20"],
42       ["Left", "19"],
43       ["Down", "21"],
44       ["Right", "22"],
45       ["Down", "24"],
46       ["Left", "23"],
47       ["Down", "25"],
48       ["Right", "26"],
49       ["Down", "27"],
50       ["Down", "end"],
51       ["DONE", "DONE"]
52     ];
53
54     if (window.layoutTestController) {
55       layoutTestController.dumpAsText();
56       layoutTestController.setSpatialNavigationEnabled(true);
57       layoutTestController.overridePreference("WebKitTabToLinksPreferenceKey", 1);
58       layoutTestController.waitUntilDone();
59     }
60
61     function runTest()
62     {
63       // starting the test itself: get to a known place.
64       document.getElementById("start").focus();
65
66       initTest(resultMap, testCompleted);
67     }
68
69     function testCompleted()
70     {
71       if (window.layoutTestController)
72         layoutTestController.notifyDone();
73     }
74
75     window.onload = runTest;
76     </script>
77     <script src="js/resources/js-test-post.js"></script>
78   </head>
79   <body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
80     <a id="start" href="a">test<br></a>
81     <a id="1" href="a">H</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<a id="2" href="p">ow Now Brown Cow</a><br>
82     <a id="3" href="a">Ho</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; <a id="4" href="p">w Now Brown Cow</a><br>
83     <a id="5" href="a">How</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a id="6" href="p">Now Brown Cow</a><br>
84     <a id="7" href="a">How N</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <a id="8" href="p">ow Brown Cow</a><br>
85     <a id="9" href="a">How No</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="10" href="p">w Brown Cow</a><br>
86     <a id="11" href="a">How Now </a>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="12" href="p">Brown Cow</a><br>
87     <a id="13" href="a">How Now B</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="14" href="p">rown Cow</a><br>
88     <a id="15" href="a">How Now Br</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="16" href="p">own Cow</a><br>
89     <a id="17" href="a">How Now Bro</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="18" href="p">wn Cow</a><br>
90     <a id="19" href="a">How Now Brow</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a id="20" href="p">n Cow</a><br>
91     <a id="21" href="a">How Now Brown</a> &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; <a id="22" href="p">Cow</a><br>
92     <a id="23" href="a">How Now Brown C</a> &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="24" href="p">ow</a><br>
93     <a id="25" href="a">How Now Brown Co</a> &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="26" href="p">w</a><br>
94     <a id="27" href="a">How Now Brown Cow</a><br><br>
95     <a id="end" href="a">test<br></a>
96     <div id="console"></div>
97   </body>
98 </html>
99