Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<title>transform-box: content-box (SVG layout)</title>
<link rel="match" href="./reference/svgbox-ref.html">
<meta name="assert" content="This should display a C shape with the center of the top endpoint at 200,100."/>
<style>
#target {
fill: green;
stroke: black;
stroke-width: 50;
transform-box: content-box; /* alias for fill-box */
transform-origin: 0px 0px;
transform: rotate(90deg);
}
</style>
<svg width="400" height="300">
<path id="target" d="M 200 100 v 100 h 100 v -100"/>
</svg>
<div id="error"></div>
<script>
var refStyle = "content-box";
var compStyle = getComputedStyle(document.getElementById('target')).transformBox;
if (refStyle != compStyle)
document.getElementById('error').textContent = "Error, got computed style " + compStyle;
</script>