Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / spatial-navigation / snav-simple-content-overflow.html
blob7d179b433f5699b2dd275b98fd526950a3efaa9b
1 <html>
2 <!--
3 This test ensures that overflowed content can be focused by Spatial Navigation.
5 * Pre-conditions:
6 1) DRT support for SNav enable/disable.
8 * Navigation steps:
9 1) Loads this page, focus goes to "start" automatically.
10 3) Try to traverse the links on page down.
11 and then back up.
13 * Expected results: After 'start' gets the focus, tapping down arrow should scroll its
14 enclosing scrollable container (<div>) down, and *not* move focus to the link whose id is '2'.
15 -->
16 <head>
17 <style type="text/css">
18 div.scroll {
19 height: 200px;
20 width: 300px;
21 overflow: auto;
22 border: 1px solid #666;
23 background-color: #ccc;
24 padding: 8px;
26 </style>
28 <script src="../../resources/js-test.js"></script>
29 <script src="resources/spatial-navigation-utils.js"></script>
30 <script type="application/javascript">
32 var resultMap = [
33 ["Down", "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;
60 </script>
61 </head>
63 <body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
64 <div class="scroll">
65 <p>It has a visible <a id="start" href="a">link_1</a>.</p>
66 <br><br><br><br><br><br><br><br><br>
67 <p>... and an overflowed link like <a id="1" href="a">this</a>.</p>
68 </div>
69 <br><br><br><br><br><br><br>
70 <p>This link should NOT get <a id="start" href="a">focused</a>.</p>
71 <div id="console"></div>
72 </body>
73 </html>