timothy_horton@apple.com | 8555865 | 2012-09-04 18:31:31 +0000 | [diff] [blame] | 1 | <html> |
mark.lam@apple.com | 1ca737d | 2013-09-08 05:29:22 +0000 | [diff] [blame] | 2 | <script src="../../resources/js-test-pre.js"></script> |
timothy_horton@apple.com | 8555865 | 2012-09-04 18:31:31 +0000 | [diff] [blame] | 3 | <script src="resources/SVGAnimationTestCase.js"></script> |
| 4 | <script> |
| 5 | function load() { |
| 6 | if (window.testRunner) { |
| 7 | testRunner.dumpAsText(); |
| 8 | testRunner.waitUntilDone(); |
| 9 | } |
| 10 | |
| 11 | svg = document.getElementById("svg"); |
| 12 | rect = document.getElementById("rect"); |
| 13 | |
| 14 | setTimeout(function () { |
| 15 | svg.setCurrentTime(1); |
| 16 | |
| 17 | document.body.removeChild(svg); |
| 18 | document.body.appendChild(svg); |
| 19 | |
| 20 | setTimeout(function () { |
| 21 | shouldBeCloseEnough("rect.x.animVal.value", "30", 1); |
| 22 | |
| 23 | svg.setCurrentTime(2); |
| 24 | |
| 25 | shouldBeCloseEnough("rect.x.animVal.value", "60", 1); |
| 26 | |
| 27 | if (window.testRunner) |
| 28 | testRunner.notifyDone(); |
| 29 | }, 0); |
| 30 | }, 0); |
| 31 | }; |
| 32 | </script> |
| 33 | <body onload="load()"> |
| 34 | <h1>Reinserting SVG animation into document should continue the animation</h1> |
| 35 | <p id="description"></p> |
| 36 | <div id="console"></div> |
| 37 | <svg id="svg" xmlns="http://www.w3.org/2000/svg"> |
| 38 | <rect id="rect" x="0" y="0" width="20" height="20"> |
| 39 | <animate attributeName="x" begin="0" from="0" to="90" dur="3s" fill="freeze" /> |
| 40 | </rect> |
| 41 | </svg> |
| 42 | </body> |
| 43 | </html> |