1 description("This tests scripting a CSS property while animation is running");
2 embedSVGTestCase("resources/change-css-property-while-animating-fill-remove.svg");
4 // Setup animation test
6 shouldBeCloseEnough("parseFloat(getComputedStyle(rect).opacity)", "0");
10 shouldBeCloseEnough("parseFloat(getComputedStyle(rect).opacity)", "0.25");
11 rect
.setAttribute("opacity", "1");
15 shouldBeCloseEnough("parseFloat(getComputedStyle(rect).opacity)", "0.25");
19 shouldBeCloseEnough("parseFloat(getComputedStyle(rect).opacity)", "0.5");
23 shouldBeCloseEnough("parseFloat(getComputedStyle(rect).opacity)", "1");
26 function executeTest() {
27 rect
= rootSVGElement
.ownerDocument
.getElementsByTagName("rect")[0];
29 const expectedValues
= [
30 // [animationId, time, sampleCallback]
31 ["an1", 0.0, sample1
],
32 ["an1", 2.0, sample2
],
33 ["an1", 2.001, sample3
],
34 ["an1", 3.999, sample4
],
35 ["an1", 4.001, sample5
],
36 ["an1", 60.0, sample5
]
39 runAnimationTest(expectedValues
);
42 window
.animationStartsImmediately
= true;
43 var successfullyParsed
= true;