OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <body> | 2 <body> |
3 <script src="../../resources/js-test.js"></script> | 3 <script src="../../resources/js-test.js"></script> |
4 <script> | 4 <script> |
5 jsTestIsAsync = true; | 5 jsTestIsAsync = true; |
6 var form1; | 6 var form1; |
7 var submit1; | 7 var submit1; |
8 | 8 |
9 function start() { | 9 function start() { |
10 form1 = document.createElement('form'); | 10 form1 = document.createElement('form'); |
11 submit1 = document.createElement('input'); | 11 submit1 = document.createElement('input'); |
12 submit2 = document.createElement('input'); | 12 submit2 = document.createElement('input'); |
13 submit1.type = 'submit'; | 13 submit1.type = 'submit'; |
14 submit2.type = 'image'; | 14 submit2.type = 'image'; |
15 form1.addEventListener('submit', handleSubmit, false); | 15 form1.addEventListener('submit', handleSubmit, false); |
16 form1.action = 'javascript:removeImage()'; | 16 form1.action = 'javascript:removeImage()'; |
17 form1.appendChild(submit1); | 17 form1.appendChild(submit1); |
18 form1.appendChild(submit2); | 18 form1.appendChild(submit2); |
| 19 document.body.appendChild(form1); |
19 submit1.click(); | 20 submit1.click(); |
20 testPassed('if not crashed.'); | 21 testPassed('if not crashed.'); |
21 finishJSTest(); | 22 finishJSTest(); |
22 } | 23 } |
23 | 24 |
24 function handleSubmit() { | 25 function handleSubmit() { |
25 form1.removeChild(submit1); | 26 form1.removeChild(submit1); |
26 } | 27 } |
27 | 28 |
28 function removeImage() { | 29 function removeImage() { |
29 form1.removeChild(submit2); | 30 form1.removeChild(submit2); |
30 submit2 = null; | 31 submit2 = null; |
31 gc(); | 32 gc(); |
32 } | 33 } |
33 | 34 |
34 window.onload = start; | 35 window.onload = start; |
35 </script> | 36 </script> |
36 </body> | 37 </body> |
OLD | NEW |