blob: 67acdf05c75f26d4bcb570212e36c16304933336 [file] [log] [blame]
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<p>Test for bug <a href="">79068</a> - SVG should support transform-origin and relative values
Verify that CSS transform translate values can be specified with percentages.
</p>
You should see a series of "PASS" messages and one 80x60 green rectangle. The green rectangle obscures two
red rectangles of the same size which have been translated to the same location.
<p>
</p>
<style>rect { transform-box: fill-box }</style>
<svg style="position:absolute; left:0px; top:0px;" xmlns="http://www.w3.org/2000/svg">
<rect id="r1" x="10" y="200" width="80" height="60" fill="red" style="transform: translate(50%)"/>
<rect id="r2" x="90" y="260" width="80" height="60" fill="red" style="transform: translate(-50%, -100%)"/>
<rect id="r3" x="10" y="200" width="80" height="60" fill="green" style="transform: translate(50%, 0%)"/>
</svg>
<pre id="log"></pre>
</body>
<script><![CDATA[
var resultString = "";
function checkClientRect(rectID) {
var cr = document.getElementById(rectID).getBoundingClientRect();
var crString = "[" + cr.left + "," + cr.top + " " + cr.width + "x" + cr.height + "]";
var expected = "[50,200 80x60]";
resultString += ((crString == expected) ? "PASS " : "FAIL ") + " rect \"" + rectID + "\" " + crString + " expected " + expected + "\n";
}
["r1", "r2", "r3"].map(checkClientRect);
document.getElementById("log").innerHTML = resultString;
if (window.testRunner)
testRunner.dumpAsText();
]]></script>
</html>