summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/manual-tests/svg-crash-hovering-use.svg
blob: 029b23b55d0739cd36bdd0aebed2a3270c140984 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="svg" viewBox="0 0 100 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
    <rect id="rect" width="60" height="10"/>
</defs>

<text x="30" y="30" transform="scale(0.2 0.2)">Hover over the rectangle - it should not crash</text>
<use id="use" x="20" y="10" xlink:href="#rect" />

<script>
<![CDATA[
    var svg = document.getElementById("svg");
    var use = document.getElementById("use");

    function addUseElement() {
        svg.appendChild(use, true);
        setTimeout(removeUseElement, 50);
    }

    function removeUseElement() {
        use.parentElement.removeChild(use);
        setTimeout(addUseElement, 50);
    }

    document.addEventListener("DOMNodeInserted", function() {}, true);
    removeUseElement();
]]>
</script>
</svg>