1 description("Test behavior of dynamically inserting animate with begin attribute");
5 var rect
= createSVGElement("rect");
6 rect
.setAttribute("id", "rect");
7 rect
.setAttribute("x", "0");
8 rect
.setAttribute("y", "45");
9 rect
.setAttribute("width", "10");
10 rect
.setAttribute("height", "10");
11 rect
.setAttribute("fill", "green");
13 var animate
= createSVGElement("animate");
14 animate
.setAttribute("id", "animation");
15 animate
.setAttribute("attributeName", "x");
16 animate
.setAttribute("begin", "0");
17 animate
.setAttribute("from", "0");
18 animate
.setAttribute("to", "90");
19 animate
.setAttribute("dur", "3s");
20 animate
.setAttribute("fill", "freeze");
21 rect
.appendChild(animate
);
22 rootSVGElement
.appendChild(rect
);
24 // Setup animation test
26 shouldBeCloseEnough("rect.x.animVal.value", "0");
27 shouldBe("rect.x.baseVal.value", "0");
31 shouldBeCloseEnough("rect.x.animVal.value", "90");
32 shouldBe("rect.x.baseVal.value", "0");
35 function executeTest() {
36 const expectedValues
= [
37 // [animationId, time, sampleCallback]
38 ["animation", 0.0, sample1
],
39 ["animation", 3.0, sample2
],
42 runAnimationTest(expectedValues
);
45 window
.animationStartsImmediately
= true;
46 var successfullyParsed
= true;