Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / spatial-navigation / snav-container-white-space.html
blobe1d4bd783db60762aaec805c99b78ca93141c04f
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>
21 :focus {outline: 1px solid black;}
22 </style>
23 <script src="../../resources/js-test.js"></script>
24 <script src="resources/spatial-navigation-utils.js"></script>
25 <script type="application/javascript">
27 var resultMap = [
28 ["Down", "1"],
29 ["Down", "2"],
30 ["Down", "3"],
31 ["Down", "4"],
32 ["Down", "5"],
33 ["Up", "4"],
34 ["Up", "3"],
35 ["Up", "2"],
36 ["Up", "1"],
37 ["Up", "start"],
38 ["DONE", "DONE"]
41 if (window.testRunner) {
42 testRunner.dumpAsText();
43 testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
44 window.internals.settings.setSpatialNavigationEnabled(true);
45 testRunner.waitUntilDone();
48 function runTest()
50 // starting the test itself: get to a known place.
51 document.getElementById("start").focus();
53 initTest(resultMap, testCompleted);
56 function testCompleted()
58 if (window.testRunner)
59 testRunner.notifyDone();
62 window.onload = runTest;
64 </script>
65 </head>
66 <body>
67 <a href="#" id="start">This is an element</a><br>
69 <div>
70 <a href="#" id="1">
71 <img src="resources/green.png" height="42" width="76" border="0"/>
72 </a>
73 </div>
75 <div>
76 <a href="#" id="2">This is an element</a><br>
77 </div>
79 <a href="#" id="3">This is an element</a><br>
81 <a href="#" id="4">
82 <img src="resources/green.png" height="42" width="76" alt="llinker1" border="0"/>
83 </a><br>
85 <a href="#" id="5">This is an element</a><br>
86 <div id="console"></div>
87 <div>This test tests that a anchor element with in image in it and a space after the image, can still give the correct size in ContainerNode::getRect().</div>
88 </body>
89 </html>