Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE HTML>
<html>
<!--
-->
<head>
<title>Test construction of hidden date input type</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"/>
</head>
<body>
<p id="display"></p>
<div id="content">
<input id="date" type="date" hidden value="1947-02-28">
</div>
<pre id="test">
<script type="application/javascript">
let el = document.getElementById("date");
ok(el.hidden, "element is hidden");
is(el.value, "1947-02-28", ".value is set correctly");
let fieldElements = Array.from(SpecialPowers.wrap(el).openOrClosedShadowRoot.querySelectorAll(".datetime-edit-field"));
is(fieldElements[0].textContent, "02", "month is set");
is(fieldElements[1].textContent, "28", "day is set");
is(fieldElements[2].textContent, "1947", "year is set");
</script>
</pre>
</body>
</html>