[iOS] The completion handler in -handleKeyWebEvent:withCompletionHandler: is sometime...
[WebKit-https.git] / LayoutTests / svg / animations / animate-insert-no-begin.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test-pre.js"></script>
5 <script src="../dynamic-updates/resources/SVGTestCase.js"></script>
6 <script src="resources/SVGAnimationTestCase.js"></script>
7 </head>
8 <body onload="runSMILTest()">
9 <h1>SVG 1.1 dynamic animation tests</h1>
10 <p id="description"></p>
11 <div id="console"></div>
12 <script>
13 description("Test behavior of dynamically inserting animate without begin attribute");
14 createSVGTestCase();
15
16 // Setup test document
17 var rect = createSVGElement("rect");
18 rect.setAttribute("id", "rect");
19 rect.setAttribute("x", "0");
20 rect.setAttribute("y", "45");
21 rect.setAttribute("width", "100");
22 rect.setAttribute("height", "100");
23 rect.setAttribute("fill", "green");
24
25 var animate = createSVGElement("animate");
26 animate.setAttribute("id", "animation");
27 animate.setAttribute("attributeName", "x");
28 animate.setAttribute("from", "0");
29 animate.setAttribute("to", "90");
30 animate.setAttribute("dur", "3s");
31 animate.setAttribute("fill", "freeze");
32 rect.appendChild(animate);
33 rootSVGElement.appendChild(rect);
34
35 // Setup animation test
36 function sample1() {
37     shouldBeCloseEnough("rect.x.animVal.value", "0");
38     shouldBe("rect.x.baseVal.value", "0");
39 }
40
41 function sample2() {
42     shouldBeCloseEnough("rect.x.animVal.value", "90");
43     shouldBe("rect.x.baseVal.value", "0");
44 }
45
46 function executeTest() {
47     const expectedValues = [
48         // [animationId, time, sampleCallback]
49         ["animation", 0.0, sample1],
50         ["animation", 3.0, sample2]
51     ];
52
53     runAnimationTest(expectedValues);
54 }
55
56 window.animationStartsImmediately = true;
57 var successfullyParsed = true;
58 </script>
59 </body>
60 </html>