1 <svg id=
"svg" xmlns=
"http://www.w3.org/2000/svg" xmlns:
xlink=
"http://www.w3.org/1999/xlink" onload=
"load()">
3 <rect id=
"rect" width=
"100" height=
"100" />
6 <text x=
"50" y=
"50" id=
"log"/>
7 <script xlink:
href=
"../../resources/js-test.js"></script>
11 var g = document.getElementById(
"g");
13 function log(message) {
14 var logDiv = document.getElementById('log');
15 logDiv.appendChild(document.createTextNode(message));
18 function createAnimatedRectInstance() {
19 var use = document.createElementNS(
"http://www.w3.org/2000/svg",
"use");
20 use.setAttributeNS(
"http://www.w3.org/1999/xlink",
"href",
"#rect");
22 var anim = document.createElementNS(
"http://www.w3.org/2000/svg",
"animate");
23 anim.setAttribute(
"attributeType",
"XML");
24 anim.setAttribute(
"attributeName",
"x");
25 anim.setAttribute(
"from",
"100");
26 anim.setAttribute(
"to",
"0");
27 anim.setAttribute(
"begin",
"0s");
28 anim.setAttribute(
"dur",
"10.0s");
29 anim.setAttribute(
"repeatCount",
1);
31 use.appendChild(anim);
38 var originalLiveElements = internals.numberOfLiveNodes();
40 while (g.hasChildNodes())
41 g.removeChild(g.lastChild);
44 // FIXME: Why
400 and not
200?
45 var liveDelta = originalLiveElements - internals.numberOfLiveNodes() -
400;
49 log(
"FAIL: " + liveDelta +
" extra live node(s)");
51 testRunner.notifyDone();
56 function addMoreInstances() {
57 for (var i =
0; i <
50; i++)
58 g.appendChild(createAnimatedRectInstance());
60 setTimeout(cleanup,
0);
63 function startTest() {
64 for (var i =
0; i <
50; i++)
65 g.appendChild(createAnimatedRectInstance());
67 setTimeout(addMoreInstances,
100);
71 if (window.testRunner && window.GCController && window.internals) {
72 testRunner.dumpAsText();
73 testRunner.waitUntilDone();
75 log(
"This test only works when run with the testRunner, GCController, and internals available.");
79 setTimeout(startTest,
0);