SVG element may reference arbitrary DOM element before running its insertion logic
[WebKit-https.git] / LayoutTests / svg / custom / reparent-feimage-element.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <head>
5 <script>
6 if (window.testRunner)
7     testRunner.dumpAsText();
8 </script>
9 <style>
10 svg {
11     height: 0;
12     width: 0;
13 }
14 </style>
15 </head>
16 <p>This tests that we don't cause an assertion failure when re-parenting a &lt;feimage&gt; after temporarily removing its referenced element.</p>
17 <svg>
18     <circle id="a"></circle>
19     <feimage xlink:href="#a" id="b"></feimage>
20 </svg>
21 <svg id="c"></svg>
22 <div id="a"></div>
23 <script>
24 var a = document.getElementById("a"); // <circle>
25 var b = document.getElementById("b"); // <feimage>
26 a.parentNode.removeChild(a);
27 b.appendChild(a);
28 b.parentNode.removeChild(b);
29 document.getElementById("c").appendChild(b);
30 </script>
31 <p>PASS</p>
32 </body>
33 </html>