Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / removed-image-as-property.html
blob0062ce37fbe8261428eb21af3ef7b0812a282f67
1 <body onload="test()">
2 <p>Test that an image isn't accessible via form.property syntax after being removed from document.</p>
3 <div>Testing...</div>
4 <form className="a">
5 <img src="" id="i">
6 </form>
7 <script>
8 if (window.testRunner) {
9 testRunner.dumpAsText();
10 testRunner.waitUntilDone();
13 function gc()
15 if (window.GCController)
16 return GCController.collect();
18 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
19 var s = new String("abc");
23 function test()
25 var f = document.getElementsByTagName("form")[0];
26 f.removeChild(document.getElementsByTagName("img")[0]);
27 f.foobar;
28 setTimeout(function() {
29 gc();
30 try {
31 f.i.nodeName;
32 document.getElementsByTagName("div")[0].innerHTML = "FAIL";
33 } catch (ex) {
34 document.getElementsByTagName("div")[0].innerHTML = "PASS";
36 if (window.testRunner)
37 testRunner.notifyDone();
38 }, 0);
40 </script>