| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <p>Test for bug <a href="http://webkit.org/b/79068">79068</a> - SVG should support transform-origin and relative values |
| Verify that CSS transform translate values can be specified with percentages. |
| 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. |
| <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-box: fill-box; transform: translate(50%)"/> |
| <rect id="r2" x="90" y="260" width="80" height="60" fill="red" style="transform-box: fill-box; transform: translate(-50%, -100%)"/> |
| <rect id="r3" x="10" y="200" width="80" height="60" fill="green" style="transform-box: fill-box; transform: translate(50%, 0%)"/> |
| 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; |