OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html xmlns="http://www.w3.org/1999/xhtml"> | 2 <html xmlns="http://www.w3.org/1999/xhtml"> |
3 Test passes if it does not crash. | 3 Test passes if it does not crash. |
4 <object id="object" type="image/svg+xml" /> | 4 <object id="object" type="image/svg+xml" /> |
5 <script src="../../js/resources/js-test-pre.js"></script> | 5 <script src="../../js/resources/js-test-pre.js"></script> |
6 <script> | 6 <script> |
7 window.jsTestIsAsync = true; | 7 window.jsTestIsAsync = true; |
8 var count = 0; | 8 var count = 0; |
9 function setText() { | 9 function setText() { |
10 count++; | 10 count++; |
11 if (count > 100) { | 11 if (count > 100) { |
12 document.removeEventListener("beforeload", setText, true); | 12 document.removeEventListener("beforeload", setText, true); |
13 finishJSTest(); | 13 finishJSTest(); |
14 } | 14 } |
15 gc(); // Because we are recursively entering into setText, can't gc() after
this command. | 15 gc(); // Because we are recursively entering into setText, can't gc() after
this command. |
16 document.getElementById("object").textContent = "A"; | 16 document.getElementById("object").textContent = "A"; |
17 } | 17 } |
18 document.execCommand("SelectAll"); | 18 document.execCommand("SelectAll"); |
19 document.getElementById("object").textContent = "A"; | 19 document.getElementById("object").textContent = "A"; |
20 document.addEventListener("beforeload", setText, true); | 20 document.addEventListener("beforeload", setText, true); |
21 event = document.createEvent("Event"); | 21 event = document.createEvent("Event"); |
22 event.initEvent("beforeload", false); | 22 event.initEvent("beforeload", false); |
23 document.documentElement.dispatchEvent(event); | 23 document.documentElement.dispatchEvent(event); |
24 </script> | 24 </script> |
25 <script src="../../js/resources/js-test-post.js"></script> | 25 <script src="../../js/resources/js-test-post.js"></script> |
26 </html> | 26 </html> |
27 | 27 |
OLD | NEW |