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 <body id="body"> | 3 <body id="body"> |
4 <svg id="svgRoot" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://w ww.w3.org/2000/svg"> | 4 <svg id="svgRoot" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://w ww.w3.org/2000/svg"> |
5 <image height="410" id="svgImage" width="503" x="0" y="0" xlink:href="reso urces/green-checker.png"/> | 5 <image height="410" id="svgImage" width="503" x="0" y="0" xlink:href="reso urces/green-checker.png"/> |
6 <script> | 6 <script> |
7 if (window.testRunner) { | 7 if (window.testRunner) { |
8 testRunner.dumpAsText(); | 8 testRunner.dumpAsText(); |
9 testRunner.waitUntilDone(); | 9 testRunner.waitUntilDone(); |
10 } | 10 } |
11 | 11 |
12 function forceGC() { | 12 function forceGC() { |
13 if (window.GCController) | 13 if (window.GCController) |
14 GCController.collect(); | 14 GCController.collect(); |
15 else | 15 else |
16 gc(); | 16 gc(); |
17 } | 17 } |
18 | 18 |
19 svgImage = document.getElementById("svgImage"); | 19 svgImage = document.getElementById("svgImage"); |
20 docElement = document.getElementById("svgRoot"); | 20 docElement = document.getElementById("svgRoot"); |
21 newTextNode = document.createTextNode(" Test Passes"); | 21 newTextNode = document.createTextNode(" Test Passes"); |
22 setTimeout("crash()", 0); | 22 setTimeout("crash()", 0); |
23 | 23 |
24 function crash() { | 24 function crash() { |
25 svgImage.attributes[5].replaceChild(newTextNode, svgImage.attributes[5 ].childNodes[0]); | 25 svgImage.href.baseVal = "no-image"; |
davve
2015/05/28 14:32:14
Nit: may want to change href through .value to get
philipj_slow
2015/05/28 15:28:36
Done.
| |
26 svgImage.parentNode.removeChild(svgImage); | 26 svgImage.parentNode.removeChild(svgImage); |
27 delete svgImage; | 27 delete svgImage; |
28 forceGC(); | 28 forceGC(); |
29 docElement.appendChild(newTextNode); | 29 docElement.appendChild(newTextNode); |
30 if (window.testRunner) { | 30 if (window.testRunner) { |
31 document.getElementById("body").innerHTML = "Test Passes when there is no crash"; | 31 document.getElementById("body").innerHTML = "Test Passes when there is no crash"; |
32 testRunner.notifyDone(); | 32 testRunner.notifyDone(); |
33 } | 33 } |
34 } | 34 } |
35 </script> | 35 </script> |
36 </svg> | 36 </svg> |
37 </body> | 37 </body> |
38 </html> | 38 </html> |
OLD | NEW |