zimmermann@webkit.org | 6510363 | 2012-03-13 08:27:14 +0000 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 | <html> |
| 3 | <head> |
mark.lam@apple.com | 1ca737d | 2013-09-08 05:29:22 +0000 | [diff] [blame] | 4 | <script src="../../resources/js-test-pre.js"></script> |
zimmermann@webkit.org | 6510363 | 2012-03-13 08:27:14 +0000 | [diff] [blame] | 5 | <script src="../dynamic-updates/resources/SVGTestCase.js"></script> |
| 6 | <script src="resources/SVGAnimationTestCase.js"></script> |
| 7 | </head> |
| 8 | <body onload="runSMILTest()"> |
| 9 | <h1>SVG 1.1 dynamic animation tests</h1> |
| 10 | <p id="description"></p> |
| 11 | <div id="console"></div> |
ap@apple.com | 92352d0 | 2017-05-24 22:53:00 +0000 | [diff] [blame] | 12 | <script> |
| 13 | description("This tests scripting baseVal while animation is running"); |
| 14 | embedSVGTestCase("resources/change-baseVal-while-animating-fill-remove.svg"); |
| 15 | |
| 16 | // Setup animation test |
| 17 | function sample1() { |
| 18 | shouldBeCloseEnough("rect.width.animVal.value", "10"); |
| 19 | shouldBe("rect.width.baseVal.value", "10"); |
| 20 | } |
| 21 | |
| 22 | function sample2() { |
| 23 | shouldBeCloseEnough("rect.width.animVal.value", "30"); |
| 24 | shouldBe("rect.width.baseVal.value", "10"); |
| 25 | |
| 26 | rect.setAttribute("width", "100"); |
| 27 | } |
| 28 | |
| 29 | function sample3() { |
| 30 | shouldBeCloseEnough("rect.width.animVal.value", "30"); |
| 31 | shouldBe("rect.width.baseVal.value", "100"); |
| 32 | } |
| 33 | |
| 34 | function sample4() { |
| 35 | shouldBeCloseEnough("rect.width.animVal.value", "50"); |
| 36 | shouldBe("rect.width.baseVal.value", "100"); |
| 37 | } |
| 38 | |
| 39 | function sample5() { |
| 40 | shouldBe("rect.width.animVal.value", "100"); |
| 41 | shouldBe("rect.width.baseVal.value", "100"); |
| 42 | } |
| 43 | |
| 44 | function executeTest() { |
| 45 | rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0]; |
| 46 | |
| 47 | // 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. |
| 48 | const expectedValues = [ |
| 49 | // [animationId, time, sampleCallback] |
| 50 | ["an1", 0.0, sample1], |
| 51 | ["an1", 2.0, sample2], |
| 52 | ["an1", 2.001, sample3], |
| 53 | ["an1", 3.999, sample4], |
| 54 | ["an1", 4.001, sample5], |
| 55 | ["an1", 60.0, sample5] |
| 56 | ]; |
| 57 | |
| 58 | runAnimationTest(expectedValues); |
| 59 | } |
| 60 | |
| 61 | window.animationStartsImmediately = true; |
| 62 | var successfullyParsed = true; |
| 63 | </script> |
zimmermann@webkit.org | 6510363 | 2012-03-13 08:27:14 +0000 | [diff] [blame] | 64 | </body> |
| 65 | </html> |