blob: d7163e7b5b637b0c80c8df25482090c853c9d15e [file] [edit]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test.js"></script>
<script src="resources/SVGTestCase.js"></script>
<script src="resources/SVGAnimationTestCase.js"></script>
</head>
<body onload="runSMILTest()">
<h1>SVG 1.1 dynamic animation tests</h1>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests scripting a CSS property while animation is running");
embedSVGTestCase("resources/change-css-property-while-animating-fill-remove.svg");
// Setup animation test
function sample1() {
shouldBeCloseEnough("parseFloat(getComputedStyle(rect).opacity)", "0");
}
function sample2() {
shouldBeCloseEnough("parseFloat(getComputedStyle(rect).opacity)", "0.25");
rect.setAttribute("opacity", "1");
}
function sample3() {
shouldBeCloseEnough("parseFloat(getComputedStyle(rect).opacity)", "0.25");
}
function sample4() {
shouldBeCloseEnough("parseFloat(getComputedStyle(rect).opacity)", "0.5");
}
function sample5() {
shouldBeCloseEnough("parseFloat(getComputedStyle(rect).opacity)", "1");
}
function executeTest() {
rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0];
const expectedValues = [
// [animationId, time, sampleCallback]
["an1", 0.0, sample1],
["an1", 2.0, sample2],
["an1", 2.001, sample3],
["an1", 3.999, sample4],
["an1", 4.001, sample5],
["an1", 60.0, sample5]
];
runAnimationTest(expectedValues);
}
window.animationStartsImmediately = true;
var successfullyParsed = true;
</script>
</body>
</html>