blob: 89d064bf399b14174a8c8b49eefbed7ef660e288 [file] [log] [blame]
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. -->
<style type="text/css">
.offscreen {
position: absolute;
left: -1000em;
<script src="../../resources/js-test.js"></script>
<script src="resources/spatial-navigation-utils.js"></script>
<script type="application/javascript">
var resultMap = [
["Left", "1"],
["DONE", "DONE"]
if (window.testRunner) {
testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
testRunner.overridePreference("WebKitSpatialNavigationEnabled", 1);
function runTest()
// starting the test itself: get to a known place.
initTest(resultMap, testCompleted);
function testCompleted()
if (window.testRunner)
window.onload = runTest;
<body id="some-content" xmlns="">
<div style="margin-left:120px">
<a id="off" class="offscreen" href="a">offscreen content</a>
<a id="start" href="a">Right link</a>
<a id="1" href="a">Down link</a><br>
<div id="console"></div>