blob: 6500d7c7860ae96f1a47f05432892654b9f132eb [file] [log] [blame]
commit-queue@webkit.orgffa063e2011-04-27 01:28:10 +00001<?xml version="1.0" encoding="utf-8" standalone="no"?>
2<svg xmlns='http://www.w3.org/2000/svg'>
3<circle cx='0' cy='50' r='20' fill='orange' id='testCircle'>
4 <animate attributeName='cx' attributeType='XML' begin='indefinite' end='indefinite' dur='10s' repeatCount='indefinite' from="10" to="200" id='dTripper' fill="freeze"/>
5</circle>
6<text y="130" x="20">This test verifies the animation behaviour of beginElement in SVG. See <a href="https://bugs.webkit.org/show_bug.cgi?id=26019">bug 26019</a></text>
7<text y="150" x="20" id="console"/>
8<script><![CDATA[
9 var animatedElement;
10 animatedElement = document.getElementById("dTripper");
11 animatedElement.setAttribute("to", 420);
12 animatedElement.beginElement();
13 setTimeout(beginElement, 0);
14
15 function beginElement()
16 {
17 animatedElement.setAttribute("to", 420);
18 animatedElement.beginElement();
19 setTimeout(dumpResult, 0);
20 }
21
22 function dumpResult()
23 {
24 var console = document.getElementById("console");
25 var cx = document.getElementById("testCircle").getAttribute("cx");
26 if (cx === 0)
27 console.appendChild(document.createTextNode("Failed (cx was not animated)"));
28 else
29 console.appendChild(document.createTextNode("Passed"));
fmalita@chromium.org4988a3e2012-08-01 23:05:16 +000030 if (window.testRunner)
31 testRunner.notifyDone();
commit-queue@webkit.orgffa063e2011-04-27 01:28:10 +000032 }
33
fmalita@chromium.org4988a3e2012-08-01 23:05:16 +000034 if (window.testRunner) {
35 testRunner.dumpAsText();
36 testRunner.waitUntilDone();
commit-queue@webkit.orgffa063e2011-04-27 01:28:10 +000037 }
38]]></script>
39</svg>