blob: 531341f0b64a4828f6e87b9e22efc9e6531d8bc8 [file] [log] [blame]
This test ensures the correctness of a basic aspect of spatial navigation traversal
routines: focusable elements in scrollable containers (e.g. <div>) should be
accessible, including offscreen content.
* Pre-conditions:
1) DRT support for spatial navivation enable/disable.
* Navigation steps:
1) Loads this page, focus goes to "start" automatically.
2) Move focus down to the visible focusable element in
scrollable div.
3) Traverse the page through other focusable elements down the page.
and then back up.
* Expected results: All focusable element in scrollable content, including
offscreen ones, should be accessible via spatial navigation. -->
<style type="text/css">
div.scroll {
height: 200px;
width: 300px;
overflow: auto;
border: 1px solid #666;
background-color: #ccc;
padding: 8px;
<script src="../js/resources/js-test-pre.js"></script>
<script src="resources/spatial-navigation-utils.js"></script>
<script type="application/javascript">
var resultMap = [
["Down", "1"],
["Down", "1"],
["Down", "2"],
["Down", "2"],
["Down", "3"],
["Up", "2"],
["Up", "2"],
["Up", "1"],
["Up", "1"],
["Up", "start"],
["DONE", "DONE"]
if (window.testRunner) {
testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
function runTest()
// starting the test itself: get to a known place.
initTest(resultMap, testCompleted);
function testCompleted()
if (window.testRunner)
window.onload = runTest;
<script src="js/resources/js-test-post.js"></script>
<body id="some-content" xmlns="">
<a id="start" href="a"><img src="resources/green.png" width=30px height=30px></a>
<div class="scroll">
<a id="1" href="a"><img src="resources/green.png" width=30px height=30px></a>
<img src="resources/green.png" width=200px height=200px>
<a id="2" href="a"><img src="resources/green.png" width=30px height=30px></a>.
<a id="3" href="a"><img src="resources/green.png" width=30px height=30px></a>
<div id="console"></div>
<div>This test tests that a div with css overflow:auto will scroll to reveal its focusable elements</div>