Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / animations / use-while-animating-crash.html
blob7c5e5d85e7e18c16407751adf612cc26453ee416
1 <!DOCTYPE html>
2 <!-- Test for WK84657 - Test passes if the SVG animation does not crash and "PASS" is printed. -->
3 <html>
4 <head>
5 <script>
6 function crash() {
7 var useRectElement = document.getElementById('useRect');
8 useRectElement.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#rect");
10 function startTest() {
11 if (window.testRunner) {
12 testRunner.waitUntilDone();
13 testRunner.dumpAsText();
15 var svgElement = document.getElementById('svg');
16 window.setTimeout(function() {
17 crash();
18 window.setTimeout(function() {
19 svgElement.setCurrentTime(100);
20 document.write("PASS");
21 if (window.testRunner)
22 testRunner.notifyDone();
23 }, 20); // This needs to be at least 20 to ensure an animation cycle runs.
24 }, 1);
26 </script>
27 </head>
28 <body onload="startTest()">
29 <svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
30 <defs>
31 <rect id="rect" x="100px" y="100px" width="100px" height="100px" fill="green">
32 <animate attributeName="x" from="100" to="0" begin="0s" dur="5s" repeatCount="1"/>
33 </rect>
34 </defs>
35 <use x="100px" y="100px" xlink:href="#rect"/>
36 <use id="useRect" x="100px" y="200px"/>
37 </svg>
38 </body>
39 </html>