grid-auto-min-sizing-min-content-min-size-003.html (2015B)
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-height: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-003-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 .row { grid-template-rows:minmax(auto,0.0001fr); } 25 .row img { 26 min-width: 0; 27 min-height: -webkit-min-content; 28 min-height: min-content; 29 } 30 31 br { clear:both; } 32 33 </style> 34 </head> 35 <body> 36 37 <script> 38 var rowtest = [ 39 "width:12px; max-height:48px", "width:12px; height:48px", "width:4px; height:12px", 40 "height:12px", "max-height:48px", "max-height:12px", "width:1px", "max-width:1px", 41 "width:1px; height:20px", "min-width:3px", "min-width:5px; max-height:30px" 42 ]; 43 44 var h3 = document.createElement('h3'); 45 h3.appendChild(document.createTextNode("grid-template-rows:minmax(auto,0.0001fr)")); 46 document.body.appendChild(h3); 47 for (var i = 0; i < rowtest.length; ++i) { 48 var grid = document.createElement('div'); 49 grid.setAttribute("class","grid row"); 50 var img = document.createElement('img'); 51 img.setAttribute("src","support/lime-2x24.png"); 52 img.setAttribute("style",rowtest[i]); 53 grid.appendChild(img); 54 document.body.appendChild(document.createTextNode(`Test ${i+1}: 24x2.png -- ${rowtest[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>