File: flex-aspect-ratio-img-row-013.html

package info (click to toggle)
firefox-esr 91.12.0esr-1~deb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,375,668 kB
  • sloc: cpp: 5,762,032; javascript: 5,481,714; ansic: 3,121,206; python: 851,492; asm: 331,174; xml: 178,949; java: 155,554; sh: 63,704; makefile: 20,127; perl: 12,825; yacc: 4,583; cs: 3,846; objc: 3,026; lex: 1,720; exp: 762; pascal: 635; php: 436; lisp: 260; awk: 231; ruby: 103; sed: 53; sql: 46; csh: 45
file content (43 lines) | stat: -rw-r--r-- 2,088 bytes parent folder | download | duplicates (19)
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>