| OLD | NEW |
| 1 <html xmlns="http://www.w3.org/1999/xhtml"> | 1 <html xmlns="http://www.w3.org/1999/xhtml"> |
| 2 <body> | 2 <body> |
| 3 <p>Test for bug 79678 - SVG transform-origin presentation attribute. Verify
that getComputedStyle() reflects an SVG element's transform-origin.</p> | 3 <p>Test for bug 79678 - SVG transform-origin presentation attribute. Verify
that getComputedStyle() reflects an SVG element's transform-origin.</p> |
| 4 <p>On success, you will see a series of "PASS" messages</p> | 4 <p>On success, you will see a series of "PASS" messages</p> |
| 5 <pre id="console"></pre> | 5 <pre id="console"></pre> |
| 6 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/
xlink"> | 6 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/
xlink"> |
| 7 <rect id="rect1" transform-origin="50 100" width="100" height="100" /> | 7 <rect id="rect1" transform-origin="50 100" width="100" height="100" /> |
| 8 <rect id="rect2" width="100" height="100" fill="red" /> | 8 <rect id="rect2" width="100" height="100" fill="red" /> |
| 9 </svg> | 9 </svg> |
| 10 <script><![CDATA[ | 10 <script><![CDATA[ |
| 11 if (window.testRunner) | 11 if (window.testRunner) |
| 12 testRunner.dumpAsText(); | 12 testRunner.dumpAsText(); |
| 13 | 13 |
| 14 var resultString = ""; | 14 var resultString = ""; |
| 15 | 15 |
| 16 function checkTransformOrigin(eltID, expectedValue) { | 16 function checkTransformOrigin(eltID, expectedValue) { |
| 17 var rect = document.getElementById(eltID); | 17 var rect = document.getElementById(eltID); |
| 18 var cssValue = window.getComputedStyle(rect, null).getPropertyCSSValue
("-webkit-transform-origin"); | 18 var actualValue = getComputedStyle(rect).webkitTransformOrigin; |
| 19 var actualValue = (cssValue) ? cssValue.cssText : "<no value>"; | |
| 20 resultString += (actualValue == expectedValue) ? "PASS " : "FAIL "; | 19 resultString += (actualValue == expectedValue) ? "PASS " : "FAIL "; |
| 21 resultString += eltID + " transformOrigin, expected \"" + expectedValu
e + "\" actual \"" + actualValue + "\"\n"; | 20 resultString += eltID + " transformOrigin, expected \"" + expectedValu
e + "\" actual \"" + actualValue + "\"\n"; |
| 22 } | 21 } |
| 23 | 22 |
| 24 checkTransformOrigin("rect1", "50px 100px"); | 23 checkTransformOrigin("rect1", "50px 100px"); |
| 25 checkTransformOrigin("rect2", "0px 0px"); | 24 checkTransformOrigin("rect2", "0px 0px"); |
| 26 | 25 |
| 27 document.getElementById("console").innerHTML = resultString; | 26 document.getElementById("console").innerHTML = resultString; |
| 28 ]]></script> | 27 ]]></script> |
| 29 </body> | 28 </body> |
| 30 </html> | 29 </html> |
| OLD | NEW |