blob: 23da5cfce16279ea6643a068ccd64e20bb5bb485 [file] [log] [blame]
<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() {
// Hold a reference to rect.x.baseVal on the root instance.
xBaseVal = document.getElementById("rect").x.baseVal;
for (var i = 0; i < 100; i++)
g.appendChild(createAnimatedRectInstance());
}
]]>
</script>
</svg>