summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-transforms/transform-box/cssbox-content-box.html
blob: 31a44282930b71e5483fa0dc9774c99843b0fd93 (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
29
30
<!DOCTYPE html>
<title>transform-box: content-box (CSS layout)</title>
<link rel="match" href="./reference/cssbox-ref.html">
<link rel="help" href="https://drafts.csswg.org/css-transforms-1/#transform-box">
<meta name="assert" content="This should display a square with a black bar at the top whose top-left corner is at 100,100."/>

<style>
#target {
    width: 150px;
    height: 200px;
    margin-left: 300px;
    margin-top: 100px;
    background-color: green;
    border-left: solid 50px black;

    transform: rotate(90deg);
    transform-origin: -50px 0;
    transform-box: content-box;
}
</style>

<div id="target"></div>

<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>