Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-transforms/perspective-svg-child-002.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>perspective() in the transform list of an SVG child</title>
<link rel="match" href="perspective-svg-child-ref.html">
<!-- The rect is pushed to z = -200px under a 200px perspective, so it is
scaled by 200 / (200 + 200) = 0.5 about the transform origin (100, 100):
from (40, 40) 120x120 to (70, 70) 60x60. -->
<svg width="200" height="200">
<rect x="40" y="40" width="120" height="120" fill="green"
style="transform: perspective(200px) translateZ(-200px);
transform-origin: 100px 100px"/>
</svg>