summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-clearbutton-visibility-after-restore.html
blob: 3bae7d05f0da321f383e13995a6bf2c2b4817daf (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
<!DOCTYPE html>
<html>
<body>
<input id="emptyOnFirstVisit">
<form action="data:text/html,&lt;script>history.back()&lt;/script>" id=form1>
    <input type="datetime-local" id=input1>
    <input type="datetime-local" id=input2>
    <input type="datetime-local" id=input3 value="2001-01-01T01:01:01.001">
</form>

<script>
// Restoring the form should update the clear button visibility.
testRunner.waitUntilDone();
function runTest()
{
    var state = document.getElementById('emptyOnFirstVisit');
    if (!state.value) {
        // First visit.
        setTimeout(function() {
            state.value = 'visited';
            document.getElementById('input2').value = "2002-02-02T02:02";
            document.getElementById('input3').value = "2003-03-03T03:03:03.003";
            document.getElementById('form1').submit();
        }, 0);
    } else {
        testRunner.notifyDone();
    }
}

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