1 <svg id=
"svg" xmlns=
"http://www.w3.org/2000/svg" xmlns:
xlink=
"http://www.w3.org/1999/xlink" onload=
"load()">
3 <text x=
"50" y=
"50" id=
"log"/>
4 <script xlink:
href=
"../../resources/js-test.js"></script>
8 var g = document.getElementById(
"g");
10 function log(message) {
11 var logDiv = document.getElementById('log');
12 logDiv.appendChild(document.createTextNode(message));
15 function createAnimatedRect() {
16 var rect = document.createElementNS(
"http://www.w3.org/2000/svg",
"rect");
17 rect.setAttribute(
"width",
10);
18 rect.setAttribute(
"height",
10);
20 var anim = document.createElementNS(
"http://www.w3.org/2000/svg",
"animate");
21 anim.setAttribute(
"attributeType",
"XML");
22 anim.setAttribute(
"attributeName",
"x");
23 anim.setAttribute(
"from",
"100");
24 anim.setAttribute(
"to",
"0");
25 anim.setAttribute(
"begin",
"0s");
26 anim.setAttribute(
"dur",
"10.0s");
27 anim.setAttribute(
"repeatCount",
1);
29 rect.appendChild(anim);
35 // Collect garbage before recording starting live node count, in case there are live elements from previous tests.
37 var originalLiveElements = internals.numberOfLiveNodes();
39 while (g.hasChildNodes())
40 g.removeChild(g.lastChild);
42 var liveDelta = originalLiveElements - internals.numberOfLiveNodes() -
200;
46 log(
"FAIL: " + liveDelta +
" extra live node(s)");
47 testRunner.notifyDone();
52 function startTest() {
53 for (var i =
0; i <
100; i++)
54 g.appendChild(createAnimatedRect());
56 setTimeout(cleanup,
0);
60 if (window.testRunner && window.GCController && window.internals) {
61 testRunner.dumpAsText();
62 testRunner.waitUntilDone();
64 log(
"This test only works when run with the testRunner, GCController, and internals available.");
68 setTimeout(startTest,
0);