Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / spatial-navigation / snav-tiny-table-traversal.html
blob146cf4169c764669e8c80a7039966763d350814e
1 <html>
2 <!--
3 This test ensures the basic table traversal correctness of
4 Spatial Navigation (SNav) algorithm: focusable elements in a
5 <table> should be accessible.
7 * Pre-conditions:
8 1) DRT support for SNav enable/disable.
10 * Navigation steps:
11 1) Loads this page, focus goes to "start" automatically.
12 2) Focus moves along the elements in the table, eventually
13 going to outer southward and eastward links, but going
14 back inside the table later on.
15 -->
16 <head>
17 <script src="../../resources/js-test.js"></script>
18 <script src="resources/spatial-navigation-utils.js"></script>
19 <script type="application/javascript">
21 var resultMap = [
22 ["Down", "1"],
23 ["Down", "4"],
24 ["Down", "7"],
25 ["Down", "end"],
26 ["Up", "7"],
27 ["Right", "8"],
28 ["Right", "9"],
29 ["Up", "6"],
30 ["Right", "right"],
31 ["Left", "6"],
32 ["Up", "3"],
33 ["Left", "2"],
34 ["Left", "1"],
35 ["DONE", "DONE"]
38 if (window.testRunner) {
39 testRunner.dumpAsText();
40 testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
41 window.internals.settings.setSpatialNavigationEnabled(true);
42 testRunner.waitUntilDone();
45 function runTest()
47 // starting the test itself: get to a known place.
48 document.getElementById("start").focus();
50 initTest(resultMap, testCompleted);
53 function testCompleted()
55 if (window.testRunner)
56 testRunner.notifyDone();
59 window.onload = runTest;
61 </script>
62 </head>
63 <body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
64 <a id="start" href="a">a</a><br>
65 <table>
66 <tbody>
67 <tr>
68 <td style="font-size: small;"><a id="1" href="a">a</a></td>
69 <td style="font-size: small;"><a id="2" href="a">a</a></td>
70 <td style="font-size: small;"><a id="3" href="a">a</a></td>
71 </tr>
72 <tr>
73 <td style="font-size: small;"><a id="4" href="a">a</a></td>
74 <td style="font-size: small;"><a id="5" href="a">a</a></td>
75 <td style="font-size: small;"><a id="6" href="a">a</a></td>
76 </tr>
77 <tr>
78 <td style="font-size: small;"><a id="7" href="a">a</a></td>
79 <td style="font-size: small;"><a id="8" href="a">a</a></td>
80 <td style="font-size: small;"><a id="9" href="a">a</a></td>
81 </tr>
82 </tbody>
83 </table>
84 <div style='margin-top:8px'>
85 <a id="end" href="a">a<a>
86 </div>
87 <div style="margin-left: 50px; margin-top:-70px">
88 <a id="right" href="http://www.google.com">a</a>
89 </div>
90 <div style="margin-top:100px" id="console"></div>
91 </body>
92 </html>