summaryrefslogtreecommitdiffstats
path: root/dom/html/test/forms/test_input_datetime_readonly.html
blob: aa7b40753b2faa6d9cea211b8767502c2414f6e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!doctype html>
<title>Test for bug 1461509</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<input id="i" type="date" value="1995-11-20" readonly required>
<script>
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(function() {
  let input = document.getElementById("i");
  let value = input.value;

  isnot(value, "", "should have a value");

  input.focus();
  synthesizeKey("KEY_Backspace");
  is(input.value, value, "Value shouldn't change");
  SimpleTest.finish();
});
</script>