Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / spatial-navigation / snav-table-traversal.html
blob9487578bda98eeceb56a9edc748a10b04bfe1291
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 through the sparsely positioned elements
13 in the table, eventually going to an outer southward link,
14 but going 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", "4"],
23 ["Down", "7"],
24 ["Down", "end"],
25 ["Up", "7"],
26 ["Right", "8"],
27 ["Right", "9"],
28 ["Up", "6"],
29 ["Up", "3"],
30 ["Left", "2"],
31 ["Left", "1"],
32 ["DONE", "DONE"]
35 if (window.testRunner) {
36 testRunner.dumpAsText();
37 testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
38 window.internals.settings.setSpatialNavigationEnabled(true);
39 testRunner.waitUntilDone();
42 function runTest()
44 // starting the test itself: get to a known place.
45 document.getElementById("start").focus();
47 initTest(resultMap, testCompleted);
50 function testCompleted()
52 if (window.testRunner)
53 testRunner.notifyDone();
56 window.onload = runTest;
58 </script>
59 </head>
60 <body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
61 <table style="text-align: left; width: 100%; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="1">
62 <tbody>
63 <tr>
64 <td style="vertical-align: top; text-align: center;"><a id="start" href="a">a</a></td>
65 <td style="vertical-align: top; text-align: center;"><a id="2" href="a">a</a></td>
66 <td style="vertical-align: top; text-align: center;"><a id="3" href="a">a</a></td>
67 </tr>
68 <tr>
69 <td style="vertical-align: top; text-align: center;"><a id="4" href="a">a</a></td>
70 <td style="vertical-align: top; text-align: center;"><a id="5" href="a">a</a></td>
71 <td style="vertical-align: top; text-align: center;"><a id="6" href="a">a</a></td>
72 </tr>
73 <tr>
74 <td style="vertical-align: top; text-align: center;"><a id="7" href="a">a</a></td>
75 <td style="vertical-align: top; text-align: center;"><a id="8" href="a">a</a></td>
76 <td style="vertical-align: top; text-align: center;"><a id="9" href="a">a</a></td>
77 </tr>
78 </tbody>
79 </table>
80 <div style='margin-top:100px'>
81 <a id="end" href="a">End of table traversal test</a>
82 </div>
83 <div id="console"></div>
84 </body>
85 </html>