summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-transforms/transform-box/svgbox-fill-box.html
blob: 111d8dbcfb3d819017fb8c126d1ed6793aa34bca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<title>transform-box: fill-box (SVG layout)</title>
<link rel="match" href="./reference/svgbox-ref.html">
<link rel="help" href="https://drafts.csswg.org/css-transforms-1/#transform-box">
<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: 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 = "fill-box";
var compStyle = getComputedStyle(document.getElementById('target')).transformBox;
if (refStyle != compStyle)
    document.getElementById('error').textContent = "Error, got computed style " + compStyle;
</script>