1 description("This tests scripting baseVal while animation is running");
2 embedSVGTestCase("resources/change-baseVal-while-animating-fill-freeze.svg");
4 // Setup animation test
6 shouldBeCloseEnough("rect.width.animVal.value", "10");
7 shouldBe("rect.width.baseVal.value", "10");
11 shouldBeCloseEnough("rect.width.animVal.value", "30");
12 shouldBe("rect.width.baseVal.value", "10");
14 rect
.width
.baseVal
.value
= 100;
18 shouldBeCloseEnough("rect.width.animVal.value", "30");
19 shouldBe("rect.width.baseVal.value", "100");
23 shouldBeCloseEnough("rect.width.animVal.value", "50");
24 shouldBe("rect.width.baseVal.value", "100");
28 shouldBe("rect.width.animVal.value", "50");
29 shouldBe("rect.width.baseVal.value", "100");
32 function executeTest() {
33 rect
= rootSVGElement
.ownerDocument
.getElementsByTagName("rect")[0];
35 // All animations in the test file use the same duration, so it's not needed to list all sample points individually for an5/an6/an7/an8.
36 const expectedValues
= [
37 // [animationId, time, sampleCallback]
38 ["an1", 0.0, sample1
],
39 ["an1", 2.0, sample2
],
40 ["an1", 2.001, sample3
],
41 ["an1", 3.999, sample4
],
42 ["an1", 4.001, sample5
],
43 ["an1", 60.0, sample5
]
46 runAnimationTest(expectedValues
);
49 window
.animationStartsImmediately
= true;
50 var successfullyParsed
= true;