OLD | NEW |
1 description("This tests scripting a CSS property while animation is running"); | 1 description("This tests scripting a CSS property while animation is running"); |
2 embedSVGTestCase("resources/change-css-property-while-animating-fill-remove.svg"
); | 2 embedSVGTestCase("resources/change-css-property-while-animating-fill-remove.svg"
); |
3 | 3 |
4 // Setup animation test | 4 // Setup animation test |
5 function sample1() { | 5 function sample1() { |
6 shouldBeCloseEnough("getComputedStyle(rect).getPropertyCSSValue('opacity').g
etFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); | 6 shouldBeCloseEnough("parseFloat(getComputedStyle(rect).opacity)", "0"); |
7 } | 7 } |
8 | 8 |
9 function sample2() { | 9 function sample2() { |
10 shouldBeCloseEnough("getComputedStyle(rect).getPropertyCSSValue('opacity').g
etFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0.25"); | 10 shouldBeCloseEnough("parseFloat(getComputedStyle(rect).opacity)", "0.25"); |
11 rect.setAttribute("opacity", "1"); | 11 rect.setAttribute("opacity", "1"); |
12 } | 12 } |
13 | 13 |
14 function sample3() { | 14 function sample3() { |
15 shouldBeCloseEnough("getComputedStyle(rect).getPropertyCSSValue('opacity').g
etFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0.25"); | 15 shouldBeCloseEnough("parseFloat(getComputedStyle(rect).opacity)", "0.25"); |
16 } | 16 } |
17 | 17 |
18 function sample4() { | 18 function sample4() { |
19 shouldBeCloseEnough("getComputedStyle(rect).getPropertyCSSValue('opacity').g
etFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0.5"); | 19 shouldBeCloseEnough("parseFloat(getComputedStyle(rect).opacity)", "0.5"); |
20 } | 20 } |
21 | 21 |
22 function sample5() { | 22 function sample5() { |
23 shouldBeCloseEnough("getComputedStyle(rect).getPropertyCSSValue('opacity').g
etFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "1"); | 23 shouldBeCloseEnough("parseFloat(getComputedStyle(rect).opacity)", "1"); |
24 } | 24 } |
25 | 25 |
26 function executeTest() { | 26 function executeTest() { |
27 rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0]; | 27 rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0]; |
28 | 28 |
29 const expectedValues = [ | 29 const expectedValues = [ |
30 // [animationId, time, sampleCallback] | 30 // [animationId, time, sampleCallback] |
31 ["an1", 0.0, sample1], | 31 ["an1", 0.0, sample1], |
32 ["an1", 2.0, sample2], | 32 ["an1", 2.0, sample2], |
33 ["an1", 2.001, sample3], | 33 ["an1", 2.001, sample3], |
34 ["an1", 3.999, sample4], | 34 ["an1", 3.999, sample4], |
35 ["an1", 4.001, sample5], | 35 ["an1", 4.001, sample5], |
36 ["an1", 60.0, sample5] | 36 ["an1", 60.0, sample5] |
37 ]; | 37 ]; |
38 | 38 |
39 runAnimationTest(expectedValues); | 39 runAnimationTest(expectedValues); |
40 } | 40 } |
41 | 41 |
42 window.animationStartsImmediately = true; | 42 window.animationStartsImmediately = true; |
43 var successfullyParsed = true; | 43 var successfullyParsed = true; |
OLD | NEW |