Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: LayoutTests/svg/custom/image-with-attr-change-after-delete-crash.html

Issue 1158433004: Remove Attr child nodes (making Attr a Node, not a ContainerNode) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698