1 description("Tests end conditions are respected properly near the limits of float numeric precision");
5 var rect
= createSVGElement("rect");
6 rect
.setAttribute("id", "rect");
7 rect
.setAttribute("x", "100");
8 rect
.setAttribute("width", "100");
9 rect
.setAttribute("height", "100");
10 rect
.setAttribute("fill", "green");
12 var animate
= createSVGElement("animate");
13 animate
.setAttribute("id", "animation");
14 animate
.setAttribute("attributeName", "x");
15 animate
.setAttribute("values", "0;300");
16 animate
.setAttribute("begin", "0.333333333333333s");
17 animate
.setAttribute("dur", "0.4256483205159505s");
18 animate
.setAttribute("fill", "freeze");
19 rect
.appendChild(animate
);
20 rootSVGElement
.appendChild(rect
);
22 // Setup animation test
24 shouldBeCloseEnough("rect.x.animVal.value", "100");
25 shouldBe("rect.x.baseVal.value", "100");
29 shouldBeCloseEnough("rect.x.animVal.value", "300");
30 shouldBe("rect.x.baseVal.value", "100");
33 function executeTest() {
34 const expectedValues
= [
35 // [animationId, time, sampleCallback]
36 ["animation", 0.0, sample1
],
37 ["animation", 1.0, sample2
]
40 runAnimationTest(expectedValues
);
43 var successfullyParsed
= true;