| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <link rel="stylesheet" href="resources/js-test-style.css"> |
| <script src="resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <p id="description"></p> |
| <div id="console"></div> |
| <div> |
| <select id="myselect"> |
| <option>A</option> |
| <option>B</option> |
| <option>C</option> |
| </select> |
| </div> |
| <script> |
| description("This test checks that removing a <select> object from the DOM, then garbage collecting, then removing an option from select.options doesn't crash."); |
| |
| var select = document.getElementById("myselect"); |
| var options = select.options; |
| select.parentNode.removeChild(select); |
| select = null; |
| |
| // create lots of objects to force a garbage collection |
| var i = 0; |
| var s; |
| while (i < 5000) { |
| i = i+1.11; |
| s = s + " "; |
| } |
| |
| options.remove(0); |
| testPassed("No crash"); |
| successfullyParsed = true; |
| </script> |
| <script src="resources/js-test-post.js"></script> |
| </body> |
| </html> |