summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-iframe-nested.html
blob: 99ce32cd6b3d1e10a6c5b54a246883764ba49f5a (plain)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<html>
  <!--
    This test ensures the cross iframe traversal correctness of spatial navigation:
    focusable elements in nested inner frame should be accessible.

    * Pre-conditions:
    1) DRT support for spatial navigation enable/disable.

    * Navigation steps:
    1) Loads this page, focus goes to "start" automatically.
    2) Focus moves along the elements in the two level deep nested frame,
       but going back to the main frame later on.
  -->
  <head>
    <script src="../js/resources/js-test-pre.js"></script>
    <script src="resources/spatial-navigation-utils.js"></script>
    <script type="application/javascript">

    var resultMap = [
      ["Right", "1"],
      ["Right", "2"],
      ["Right", "3"],
      ["Right", "4"],
      ["Right", "5"],
      ["Right", "6"],
      ["Right", "7"],
      ["Right", "8"],
      ["Right", "9"],
      ["Left", "8"],
      ["Left", "7"],
      ["Left", "6"],
      ["Left", "5"],
      ["Left", "4"],
      ["Left", "3"],
      ["Left", "2"],
      ["Left", "1"],
      ["Left", "start"],
      ["DONE", "DONE"]
    ];

    if (window.testRunner) {
      testRunner.dumpAsText();
      testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
      window.internals.settings.setSpatialNavigationEnabled(true);
      testRunner.waitUntilDone();
    }

    function runTest()
    {
      // starting the test itself: get to a known place.
      document.getElementById("start").focus();

      initTest(resultMap, testCompleted);
    }

    function testCompleted()
    {
      if (window.testRunner)
        testRunner.notifyDone();
    }

    window.onload = runTest;
    </script>
    <script src="js/resources/js-test-post.js"></script>
  </head>
  <body>
  <table style="text-align: top;"  border="0" cellpadding="3px" cellspacing="3px">
    <tr>
      <td valign="top" width="10%">
        <a id="start" href="#">Link</a><br>
      </td>
      <td valign="top">
        <iframe width="50%" height="100px" frameborder="1" src="resources/iframe.html"></iframe><br>
      </td>
      <td valign="top" width="10%">
        <a id="9" href="#">Link</a><br>
      </td>
    </tr>
    <tr>
      <td valign="top" width="10%">
        <a id="10" href="#">Link</a><br>
      </td>
      <td valign="top">
          <p><a id="11" href="#">Here</a> is a link.</p>
      </td>
      <td valign="top" width="10%">
        <a id="12" href="#">Link</a><br>
      </td>
    </tr>
  </table>
  <div id="console"></div>
  </body>
</html>