3 This test ensures the content overflow traversal correctness of spatial navigation:
4 if an element if clipped overflow in a scrollable container (e.g. <div>),
5 scroll-in-direction should happen in the container box, not on the outer view.
8 1) DRT support for spatial navigation enable/disable.
11 1) Loads this page, focus goes to "start" automatically.
12 2) Try to move focus down to the visible focusable element in
15 * Expected results: There should have to a scroll action in the container
16 (div) as an attempt to make the clipped overflow node visible and accessible
17 via spatial navigation. -->
19 <style type="text/css">
24 border: 1px solid #666;
25 background-color: #ccc;
30 <script src="../js/resources/js-test-pre.js"></script>
31 <script src="resources/spatial-navigation-utils.js"></script>
32 <script type="application/javascript">
39 if (window.layoutTestController) {
40 layoutTestController.dumpAsText();
41 layoutTestController.setSpatialNavigationEnabled(true);
42 layoutTestController.overridePreference("WebKitTabToLinksPreferenceKey", 1);
43 layoutTestController.waitUntilDone();
48 // starting the test itself: get to a known place.
49 document.getElementById("start").focus();
51 initTest(resultMap, testCompleted);
54 function testCompleted()
56 shouldBeTrue(String(document.getElementById("div").scrollTop != 0));
58 if (window.layoutTestController)
59 layoutTestController.notifyDone();
62 window.onload = runTest;
65 <script src="js/resources/js-test-post.js"></script>
67 <body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
68 <p>That is is a normal <a id="start" href="a">link</a>.</p>
69 <div class="scroll" id="div">
70 <p>This is a scrollable Div created with the CSS property overflow.</p>
71 <br><br><br><br><br><br><br><br>
72 <p> ... and here we have a clipped overflow <a id="1" href="a">link</a>.</p>
74 <p>And this is another normal <a id="2" href="a">link_2</a>.</p>
75 <div id="console"></div>