Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / spatial-navigation / snav-div-scrollable-but-without-focusable-content.html
blobf33b686065f98b1ed77dc21fa5e168da7b1ffe75
1 <html>
2 <!--
3 This test ensures the correctness of a basic aspect of spatial navigation traversal
4 routines: scrollable block html elements without any focusable content should be ignored.
6 * Pre-conditions:
7 1) DRT support for spatial navigation 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 div's
12 in between them, once both have no focusable elements inside.
13 -->
14 <head>
15 <style type="text/css">
16 div.scroll {
17 height: 200px;
18 width: 300px;
19 overflow: auto;
20 border: 1px solid #666;
21 background-color: #ccc;
22 padding: 8px;
24 </style>
26 <script src="../../resources/js-test.js"></script>
27 <script src="resources/spatial-navigation-utils.js"></script>
28 <script type="application/javascript">
30 var resultMap = [
31 ["Down", "start"],
32 ["Down", "start"],
33 ["Down", "start"],
34 ["Down", "start"],
35 ["Down", "start"],
36 ["Down", "start"],
37 ["Down", "end"],
38 ["Up" , "end"],
39 ["Up" , "end"],
40 ["Up" , "end"],
41 ["Up" , "end"],
42 ["Up" , "end"],
43 ["Up" , "end"],
44 ["Up" , "start"],
45 ["DONE", "DONE"]
48 if (window.testRunner) {
49 testRunner.dumpAsText();
50 testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
51 window.internals.settings.setSpatialNavigationEnabled(true);
52 testRunner.waitUntilDone();
55 function runTest()
57 // starting the test itself: get to a known place.
58 document.getElementById("start").focus();
60 initTest(resultMap, testCompleted);
63 function testCompleted()
65 if (window.testRunner)
66 testRunner.notifyDone();
69 window.onload = runTest;
70 </script>
71 </head>
72 <body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
73 <div><a id="start" href="a"><img src="resources/green.png" width=30 height=30></a></div>
74 <div class="scroll">
75 <img src="resources/green.png" width=240 height=300>
76 </div>
78 <div class="scroll">
79 <img src="resources/green.png" width=240 height=300>
80 </div>
81 <div><a id="end" href="a"><img src="resources/green.png" width=30 height=30></a></div>
82 <div id="console"></div>
83 This test is to test that a scrollable div can scroll and reveal its content even if it does not have any focusable content.
84 </body>
85 </html>