Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / spatial-navigation / snav-clipped-overflowed-content.html
blob3aa8ee80dd6e7fd5e137ae41656973989606e945
1 <html>
2 <!--
3 This test ensures the correctness of a basic aspect of spatial navigation traversal
4 routines: focusable elements in scrollable containers (e.g. <div>) should be
5 accessible, including offscreen content.
7 * Pre-conditions:
8 1) DRT support for spatial navivation 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 spatial navigation. -->
19 <head>
20 <style type="text/css">
21 div.scroll {
22 height: 200px;
23 width: 300px;
24 overflow: auto;
25 border: 1px solid #666;
26 background-color: #ccc;
27 padding: 8px;
29 </style>
31 <script src="../../resources/js-test.js"></script>
32 <script src="resources/spatial-navigation-utils.js"></script>
33 <script type="application/javascript">
35 var resultMap = [
36 ["Down", "1"],
37 ["Down", "1"],
38 ["Down", "2"],
39 ["Down", "2"],
40 ["Down", "3"],
41 ["Up", "2"],
42 ["Up", "2"],
43 ["Up", "1"],
44 ["Up", "1"],
45 ["Up", "start"],
46 ["DONE", "DONE"]
49 if (window.testRunner) {
50 testRunner.dumpAsText();
51 testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
52 window.internals.settings.setSpatialNavigationEnabled(true);
53 testRunner.waitUntilDone();
56 function runTest()
58 // starting the test itself: get to a known place.
59 document.getElementById("start").focus();
61 initTest(resultMap, testCompleted);
64 function testCompleted()
66 if (window.testRunner)
67 testRunner.notifyDone();
70 window.onload = runTest;
72 </script>
73 </head>
75 <body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
76 <a id="start" href="a"><img src="resources/green.png" width=30px height=30px></a>
77 <div class="scroll">
78 <a id="1" href="a"><img src="resources/green.png" width=30px height=35px></a>
79 <div></div>
80 <img src="resources/green.png" width=200px height=200px>
81 <div></div>
82 <a id="2" href="a"><img src="resources/green.png" width=30px height=30px></a>.
83 </div>
84 <a id="3" href="a"><img src="resources/green.png" width=30px height=30px></a>
85 <div id="console"></div>
86 <div>This test tests that a div with css overflow:auto will scroll to reveal its focusable elements</div>
87 </body>
88 </html>