svgbox-view-box.html (852B)
1 <!DOCTYPE html> 2 <title>transform-box: view-box (SVG layout)</title> 3 <link rel="match" href="./reference/svgbox-ref.html"> 4 <link rel="help" href="https://drafts.csswg.org/css-transforms-1/#transform-box"> 5 <meta name="assert" content="This should display a C shape with the center of the top endpoint at 200,100."/> 6 7 <style> 8 #target { 9 fill: green; 10 stroke: black; 11 stroke-width: 50; 12 transform-box: view-box; 13 transform-origin: 200px 100px; 14 transform: rotate(90deg); 15 } 16 </style> 17 18 <svg width="400" height="300"> 19 <path id="target" d="M 200 100 v 100 h 100 v -100"/> 20 </svg> 21 22 <div id="error"></div> 23 <script> 24 var refStyle = "view-box"; 25 var compStyle = getComputedStyle(document.getElementById('target')).transformBox; 26 if (refStyle != compStyle) 27 document.getElementById('error').textContent = "Error, got computed style " + compStyle; 28 </script>