Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / spatial-navigation / snav-iframe-with-offscreen-focusable-element.html
blob7ed48ed2dbc0a041f5480c3a83f51490763d3c7e
1 <html>
2 <!--
3 This test ensures the cross iframe traversal correctness of Spatial Navigation
4 algorithm: focusable elements in an <iframe> should be accessible even when
5 the current focused element is in another <iframe> in the same page.
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 two iframes in the
13 Web page, eventually going to outer an southward link, but
14 going back to the iframe on the top 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", "1"],
24 ["Down", "1"],
25 ["Down", "1"],
26 ["Down", "1"],
27 ["Down", "1"],
28 ["Down", "1"],
29 ["Down", "2"],
30 ["Down", "end"],
31 ["Up", "2"],
32 ["Up", "2"],
33 ["Up", "2"],
34 ["Up", "2"],
35 ["Up", "2"],
36 ["Up", "2"],
37 ["Up", "2"],
38 ["Up", "1"],
39 ["Up", "start"],
40 ["DONE", "DONE"]
43 if (window.testRunner) {
44 testRunner.dumpAsText();
45 testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
46 window.internals.settings.setSpatialNavigationEnabled(true);
47 testRunner.waitUntilDone();
50 function runTest()
52 // starting the test itself: get to a known place.
53 document.getElementById("start").focus();
55 initTest(resultMap, testCompleted);
58 function testCompleted()
60 if (window.testRunner)
61 testRunner.notifyDone();
64 window.onload = runTest;
65 </script>
66 </head>
67 <body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
68 <div><a id="start" href="a"><img src="resources/green.png" width=30 height=30></a></div>
70 <iframe width="80" height="80" scrolling="auto" src="data:text/html,
71 <body>
72 <a id='1' href='a'><img src='no_image' width=30 height=30></a>
73 <div>
74 <img src='no_image' width=50 height=300>
75 <a id='2' href='a'><img src='no_image' width=30 height=30></a>
76 </div>
77 </body>
78 "></iframe><br>
80 <div><a id="end" href="a"><img src="resources/green.png" width=30 height=30></a></div>
81 <div id="console"></div>
82 </body>
83 </html>