blob: 03ba835a35c118ce98262b1fa33ad56e92051c4e [file] [log] [blame]
<html>
<!--
This test ensures the cross iframe traversal correctness of Spatial Navigation
algorithm: focusable elements in an flattened <iframe> should be accessible.
* Pre-conditions:
1) DRT support for Spatial Navigation enable/disable.
2) DRT support for Frame flattening 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 = [
["Down", "1"],
["Down", "2"],
["Down", "end"],
["Up", "2"],
["Up", "1"],
["Up", "start"],
["DONE", "DONE"]
];
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.setSpatialNavigationEnabled(true);
testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
testRunner.waitUntilDone();
}
function runTest()
{
if (window.internals)
internals.settings.setFrameFlatteningEnabled(true);
// 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">a</a></div>
<iframe width="80" height="80" scrolling="auto" src="data:text/html,
<body>
<a id='1' href='a'>b</a>
<div style='margin-top:120px'>
<a id='2' href='a'>d</a>
</div>
</body>
"></iframe><br>
<div><a id="end" href="a">e</a></div>
<div id="console"></div>
</body>
</html>