summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-transforms/3dtransform-and-filter-no-perspective-001.html
blob: d40e47352c66f4a51cc863df877ead9ae1390879 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE HTML>
<title>CSS Test (Transforms): Filter on a 3d transformed element</title>
<link rel="author" title="L. David Baron" href="https://dbaron.org/">
<link rel="author" title="Google" href="http://www.google.com/">
<link rel="help" href="http://www.w3.org/TR/css-transforms-2/#3d-transform-rendering">
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#FilterProperty">
<meta name="assert" content="The filtered element is rendered correctly without clipping, despite the interesting transform.">
<link rel="match" href="3dtransform-and-filter-no-perspective-001-ref.html">

<style>

body {
  margin: 0;
}

div {
  height: 500px;
  width: 750px;
  overflow: hidden;
  position: relative;
}

span {
  background: blue;
  display: inline-block;
  top: 0;
  left: 200px;
  position: absolute;
  width: 293px;
  height: 174px;
  transform-origin: 0px -400px 0px;
  margin-top: 300px;
  transform: rotateZ(-20deg) rotateX(55deg);
  filter: drop-shadow(0px 60px 40px rgba(0,0,0,0));
}

svg.cover {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 600px;
  height: 220px;
}

/*

The device-to-local transform here is:
left              margin-top        transform-origin   transform                      -transform-origin
translateX(200px) translateY(300px) translateY(-400px) rotateZ(-20deg) rotateX(55deg) translateY(400px)
which is equivalent to:
matrix3d(0.939693, -0.34202, 0, 0, 0.196175, 0.538986, 0.819152, 0, -0.280166, -0.769751, 0.573576, 0, 278.47, 115.594, 327.661, 1)

*/

</style>

<div>
  <span></span>
</div>

<!-- cover the blurred edge so we can match to a reference -->
<svg class="cover">
  <polygon fill="transparent" stroke="aqua" stroke-width="4"
           points="278.470,115.594
                   553.80005,15.38214
                   587.9345,109.1657
                   312.6045,209.3776" />
</svg>