summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-date.html
blob: 6cc3d0994c43ccd34352d9fce1ed20973bd13cb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<head>
<script src="../js/resources/js-test-pre.js"></script>
<script src="resources/spatial-navigation-utils.js"></script>
<script>
window.jsTestIsAsync = true;

if (window.testRunner) {
    testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
    window.internals.settings.setSpatialNavigationEnabled(true);
}
</script>
<script src="../js/resources/js-test-post.js"></script>
</head>
<body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
<p id="description"></p>
<table style="text-align: left; width: 100%; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="1">
<tbody>
<tr>
<td style="vertical-align: top; text-align: center;"><a id="left" href="a">Left</a></td>
<td style="vertical-align: top; text-align: center;"><input id="start" type="date" value="text"></td>
<td style="vertical-align: top; text-align: center;"><a id="right" href="a">Right</a></td>
</tr>
</tbody>
</table>
<div id="console"></div>
<script type="application/javascript">
description('This test ensures the correctness of Spatial Navigation (SNav) algorithm over date input element (having shadow DOM).<br>\
             * Navigation steps:<br>\
             1) Loads this page, focus goes to "start" automatically.<br>\
             2) Focus moves away from input box, left and right to neighbor nodes and back.<br>');

var resultMap = [
    ["Left", "left"],
    ["Right", "start"], // month
    ["Right", "start"], // day
    ["Right", "start"], // year
    ["Right", "right"],
    ["Left", "start"],
    ["DONE", "DONE"]
];

function runTest()
{
    // starting the test itself: get to a known place.
    document.getElementById("start").focus();

    initTest(resultMap, finishJSTest);
}

window.onload = runTest;
</script>
</body>
</html>