Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / spatial-navigation / snav-iframe-no-focusable-content.html
blobb90e78c081978d4ba3e9a8038e7e77f1ee96e454
1 <html>
2 <!--
3 This test ensures the basic traversal correctness of Spatial Navigation
4 algorithm: iframes without any focusable content should be ignored.
6 * Pre-conditions:
7 1) DRT support for SNav enable/disable.
9 * Navigation steps:
10 1) Loads this page, focus goes to "start" automatically.
11 2) Focus moves from "start" to "end" bypassing the two iframes
12 in between them, once both have no focusable elements inside.
13 -->
14 <head>
15 <script src="../../resources/js-test.js"></script>
16 <script src="resources/spatial-navigation-utils.js"></script>
17 <script type="application/javascript">
19 var resultMap = [
20 ["Down", "start"],
21 ["Down", "start"],
22 ["Down", "start"],
23 ["Down", "start"],
24 ["Down", "start"],
25 ["Down", "start"],
26 ["Down", "end"],
27 ["Up" , "end"],
28 ["Up" , "end"],
29 ["Up" , "end"],
30 ["Up" , "end"],
31 ["Up" , "end"],
32 ["Up" , "end"],
33 ["Up" , "start"],
34 ["DONE", "DONE"]
37 if (window.testRunner) {
38 testRunner.dumpAsText();
39 testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
40 window.internals.settings.setSpatialNavigationEnabled(true);
41 testRunner.waitUntilDone();
44 function runTest()
46 // starting the test itself: get to a known place.
47 document.getElementById("start").focus();
49 initTest(resultMap, testCompleted);
52 function testCompleted()
54 if (window.testRunner)
55 testRunner.notifyDone();
58 window.onload = runTest;
59 </script>
60 </head>
61 <body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
62 <div><a id="start" href="a">a</a></div>
64 <iframe width="80" height="80" scrolling="auto" src="data:text/html,
65 <body>
66 <img width=120 height=200 src='resources/green.png'>
67 </body>
68 "></iframe><br>
70 <iframe scrolling="auto" src="data:text/html,
71 <body>
72 <img width=120 height=200 src='resources/green.png'>
73 </body>
74 "></iframe><br>
76 <a id="end" href="a">e</a>
77 <div id="console"></div>
78 This is to test that an iframe with no focusable content still scrolls
79 </body>
80 </html>