summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-backgrounds/box-shadow-radius-001.html
blob: 9b823a0590fb5890a33ed605912879ce24ad81f5 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html>
<title>Box Shadow Border Radius (Inset)</title>
<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
<link rel="help" href="https://www.w3.org/TR/css-backgrounds-3/#shadow-shape">
<link rel="match" href="box-shadow-radius-001-ref.html">

<style>
  body > div {
    /* Isolate tests from each other */
    position: relative;
    width: 100px;
    height: 100px;
    float: left;
  }
  div > div {
    position: absolute;
    box-sizing: border-box;
    /* opacity: 0.7; /* uncomment this line for debugging */
  }

  .floor > .test {
    color: silver;
  }
  .trap > .test {
    color: red;
  }
  .test {
    width: 60px;
    height: 60px;
    top: 20px;
    left: 20px;
  }

  .floor > .ref {
    border: 8px red;
    border-style: solid none none solid;
    top: 21px;
    left: 21px;
    width: 59px;
    height: 59px;
  }
  .trap > .ref {
    border: 31px silver;
    border-style: solid none none solid;
    width: 81px;
    height: 81px;
  }

  /* Keep tests consistent by offset - spread = 10
     Trap radius = 32px + shadow radius (round up)
     Floor radius = 8px + shadow radius (round down) */

  .once > .test {
    border-top-left-radius: 10px;
    box-shadow: 20px 20px 0 -10px inset;
    /* shadow radius = 20px */
  }
  .once.floor > .ref {
    border-top-left-radius: 28px;
  }
  .once.trap > .ref {
    border-top-left-radius: 52px;
  }

  .twice > .test {
    border-top-left-radius: 10px;
    box-shadow: 15px 15px 0 -5px inset;
    /* shadow radius = 15 */
  }
  .twice.floor > .ref {
    border-top-left-radius: 23px;
  }
  .twice.trap > .ref {
    border-top-left-radius: 47px;
  }

  .half > .test {
    border-top-left-radius: 8px;
    box-shadow: 26px 26px 0 -16px inset;
    /* shadow radius = 21px */
  }
  .half.floor > .ref {
    border-top-left-radius: 29px;
  }
  .half.trap > .ref {
    border-top-left-radius: 53px;
  }

  .fourth > .test {
    border-top-left-radius: 5px;
    box-shadow: 30px 30px 0 -20px inset;
    /* shadow radius = 14.45 */
  }
  .fourth.floor > .ref {
    border-top-left-radius: 22px;
  }
  .fourth.trap > .ref {
    border-top-left-radius: 47px;
  }

  .eighth > .test {
    border-top-left-radius: 2px;
    box-shadow: 26px 26px 0 -16px inset;
    /* shadow radius = 5.28 */
  }
  .eighth.floor > .ref {
    border-top-left-radius: 12px;
  }
  .eighth.trap > .ref {
    border-top-left-radius: 38px;
  }

</style>

<p>Test passes if there is no red.

<div class="once floor">
  <div class="ref"></div>
  <div class="test"></div>
</div>
<div class="once trap">
  <div class="test"></div>
  <div class="ref"></div>
</div>

<div class="twice floor">
  <div class="ref"></div>
  <div class="test"></div>
</div>
<div class="twice trap">
  <div class="test"></div>
  <div class="ref"></div>
</div>

<div class="half floor">
  <div class="ref"></div>
  <div class="test"></div>
</div>
<div class="half trap">
  <div class="test"></div>
  <div class="ref"></div>
</div>

<div class="fourth floor">
  <div class="ref"></div>
  <div class="test"></div>
</div>
<div class="fourth trap">
  <div class="test"></div>
  <div class="ref"></div>
</div>

<div class="eighth floor">
  <div class="ref"></div>
  <div class="test"></div>
</div>
<div class="eighth trap">
  <div class="test"></div>
  <div class="ref"></div>
</div>