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