| <html> |
| <!-- |
| This test ensures the basic iframe traversal correctness of Spatial Navigation |
| algorithm: focusable elements in a <iframe> should be accessible. |
| |
| * 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 = [ |
| ["Down", "1"], |
| ["Down", "2"], |
| ["Down", "3"], |
| ["Down", "7"], |
| ["Down", "6"], |
| ["Down", "end"], |
| ["Up", "4"], |
| ["Right", "5"], |
| ["Right", "6"], |
| ["Up", "3"], |
| ["Right", "7"], |
| ["Up", "3"], |
| ["Up", "2"], |
| ["Up", "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><a id="start" href="a">a</a></div> |
| |
| <iframe src="data:text/html, |
| <body> |
| <a id='1' href='a'>b</a><br> |
| <a id='2' href='a'>c</a><br> |
| <a id='3' href='a'>d</a><br> |
| <div style='margin-left:80px'> |
| <a id='7' href='a'>e</a> |
| </div> |
| </body> |
| "></iframe><br> |
| |
| <iframe src="data:text/html, |
| <body> |
| <a id='4' href='a'>g</a> |
| <a id='5' href='a'>h</a> |
| <a id='6' href='a'>i</a> |
| </body> |
| "></iframe><br> |
| |
| <a id="end" href="a">a</a> |
| <div id="console"></div> |
| </body> |
| </html> |