flex-aspect-ratio-img-row-013.html (2088B)
1 <!DOCTYPE html> 2 <link rel="author" title="David Grogan" href="mailto:dgrogan@chromium.org"> 3 <link rel="help" href="https://drafts.csswg.org/css-flexbox/#transferred-size-suggestion"> 4 <link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5663"> 5 <meta name="assert" content="Transferred size suggestion can get its cross size from stretching." /> 6 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 <script src="/resources/check-layout-th.js"></script> 10 11 <body onload="checkLayout('img')"> 12 <p> 13 Pass condition is 4 green 100x100 squares and 1 0x0 square. 14 </p> 15 16 <p> 17 Firefox 84a1 passes. Chrome 87 fails them all by making the green rectangles be 200x100. 18 </p> 19 20 <p>Transferred size suggestion is the stretched 100px:</p> 21 <div style="display: flex; width: 0; height: 100px;"> 22 <img src="support/200x200-green.png" data-expected-height=100 data-expected-width=100> 23 </div> 24 25 <p>Have to subtract the margin from the stretched height to get the transferred size suggestion:</p> 26 <div style="display: flex; width: 0; height: 120px;"> 27 <img src="support/200x200-green.png" style="margin-bottom: 20px" data-expected-height=100 data-expected-width=100> 28 </div> 29 30 <p>Have to subtract a margin larger than the stretched height to get 0px transferred size suggestion:</p> 31 <div style="display: flex; width: 0; height: 120px;"> 32 <img src="support/200x200-green.png" style="margin-bottom: 160px" data-expected-height=0 data-expected-width=0> 33 </div> 34 35 <p>Have to subtract the margin from the stretched height (ignoring the presence of a border) to get the transferred size suggestion:</p> 36 <div style="display: flex; width: 0; height: 120px;"> 37 <img src="support/200x200-green.png" style="border-right: 10px solid black; margin-bottom: 20px" data-expected-height=100 data-expected-width=110> 38 </div> 39 40 <p>Stretched transferred size suggestion has to obey min-height:</p> 41 <div style="display: flex; width: 0; height: 50px;"> 42 <img src="support/200x200-green.png" style="min-height: 100px;" data-expected-height=100 data-expected-width=100> 43 </div>