blob: d4416626fca4a7dfc2d34a346de428b3f1cd6eb2 [file] [log] [blame]
<html>
<!--
This test ensures the cross iframe traversal correctness of Spatial Navigation
algorithm: focusable elements in an <iframe> should be accessible even when
the current focused element is in another <iframe> in the same page.
* Pre-conditions:
1) DRT support for SNav enable/disable.
* Navigation steps:
1) Loads this page, focus goes to "start" automatically.
2) Focus moves along the elements in the two iframes in the
Web page, eventually going to outer an southward link, but
going back to the iframe on the top later on.
-->
<head>
<script src="../../resources/js-test-pre.js"></script>
<script src="resources/spatial-navigation-utils.js"></script>
<script type="application/javascript">
var resultMap = [
["Right", "1"],
["Right", "2"],
["Right", "3"],
["Left", "2"],
["Left", "1"],
["Left", "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>
<table style="text-align: top;" border="0" cellpadding="3px" cellspacing="3px">
<tr>
<td valign="top" width="10%">
<a id="start" href="http://google.com">Link</a><br>
</td>
<td valign="top">
<iframe width="50%" height="100px" frameborder="1" src="data:text/html,
<body>
<a id='1' href='http://a'>b</a>
<a id='2' href='http://a'>c</a>
<a id='3' href='http://a'>d</a>
</body>
"></iframe><br>
</td>
</tr>
</table>
<div id="console"></div>
</body>
</html>