blob: 21bdfcadba9c1aca87363f287bdbd605138e1bc3 [file] [log] [blame]
<html>
<!--
This test ensures the correctness of a basic aspect of spatial navigation traversal
routines: scrollable block html elements without any focusable content should be ignored.
* Pre-conditions:
1) DRT support for spatial navigation enable/disable.
* Navigation steps:
1) Loads this page, focus goes to "start" automatically.
2) Focus moves from "start" to "end" bypassing the two div's
in between them, once both have no focusable elements inside.
-->
<head>
<style type="text/css">
div.scroll {
height: 200px;
width: 300px;
overflow: auto;
border: 1px solid #666;
background-color: #ccc;
padding: 8px;
}
</style>
<script src="../../resources/js-test-pre.js"></script>
<script src="resources/spatial-navigation-utils.js"></script>
<script type="application/javascript">
var resultMap = [
["Down", "start"],
["Down", "start"],
["Down", "start"],
["Down", "start"],
["Down", "start"],
["Down", "start"],
["Down", "end"],
["Up" , "end"],
["Up" , "end"],
["Up" , "end"],
["Up" , "end"],
["Up" , "end"],
["Up" , "end"],
["Up" , "start"],
["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><a id="start" href="a"><img src="resources/green.png" width=30 height=30></a></div>
<div class="scroll">
<img src="resources/green.png" width=240 height=300>
</div>
<div class="scroll">
<img src="resources/green.png" width=240 height=300>
</div>
<div><a id="end" href="a"><img src="resources/green.png" width=30 height=30></a></div>
<div id="console"></div>
This test is to test that a scrollable div can scroll and reveal its content even if it does not have any focusable content.
</body>
</html>