blob: 15d58a6d0e534942c68672213a36ed43a8bdc994 [file] [log] [blame]
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<p>Test for bug 79678 - SVG transform-origin presentation attribute. Verify that getComputedStyle() reflects an SVG element's transform-origin.</p>
<p>On success, you will see a series of "PASS" messages</p>
<pre id="console"></pre>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect id="rect1" transform-origin="50 100" width="100" height="100" />
<rect id="rect2" width="100" height="100" fill="red" />
</svg>
<script><![CDATA[
if (window.testRunner)
testRunner.dumpAsText();
var resultString = "";
function checkTransformOrigin(eltID, expectedValue) {
var rect = document.getElementById(eltID);
var cssValue = window.getComputedStyle(rect, null).getPropertyCSSValue("-webkit-transform-origin");
var actualValue = (cssValue) ? cssValue.cssText : "<no value>";
resultString += (actualValue == expectedValue) ? "PASS " : "FAIL ";
resultString += eltID + " transformOrigin, expected \"" + expectedValue + "\" actual \"" + actualValue + "\"\n";
}
checkTransformOrigin("rect1", "50px 100px");
checkTransformOrigin("rect2", "0px 0px");
document.getElementById("console").innerHTML = resultString;
]]></script>
</body>
</html>