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=
"../../resources/js-test.js"></script>
31 <script src=
"resources/spatial-navigation-utils.js"></script>
32 <script type=
"application/javascript">
39 if (window.testRunner) {
40 testRunner.dumpAsText();
41 testRunner.overridePreference(
"WebKitTabToLinksPreferenceKey",
1);
42 window.internals.settings.setSpatialNavigationEnabled(true);
43 testRunner.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.testRunner)
59 testRunner.notifyDone();
62 window.onload = runTest;
66 <body id=
"some-content" xmlns=
"http://www.w3.org/1999/xhtml">
67 <p>That is is a normal
<a id=
"start" href=
"a">link
</a>.
</p>
68 <div class=
"scroll" id=
"div">
69 <p>This is a scrollable Div created with the CSS property overflow.
</p>
70 <br><br><br><br><br><br><br><br>
71 <p> ... and here we have a clipped overflow
<a id=
"1" href=
"a">link
</a>.
</p>
73 <p>And this is another normal
<a id=
"2" href=
"a">link_2
</a>.
</p>
74 <div id=
"console"></div>