col-wrap-012.html (1435B)
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/#intrinsic-sizes"> 4 <link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> 5 6 <meta name="assert" 7 content="During the container's intrinsic sizing pass, the item has the correct available size when it is laid out during flex basis calculation." /> 8 9 <style> 10 #reference-overlapped-red { 11 position: absolute; 12 background-color: red; 13 width: 100px; 14 height: 100px; 15 z-index: -1; 16 } 17 18 .grandchild { 19 float: left; 20 width: 50px; 21 height: 50px; 22 } 23 24 </style> 25 26 <p>Test passes if there is a filled green square and <strong>no red</strong>. 27 </p> 28 <div id=reference-overlapped-red></div> 29 30 <div 31 style="display: flex; flex-flow: column wrap; width: max-content; height: 100px; background: green;"> 32 <div style="width: 100%; flex: 0 0 auto; min-height: 0px;"> 33 <div class="grandchild"></div> 34 <div class="grandchild"></div> 35 </div> 36 <!-- This item will end up in the next flex line if the first item's available width is < 100. If the first item's available width is insufficient, its flex base size would be 100px, leaving no room for the second 50px item. The extra flex line would mean the max-content width of the container would be 140px. --> 37 <div style="width: 90px; height: 50px; flex: 0 0 auto; min-height: 0px;"> 38 </div> 39 </div>