<!DOCTYPE html>
<html>
<head>
<script>
if (window.testRunner)
    testRunner.dumpAsText();
</script>
</head>
<body>
<p>This tests that we don't cause an assertion failure when implicitly removing a &lt;text&gt; (by removing its parent), with the same id as another element, that is referenced by a later &lt;tref&gt;.</p>
<svg version="1.1">
    <defs>
        <text id="A">FAIL</text>
        <text id="A">FAIL</text>
    </defs>
    <text x="0" y="20">
        <tref xlink:href="#A"></tref>
    </text>
</svg>
<script>
var svg = document.querySelector("svg");
document.body.removeChild(svg);
</script>
<p>PASS</p>
</body>
</html>
