columns-height-set-via-top-bottom.html (1751B)
1 <!DOCTYPE html> 2 <html> 3 <title>Proper size of flex item in a column flexbox with height set via top/bottom.</title> 4 <link href="support/flexbox.css" rel="stylesheet"> 5 <link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#flex-direction-property"> 6 <link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#propdef-flex-flow"> 7 <meta name="assert" content="This test ensures that when a 'display: flex' element with 'flex-flow: column' is itself sized by fitting to another container via setting position absolute + top, bottom, right, left all to 0, its flex items do not have natural size."/> 8 <style> 9 .container { 10 position: relative; 11 height: 100px; 12 width: 100px; 13 border: 2px solid orange; 14 } 15 .flexbox { 16 flex-direction: column; 17 position: absolute; 18 top: 0; 19 right: 0; 20 bottom: 0; 21 left: 0; 22 padding: 10px; 23 } 24 .flexbox > :nth-child(1) { 25 background-color: lightblue; 26 } 27 .flexbox > :nth-child(2) { 28 background-color: lightgreen; 29 } 30 </style> 31 <script src="/resources/testharness.js"></script> 32 <script src="/resources/testharnessreport.js"></script> 33 <script src="/resources/check-layout-th.js"></script> 34 <body onload="checkLayout('.flexbox')"> 35 <div id=log></div> 36 37 <div class="container"> 38 <div data-expected-height=100 class="flexbox column"> 39 <div data-expected-height=30 data-expected-width=80 style="height: 30px"></div> 40 <div data-expected-height=50 data-expected-width=80 style="flex: 1;"></div> 41 </div> 42 </div> 43 44 <div class="container"> 45 <div class="flexbox column wrap"> 46 <div data-expected-height=50 data-expected-width=40 style="height: 50px"></div> 47 <div data-expected-height=80 data-expected-width=40 style="flex: 1 50px;"></div> 48 </div> 49 </div> 50 </body> 51 </html>