grid-auto-min-sizing-min-content-min-size-001-ref.html (2060B)
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>Reference: 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 <style type="text/css"> 11 html,body { color:black; background-color:white; font:12px monospace; padding:0; margin:0; } 12 13 .grid { 14 display: grid; 15 float: left; 16 border: 1px solid; 17 align-items: start; 18 justify-items: start; 19 margin-bottom:1em; 20 } 21 22 .col { grid-auto-rows:10px; } 23 .col img { min-height:0; } 24 25 br { clear:both; } 26 27 </style> 28 </head> 29 <body> 30 31 <script> 32 var coltest = [ 33 "height:30px; max-width:48px", "height:30px; width:48px", "height:30px; width:12px", 34 "width:12px", "max-width:12px", "height:30px", "height:4px; width:80px", "height:1px", 35 "height:1px; width:20px", "max-height:1px", "max-height:1px; max-width:6px", 36 "min-height:4px", "min-height:4px; max-width: 30px" 37 ]; 38 var results = [ 39 "360px", "360px", "360px", "24px", "24px", "360px", "80px", "12px", "20px", "24px", 40 "24px", "24px", "24px" 41 ]; 42 43 var h3 = document.createElement('h3'); 44 h3.appendChild(document.createTextNode("grid-template-columns:minmax(auto,0.0001fr)")); 45 document.body.appendChild(h3); 46 for (var i = 0; i < coltest.length; ++i) { 47 var grid = document.createElement('div'); 48 grid.setAttribute("class","grid col"); 49 grid.setAttribute("style","grid-template-columns:minmax("+results[i]+",0)"); 50 var img = document.createElement('img'); 51 img.setAttribute("src","support/lime-24x2.png"); 52 img.setAttribute("style",coltest[i] + "; min-width:"+ results[i]); 53 grid.appendChild(img); 54 document.body.appendChild(document.createTextNode(`Test ${i+1}: 24x2.png -- ${coltest[i]}`)); 55 document.body.appendChild(document.createElement('br')); 56 document.body.appendChild(grid); 57 document.body.appendChild(document.createElement('br')); 58 } 59 </script> 60 61 </body> 62 </html>