Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / spatial-navigation / snav-container-only-white-space.html
blob67a7c0a6637a311b89d524fe2df102102daeb484
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", "2"],
29 ["Up", "start"],
30 ["DONE", "DONE"]
33 if (window.testRunner) {
34 testRunner.dumpAsText();
35 testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
36 window.internals.settings.setSpatialNavigationEnabled(true);
37 testRunner.waitUntilDone();
40 function runTest()
42 // starting the test itself: get to a known place.
43 document.getElementById("start").focus();
45 initTest(resultMap, testCompleted);
48 function testCompleted()
50 if (window.testRunner)
51 testRunner.notifyDone();
54 window.onload = runTest;
56 </script>
57 </head>
58 <body>
59 <a href="#" id="start">This is an element</a><br>
61 <div>
62 <a href="#" id="1">
63 </a>
64 </div>
66 <div>
67 <a href="#" id="2">This is an element</a><br>
68 </div>
69 <div id="console"></div>
70 <div>This test tests that a anchor element with only white spaces gives the correct size in ContainerNode::getRect().</div>
71 </body>
72 </html>