summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-align/blocks/align-content-block-011.html
blob: 9210f5a83a7a5c95775c42d7a01d1f3ac6ab440e (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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
<!DOCTYPE html>
<html>
<title>CSS Box Alignment: align-content content change on small block container with floats</title>
<link rel="help" href="https://www.w3.org/TR/css-align-3/#align-block">
<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>

<style title="Needed for automation; delete to review/debug">
  @import "/fonts/ahem.css";
  html { font: 10px/1 Ahem; max-width: 800px; }
  .label { display: none; }
  #manual { display: none; }
</style>

<style id="initial">
  .in-flow .float { height: 0; !important }
</style>
<script>
  function doTest()
  {
    document.body.offsetHeight; // trigger layout
    document.getElementById('initial').type = 'text/plain'; // invalidate stylesheet
    checkLayout('.test');
  }
  window.onload = () => {
    requestAnimationFrame(() => {
      requestAnimationFrame(doTest);
    });
  };
  window.addEventListener("click", () => { document.getElementById('manual').style.display = "inline"; });
</script>

<style>
  html, body { margin: 0; padding: 0; }

  .test { height: 1em; margin: 0.5em 2em;
          /* show bounds of test box without interfering with margin-collapsing */
          background: black; padding-right: 2px; }
  /* ensure float is contained */
    .float { float: right; background: orange; height: 2em }
  /* ensure margin is contained */
    .in-flow { margin-top: 1em; background: orange }
  /* ensure relpos is ignored */
    .relpos { position: relative; top: -1.5em; }
  /* ensure abspos static position follows alignment */
    .wrapper { position: relative; }
    .abspos { position: absolute; right: 0; margin-top: -1.5em; }
  /* ensure overflow is not counted */
    .overflow { height: 0; }

  /* cram into 800x600 */
  html { max-height: 600px; columns: 3 }
  .wrapper { break-inside: avoid; border: solid 2px gray; padding: 3em 0; }

  /* readability */
  .test > * { color: #8888; }
  .label { color: black; font-weight: bold; }
</style>

<!--
  Results should be same as align-content-block-005.html.
-->

<div class="wrapper">
  <div class="test" style="align-content: start" title="start">
    <div class="float" data-offset-y="35">FLT</div>
    <div class="in-flow" data-offset-y="45"></div>
    <div class="in-flow">
      <div class="float" data-offset-y="45">FLT</div>
      <span class="label">START</span>
      <span class="abspos">ABS</span>
      <span class="relpos">REL</span>
      <div class="overflow">OVERFLOW</div>
    </div>
  </div>
</div>
<div class="wrapper">
  <div class="test" style="align-content: center" title="center">
    <div class="float" data-offset-y="35">FLT</div>
    <div class="in-flow" data-offset-y="45"></div>
    <div class="in-flow">
      <div class="float" data-offset-y="45">FLT</div>
      <span class="label">CENTER</span>
      <span class="abspos">ABS</span>
      <span class="relpos">REL</span>
      <div class="overflow">OVERFLOW</div>
    </div>
  </div>
</div>
<div class="wrapper">
  <div class="test" style="align-content: end" title="end">
    <div class="float" data-offset-y="35">FLT</div>
    <div class="in-flow" data-offset-y="45"></div>
    <div class="in-flow">
      <div class="float" data-offset-y="45">FLT</div>
      <span class="label">END</span>
      <span class="abspos">ABS</span>
      <span class="relpos">REL</span>
      <div class="overflow">OVERFLOW</div>
    </div>
  </div>
</div>
<div class="wrapper">
  <div class="test" style="align-content: baseline" title="baseline">
    <div class="float" data-offset-y="35">FLT</div>
    <div class="in-flow" data-offset-y="45"></div>
    <div class="in-flow">
      <div class="float" data-offset-y="45">FLT</div>
      <span class="label">BASELINE</span>
      <span class="abspos">ABS</span>
      <span class="relpos">REL</span>
      <div class="overflow">OVERFLOW</div>
    </div>
  </div>
</div>
<div class="wrapper">
  <div class="test" style="align-content: last baseline" title="last baseline">
    <div class="float" data-offset-y="35">FLT</div>
    <div class="in-flow" data-offset-y="45"></div>
    <div class="in-flow">
      <div class="float" data-offset-y="45">FLT</div>
      <span class="label">LAST BASELINE</span>
      <span class="abspos">ABS</span>
      <span class="relpos">REL</span>
      <div class="overflow">OVERFLOW</div>
    </div>
  </div>
</div>
<div class="wrapper">
  <div class="test" style="align-content: flex-start" title="flex-start">
    <div class="float" data-offset-y="35">FLT</div>
    <div class="in-flow" data-offset-y="45"></div>
    <div class="in-flow">
      <div class="float" data-offset-y="45">FLT</div>
      <span class="label">FLEX-START</span>
      <span class="abspos">ABS</span>
      <span class="relpos">REL</span>
      <div class="overflow">OVERFLOW</div>
    </div>
  </div>
</div>
<div class="wrapper">
  <div class="test" style="align-content: flex-end" title="flex-end">
    <div class="float" data-offset-y="35">FLT</div>
    <div class="in-flow" data-offset-y="45"></div>
    <div class="in-flow">
      <div class="float" data-offset-y="45">FLT</div>
      <span class="label">FLEX-END</span>
      <span class="abspos">ABS</span>
      <span class="relpos">REL</span>
      <div class="overflow">OVERFLOW</div>
    </div>
  </div>
</div>
<div class="wrapper">
  <div class="test" style="align-content: unsafe start" title="unsafe start">
    <div class="float" data-offset-y="35">FLT</div>
    <div class="in-flow" data-offset-y="45"></div>
    <div class="in-flow">
      <div class="float" data-offset-y="45">FLT</div>
      <span class="label">UNSAFE START</span>
      <span class="abspos">ABS</span>
      <span class="relpos">REL</span>
      <div class="overflow">OVERFLOW</div>
    </div>
  </div>
</div>
<div class="wrapper">
  <div class="test" style="align-content: unsafe center" title="unsafe center">
    <div class="float" data-offset-y="25">FLT</div>
    <div class="in-flow" data-offset-y="35"></div>
    <div class="in-flow">
      <div class="float" data-offset-y="35">FLT</div>
      <span class="label">UNSAFE CENTER</span>
      <span class="abspos">ABS</span>
      <span class="relpos">REL</span>
      <div class="overflow">OVERFLOW</div>
    </div>
  </div>
</div>
<div class="wrapper">
  <div class="test" style="align-content: unsafe end" title="unsafe end">
    <div class="float" data-offset-y="15">FLT</div>
    <div class="in-flow" data-offset-y="25"></div>
    <div class="in-flow">
      <div class="float" data-offset-y="25">FLT</div>
      <span class="label">UNSAFE END</span>
      <span class="abspos">ABS</span>
      <span class="relpos">REL</span>
      <div class="overflow">OVERFLOW</div>
    </div>
  </div>
</div>
<div class="wrapper">
  <div class="test" style="align-content: safe start" title="safe start">
    <div class="float" data-offset-y="35">FLT</div>
    <div class="in-flow" data-offset-y="45"></div>
    <div class="in-flow">
      <div class="float" data-offset-y="45">FLT</div>
      <span class="label">SAFE START</span>
      <span class="abspos">ABS</span>
      <span class="relpos">REL</span>
      <div class="overflow">OVERFLOW</div>
    </div>
  </div>
</div>
<div class="wrapper">
  <div class="test" style="align-content: safe center" title="safe center">
    <div class="float" data-offset-y="35">FLT</div>
    <div class="in-flow" data-offset-y="45"></div>
    <div class="in-flow">
      <div class="float" data-offset-y="45">FLT</div>
      <span class="label">SAFE CENTER</span>
      <span class="abspos">ABS</span>
      <span class="relpos">REL</span>
      <div class="overflow">OVERFLOW</div>
    </div>
  </div>
</div>
<div class="wrapper">
  <div class="test" style="align-content: safe end" title="safe end">
    <div class="float" data-offset-y="35">FLT</div>
    <div class="in-flow" data-offset-y="45"></div>
    <div class="in-flow">
      <div class="float" data-offset-y="45">FLT</div>
      <span class="label">SAFE END</span>
      <span class="abspos">ABS</span>
      <span class="relpos">REL</span>
      <div class="overflow">OVERFLOW</div>
    </div>
  </div>
</div>
<div class="wrapper">
  <div class="test" style="align-content: space-evenly" title="space-evenly">
    <div class="float" data-offset-y="35">FLT</div>
    <div class="in-flow" data-offset-y="45"></div>
    <div class="in-flow">
      <div class="float" data-offset-y="45">FLT</div>
      <span class="label">SPACE-EVENLY</span>
      <span class="abspos">ABS</span>
      <span class="relpos">REL</span>
      <div class="overflow">OVERFLOW</div>
    </div>
  </div>
</div>
<div class="wrapper">
  <div class="test" style="align-content: space-between" title="space-between">
    <div class="float" data-offset-y="35">FLT</div>
    <div class="in-flow" data-offset-y="45"></div>
    <div class="in-flow">
      <div class="float" data-offset-y="45">FLT</div>
      <span class="label">SPACE-BETWEEN</span>
      <span class="abspos">ABS</span>
      <span class="relpos">REL</span>
      <div class="overflow">OVERFLOW</div>
    </div>
  </div>
</div>
<div class="wrapper">
  <div class="test" style="align-content: space-around" title="space-around">
    <div class="float" data-offset-y="35">FLT</div>
    <div class="in-flow" data-offset-y="45"></div>
    <div class="in-flow">
      <div class="float" data-offset-y="45">FLT</div>
      <span class="label">SPACE-AROUND</span>
      <span class="abspos">ABS</span>
      <span class="relpos">REL</span>
      <div class="overflow">OVERFLOW</div>
    </div>
  </div>
</div>
<div class="wrapper">
  <div class="test" style="align-content: normal" title="normal">
    <div class="float" data-offset-y="40">FLT</div>
    <div class="in-flow" data-offset-y="40"></div>
    <div class="in-flow">
      <div class="float" data-offset-y="40">FLT</div>
      <span class="label">NORMAL</span>
      <span class="abspos">ABS</span>
      <span class="relpos">REL</span>
      <div class="overflow">OVERFLOW</div>
    </div>
  </div>
</div>

<p>
  <button onclick="document.querySelector('style[title]').textContent = 'html { font-size: 12px; }'">Show Text</button>