|
Line 0
LayoutTests/fast/spatial-navigation/snav-inline-with-blocks.html_sec1
|
|
|
1 |
<html> |
| 2 |
<!-- |
| 3 |
This test ensures the inline element whose children are block elememts can be focused using Spatial Navigation |
| 4 |
|
| 5 |
* Pre-conditions: |
| 6 |
1) TestRunner support for SNav enable/disable. |
| 7 |
|
| 8 |
* Navigation steps: |
| 9 |
1) Loads this page, focus goes to "start" automatically. |
| 10 |
2) Try to traverse the links on page in down direction and then back in up direction. |
| 11 |
--> |
| 12 |
<head> |
| 13 |
<script src="../../resources/js-test-pre.js"></script> |
| 14 |
<script src="resources/spatial-navigation-utils.js"></script> |
| 15 |
<script type="application/javascript"> |
| 16 |
|
| 17 |
var resultMap = [ |
| 18 |
["Down", "1"], |
| 19 |
["Down", "2"], |
| 20 |
["Down", "3"], |
| 21 |
["Down", "4"], |
| 22 |
["Down", "end"], |
| 23 |
["Up", "4"], |
| 24 |
["Up", "3"], |
| 25 |
["Up", "2"], |
| 26 |
["Up", "1"], |
| 27 |
["Up", "start"], |
| 28 |
["DONE", "DONE"] |
| 29 |
]; |
| 30 |
|
| 31 |
if (window.testRunner) { |
| 32 |
testRunner.dumpAsText(); |
| 33 |
testRunner.setSpatialNavigationEnabled(true); |
| 34 |
testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1); |
| 35 |
testRunner.waitUntilDone(); |
| 36 |
} |
| 37 |
|
| 38 |
function runTest() |
| 39 |
{ |
| 40 |
document.getElementById("start").focus(); |
| 41 |
initTest(resultMap, testCompleted); |
| 42 |
} |
| 43 |
|
| 44 |
function testCompleted() |
| 45 |
{ |
| 46 |
if (window.testRunner) |
| 47 |
testRunner.notifyDone(); |
| 48 |
} |
| 49 |
|
| 50 |
window.onload = runTest; |
| 51 |
|
| 52 |
</script> |
| 53 |
<script src="../resources/js-test-post.js"></script> |
| 54 |
</head> |
| 55 |
<body id="some-content" xmlns="http://www.w3.org/1999/xhtml"> |
| 56 |
<table style="text-align: left; margin-left: auto; margin-right: auto;" cellpadding="2" cellspacing="1"> |
| 57 |
<tbody> |
| 58 |
<tr> |
| 59 |
<td style="vertical-align: top; text-align: center;"></td> |
| 60 |
<td style="vertical-align: top; text-align: center;"><a id="start" href="a"><div>Start</div></a></td> |
| 61 |
<td style="vertical-align: top; text-align: center; width: 7px;"></td> |
| 62 |
</tr> |
| 63 |
<tr> |
| 64 |
<td style="text-align: center;"></td> |
| 65 |
<td style="text-align: center;"> |
| 66 |
<a id = "1" href="#"><div> Link 1 </div></a> |
| 67 |
<a id = "2" href="#"><div> Link 2 </div></a> |
| 68 |
<a id = "3" href="#"><div> Link 3 </div></a> |
| 69 |
<a id = "4" href="#"><div> Link 4 </div></a> |
| 70 |
</td> |
| 71 |
<td style="text-align: center; width: 7px;"></td> |
| 72 |
</tr> |
| 73 |
<tr> |
| 74 |
<td style="vertical-align: top; text-align: center;"></td> |
| 75 |
<td style="vertical-align: top; text-align: center;"><a id="end" href="a"><div>End</div></a></td> |
| 76 |
<td style="vertical-align: top; text-align: center; width: 7px;"></td> |
| 77 |
</tr> |
| 78 |
</tbody> |
| 79 |
</table> |
| 80 |
<div id="console"></div> |
| 81 |
</body> |
| 82 |
</html> |
| 83 |
|