58 lines
1.7 KiB
HTML
58 lines
1.7 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
|
<html>
|
|
<head>
|
|
<script src="../../resources/js-test-pre.js"></script>
|
|
<script src="../dynamic-updates/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("test to determine whether auto-rotate animateMotion path animations pre-muliply or post-multiply animation transform matrix");
|
|
createSVGTestCase();
|
|
|
|
rootSVGElement.setAttribute("width", 800)
|
|
|
|
var text = createSVGElement("text")
|
|
text.setAttribute("transform", "translate(300, 30)")
|
|
text.textContent = "This is some text."
|
|
text.setAttribute("onclick", "executeTest()")
|
|
|
|
var animateMotion = createSVGElement("animateMotion")
|
|
animateMotion.setAttribute("id", "animation")
|
|
animateMotion.setAttribute("dur", "40s")
|
|
animateMotion.setAttribute("repeatCount", "1")
|
|
animateMotion.setAttribute("rotate", "auto")
|
|
animateMotion.setAttribute("path", "M 100,250 C 100,50 400,50 400,250")
|
|
animateMotion.setAttribute("begin", "click")
|
|
text.appendChild(animateMotion)
|
|
rootSVGElement.appendChild(text)
|
|
|
|
function startSample() {
|
|
shouldBeCloseEnough("rootSVGElement.getBBox().x", "117", 1);
|
|
shouldBeCloseEnough("rootSVGElement.getBBox().y", "-162", 1);
|
|
}
|
|
|
|
function endSample() {
|
|
shouldBeCloseEnough("rootSVGElement.getBBox().x", "367", 1);
|
|
shouldBeCloseEnough("rootSVGElement.getBBox().y", "550", 1);
|
|
}
|
|
|
|
function executeTest() {
|
|
const expectedValues = [
|
|
["animation", 0.001, startSample],
|
|
["animation", 39.999, endSample]
|
|
];
|
|
|
|
runAnimationTest(expectedValues);
|
|
}
|
|
|
|
window.clickX = 310;
|
|
window.clickY = 30;
|
|
var successfullyParsed = true;
|
|
</script>
|
|
</body>
|
|
</html>
|