blob: e5960c980f9478c930fe730b83dda0f76eec18db [file] [log] [blame]
This test ensures the correctness of the "Fully aligned" precedence
logic implemented by Spatial Navigation algorithm in an vertical direction:
targets whose middle falls between the top and bottom of the current focused
element are preferably to move focus to, even if it is not the shortest distance.
* Pre-conditions:
1) DRT support for SNav enable/disable.
* Navigation steps:
1) Loads this page, focus goes to "start" automatically.
2) Focus moves preferably to elements right up or above the
current focused element, even when there are some other closer
but not vertically aligned elements in the same direction.
<script src="../js/resources/js-test-pre.js"></script>
<script src="resources/spatial-navigation-utils.js"></script>
<script type="application/javascript">
var resultMap = [
["Down", "4"],
["Down", "6"],
["Down", "8"],
["Down", "end"],
["Up", "7"],
["Up", "2"],
["DONE", "DONE"]
if (window.testRunner) {
testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
function runTest()
// starting the test itself: get to a known place.
initTest(resultMap, testCompleted);
function testCompleted()
if (window.testRunner)
window.onload = runTest;
<script src="js/resources/js-test-post.js"></script>
<body id="some-content" xmlns="">
<div style="margin-left: 40px; text-align: left;">
<div style="margin-left: 40px;">
<a id="start" href="a">test<br></a>
<a id="2" href="a">test</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a id="3" href="a">test</a><br>
<div style="margin-left: 40px;">
<a id="4" href="a">test<br></a>
<div style="margin-left: 80px;">
<a id="5" href="a">test<br></a>
<div style="margin-left: 40px;">
<a id="6" href="a">test<br></a>
<a id="7" href="a">test<br></a>
<div style="margin-left: 40px;">
<a id="8" href="a">test<br></a>
<a id="end" href="a">test<br></a>
<div id="console"></div>