chromium/third_party/blink/web_tests/svg/animations/smil-leak-dynamically-added-element-instances.svg

<svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="load()">
<defs>
    <rect id="rect" width="100" height="100" />
</defs>
<g id="g"/>
<script xlink:href="../../resources/js-test.js"></script>
<script id="script">
<![CDATA[
// This test relies on --enable-leak-detection to catch leaks

var g = document.getElementById("g");

function createAnimatedRectInstance() {
    var use = document.createElementNS("http://www.w3.org/2000/svg", "use");
    use.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#rect");
    
    var anim = document.createElementNS("http://www.w3.org/2000/svg", "animate");
    anim.setAttribute("attributeType", "XML");
    anim.setAttribute("attributeName", "x");
    anim.setAttribute("from", "100");
    anim.setAttribute("to", "0");
    anim.setAttribute("begin", "0s");
    anim.setAttribute("dur", "10.0s");
    anim.setAttribute("repeatCount", 1);

    use.appendChild(anim);

    return use;
}

function load() {
    for (var i = 0; i < 50; i++)
        g.appendChild(createAnimatedRectInstance());

    for (var i = 0; i < 50; i++)
        g.appendChild(createAnimatedRectInstance());
}
]]>
</script>
</svg>