4 https://bugzilla.mozilla.org/show_bug.cgi?id=1352799
7 <title>Test for Bug
1352799</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <script src=
"/tests/SimpleTest/EventUtils.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1352799">Mozilla Bug
1352799</a>
16 <div id=
"input-container" style=
"display: none;">
17 <input id=
"input" maxlength=
"1">
21 <script type=
"application/javascript">
23 /** Test for Bug
1352799 **/
24 SimpleTest.waitForExplicitFinish();
25 SimpleTest.waitForFocus(() =
> {
26 var input = document.getElementById(
"input");
28 var inputcontainer = document.getElementById(
"input-container");
29 input.setAttribute(
"maxlength",
2);
30 inputcontainer.style.display =
"block";
36 is(input.value,
"12",
"value should be 12 with maxlength = 2");
39 inputcontainer.style.display =
"none";
41 window.setTimeout(() =
> {
42 input.setAttribute(
"maxlength",
4);
43 inputcontainer.style.display =
"block";
49 is(input.value,
"4567",
"value should be 4567 with maxlength = 4");
51 inputcontainer.style.display =
"none";
53 window.setTimeout(() =
> {
54 input.setAttribute(
"maxlength",
2);
55 inputcontainer.style.display =
"block";
61 todo_is(input.value,
"45",
"value should be 45 with maxlength = 2");
64 inputcontainer.style.display =
"none";
66 window.setTimeout(() =
> {
67 input.removeAttribute(
"maxlength");
68 inputcontainer.style.display =
"block";
72 sendString(
"12345678");
74 is(input.value,
"12345678",
"value should be 12345678 without maxlength");