Bug 1772588 [wpt PR 34302] - [wpt] Add test for block-in-inline offsetParent., a...
[gecko.git] / editor / libeditor / tests / test_bug1352799.html
bloba3f53fc43b2c9e2ee3568bf125fd1c949c6a36f0
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=1352799
5 -->
6 <head>
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"/>
11 </head>
12 <body>
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1352799">Mozilla Bug 1352799</a>
14 <p id="display"></p>
15 <div id="content">
16 <div id="input-container" style="display: none;">
17 <input id="input" maxlength="1">
18 </div>
19 </div>
20 <pre id="test">
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";
32 input.focus();
34 sendString("123");
36 is(input.value, "12", "value should be 12 with maxlength = 2");
38 input.value = "";
39 inputcontainer.style.display = "none";
41 window.setTimeout(() => {
42 input.setAttribute("maxlength", 4);
43 inputcontainer.style.display = "block";
45 input.focus();
47 sendString("45678");
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";
57 input.focus();
59 sendString("12");
61 todo_is(input.value, "45", "value should be 45 with maxlength = 2");
63 input.value = "";
64 inputcontainer.style.display = "none";
66 window.setTimeout(() => {
67 input.removeAttribute("maxlength");
68 inputcontainer.style.display = "block";
70 input.focus();
72 sendString("12345678");
74 is(input.value, "12345678", "value should be 12345678 without maxlength");
76 SimpleTest.finish();
77 }, 0);
78 }, 0);
79 }, 0);
80 });
81 </script>
82 </pre>
83 </body>
84 </html>