svgbox-content-box.html (882B)
1 <!DOCTYPE html> 2 <title>transform-box: content-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: content-box; /* alias for fill-box */ 13 transform-origin: 0px 0px; 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 = "content-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>