Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / spatial-navigation / snav-offscreen-content.html
blob4189c9869fdefa5ed501daed8fc9742d748d35f1
1 <html>
2 <!--
3 This test ensures the content overflow traversal correctness of Spatial Navigation
4 algorithm: focusable elements in an scrollable containers (e.g. <div>) should be
5 accessible, including offscreen content.
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) Move focus down to the visible focusable element in
13 scrollable div.
14 3) Traverse the page through other focusable elements down the page.
15 and then back up.
17 * Expected results: All focusable element in scrollable content, including
18 offscreen ones, should be accessible via SNav. -->
19 <head>
20 <style type="text/css">
21 .offscreen {
22 position: absolute;
23 left: -1000em;
25 </style>
27 <script src="../../resources/js-test.js"></script>
28 <script src="resources/spatial-navigation-utils.js"></script>
29 <script type="application/javascript">
31 var resultMap = [
32 ["Left", "1"],
33 ["DONE", "DONE"]
36 if (window.testRunner) {
37 testRunner.dumpAsText();
38 testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
39 window.internals.settings.setSpatialNavigationEnabled(true);
40 testRunner.waitUntilDone();
43 function runTest()
45 // starting the test itself: get to a known place.
46 document.getElementById("start").focus();
48 initTest(resultMap, testCompleted);
51 function testCompleted()
53 if (window.testRunner)
54 testRunner.notifyDone();
57 window.onload = runTest;
59 </script>
60 </head>
63 <body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
65 <div style="margin-left:120px">
66 <a id="off" class="offscreen" href="a">offscreen content</a>
67 <a id="start" href="a">Right link</a>
68 </div><br>
69 <a id="1" href="a">Down link</a><br>
70 <div id="console"></div>
71 </body>
72 </html>