summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-flexbox/flex-aspect-ratio-img-row-013.html
blob: 09a177d2f72ba112dc21bcb7a183566c6966ae43 (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
<!DOCTYPE html>
<link rel="author" title="David Grogan" href="mailto:dgrogan@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#transferred-size-suggestion">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5663">
<meta name="assert" content="Transferred size suggestion can get its cross size from stretching." />

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>

<body onload="checkLayout('img')">
<p>
Pass condition is 4 green 100x100 squares and 1 0x0 square.
</p>

<p>
Firefox 84a1 passes. Chrome 87 fails them all by making the green rectangles be 200x100.
</p>

<p>Transferred size suggestion is the stretched 100px:</p>
<div style="display: flex; width: 0; height: 100px;">
  <img src="support/200x200-green.png" data-expected-height=100 data-expected-width=100>
</div>

<p>Have to subtract the margin from the stretched height to get the transferred size suggestion:</p>
<div style="display: flex; width: 0; height: 120px;">
  <img src="support/200x200-green.png" style="margin-bottom: 20px" data-expected-height=100 data-expected-width=100>
</div>

<p>Have to subtract a margin larger than the stretched height to get 0px transferred size suggestion:</p>
<div style="display: flex; width: 0; height: 120px;">
  <img src="support/200x200-green.png" style="margin-bottom: 160px" data-expected-height=0 data-expected-width=0>
</div>

<p>Have to subtract the margin from the stretched height (ignoring the presence of a border) to get the transferred size suggestion:</p>
<div style="display: flex; width: 0; height: 120px;">
  <img src="support/200x200-green.png" style="border-right: 10px solid black; margin-bottom: 20px" data-expected-height=100 data-expected-width=110>
</div>

<p>Stretched transferred size suggestion has to obey min-height:</p>
<div style="display: flex; width: 0; height: 50px;">
  <img src="support/200x200-green.png" style="min-height: 100px;" data-expected-height=100 data-expected-width=100>
</div>