Bug 767636 - Expose plugin fallback type to extensions. r=josh
[gecko.git] / layout / forms / test / test_bug446663.html
blobf27b6830c602bfb69f1c1ef2694c5ddb2932f221
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=446663
5 -->
6 <head>
7 <title>Test for Bug 446663</title>
8 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <script type="text/javascript" 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=446663">Mozilla Bug 446663</a>
14 <p id="display">
15 <style>#bug446663_a:focus{overflow:hidden}</style>
16 <input id="bug446663_a"><input id="bug446663_b"></p>
17 <div id="content" style="display: none">
19 </div>
20 <pre id="test">
21 <script class="testbody" type="text/javascript">
23 /** Test for Bug 446663 **/
25 function test_edit_cmds(id) {
26 netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
28 var elm = document.getElementById(id);
29 elm.focus();
30 elm.select();
31 elm.controllers.getControllerForCommand('cmd_cut')
32 .doCommand('cmd_cut');
33 is(elm.value, '', id + " cut");
35 elm.controllers.getControllerForCommand('cmd_undo')
36 .doCommand('cmd_undo');
37 is(elm.value, '123', id + " undo");
40 var inputHappened = false;
41 function inputListener() {
42 inputHappened = true;
43 $(id).removeEventListener("input", inputListener, false);
46 var id = 'bug446663_a'
47 var elm = document.getElementById(id);
48 elm.focus();
49 var x = document.body.offsetHeight;
50 $(id).addEventListener("input", inputListener, false);
51 sendChar('1');
52 is(inputHappened, true, "How come no input?");
53 sendChar('3');
54 sendKey('LEFT')
55 sendChar('2');
56 elm.blur();
57 x = document.body.offsetHeight;
58 is(elm.value, '123', id + " edit");
59 test_edit_cmds(id)
61 id = 'bug446663_b'
62 elm = document.getElementById(id);
63 elm.focus();
64 sendChar('1');
65 elm.style.display = 'none'
66 var x = document.body.offsetHeight;
67 elm.style.display = 'inline'
68 x = document.body.offsetHeight;
69 sendChar('3');
70 sendKey('LEFT')
71 sendChar('2');
72 elm.blur();
73 x = document.body.offsetHeight;
74 is(elm.value, '123', id + " edit");
75 test_edit_cmds(id)
77 </script>
78 </pre>
79 </body>
80 </html>