grid-auto-min-sizing-min-content-min-size-001.html (2098B)
1 <!DOCTYPE HTML> 2 <!-- 3 Any copyright is dedicated to the Public Domain. 4 https://creativecommons.org/publicdomain/zero/1.0/ 5 --> 6 <html><head> 7 <meta charset="utf-8"> 8 <title>CSS Grid Test: Testing track 'auto' min-sizing function with 'min-width:min-content' on an item with an intrinsic aspect ratio</title> 9 <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1218178"> 10 <link rel="help" href="https://drafts.csswg.org/css-grid/#min-size-auto"> 11 <link rel="match" href="grid-auto-min-sizing-min-content-min-size-001-ref.html"> 12 <style type="text/css"> 13 html,body { color:black; background-color:white; font:12px monospace; padding:0; margin:0; } 14 15 .grid { 16 display: grid; 17 float: left; 18 border: 1px solid; 19 align-items: start; 20 justify-items: start; 21 margin-bottom: 1em; 22 } 23 24 .col { grid-template-columns:minmax(auto,0.0001fr); grid-auto-rows:10px; } 25 .col img { 26 min-height: 0; 27 min-width: -webkit-min-content; 28 min-width: min-content; 29 } 30 31 br { clear:both; } 32 33 </style> 34 </head> 35 <body> 36 37 <script> 38 var coltest = [ 39 "height:30px; max-width:48px", "height:30px; width:48px", "height:30px; width:12px", 40 "width:12px", "max-width:12px", "height:30px", "height:4px; width:80px", "height:1px", 41 "height:1px; width:20px", "max-height:1px", "max-height:1px; max-width:6px", 42 "min-height:4px", "min-height:4px; max-width: 30px" 43 ]; 44 45 var h3 = document.createElement('h3'); 46 h3.appendChild(document.createTextNode("grid-template-columns:minmax(auto,0.0001fr)")); 47 document.body.appendChild(h3); 48 for (var i = 0; i < coltest.length; ++i) { 49 var grid = document.createElement('div'); 50 grid.setAttribute("class","grid col"); 51 var img = document.createElement('img'); 52 img.setAttribute("src","support/lime-24x2.png"); 53 img.setAttribute("style",coltest[i]); 54 grid.appendChild(img); 55 document.body.appendChild(document.createTextNode(`Test ${i+1}: 24x2.png -- ${coltest[i]}`)); 56 document.body.appendChild(document.createElement('br')); 57 document.body.appendChild(grid); 58 document.body.appendChild(document.createElement('br')); 59 } 60 </script> 61 62 </body> 63 </html>