blob: 241ca6f389ae2a47ab21e8c816a49c2c1cb13fae [file] [log] [blame]
<html>
<!--
This test ensures the content overflow traversal correctness of Spatial Navigation
algorithm: focusable elements in an scrollable containers (e.g. <div>) should be
accessible, including offscreen content.
* Pre-conditions:
1) DRT support for SNav 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 SNav. -->
<head>
<style type="text/css">
.offscreen {
position: absolute;
left: -1000em;
}
</style>
<script src="../../resources/js-test-pre.js"></script>
<script src="resources/spatial-navigation-utils.js"></script>
<script type="application/javascript">
var resultMap = [
["Left", "1"],
["DONE", "DONE"]
];
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.setSpatialNavigationEnabled(true);
testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
testRunner.waitUntilDone();
}
function runTest()
{
// starting the test itself: get to a known place.
document.getElementById("start").focus();
initTest(resultMap, testCompleted);
}
function testCompleted()
{
if (window.testRunner)
testRunner.notifyDone();
}
window.onload = runTest;
</script>
<script src="../resources/js-test-post.js"></script>
</head>
<body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
<div style="margin-left:120px">
<a id="off" class="offscreen" href="a">offscreen content</a>
<a id="start" href="a">Right link</a>
</div><br>
<a id="1" href="a">Down link</a><br>
<div id="console"></div>
</body>
</html>