grid-auto-repeat-min-max-size-001.html (2058B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Grid Layout Test: Auto repeat tracks with min and max sizes</title> 4 <link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-grid-1/#auto-repeat"> 6 <meta name="assert" content="This test checks that auto repeat tracks don't overflow the grid container size when max size is definite, even if min size is bigger than that."> 7 <link rel="stylesheet" href="/css/support/grid.css"> 8 <style> 9 .grid { 10 position: relative; 11 display: grid; 12 grid: repeat(auto-fill, 50px) / repeat(auto-fill, 100px); 13 max-width: 100px; 14 min-width: 250px; 15 max-height: 50px; 16 min-height: 125px; 17 float: left; 18 } 19 .border { 20 border: 10px solid; 21 } 22 .border-box { 23 box-sizing: border-box; 24 } 25 .item { 26 background: lime; 27 /* Place item on the last cell. */ 28 grid-column: -2; 29 grid-row: -2; 30 } 31 </style> 32 <script src="/resources/testharness.js"></script> 33 <script src="/resources/testharnessreport.js"></script> 34 <script src="/resources/check-layout-th.js"></script> 35 <body onload="checkLayout('.grid');"> 36 37 <div id="log"></div> 38 39 <div class="grid" data-expected-width="250" data-expected-height="125"> 40 <div class="item" data-offset-x="100" data-offset-y="50" data-expected-width="100" data-expected-height="50"></div> 41 </div> 42 43 <div class="grid" style="width: 200px; height: 100px;" data-expected-width="250" data-expected-height="125"> 44 <div class="item" data-offset-x="100" data-offset-y="50" data-expected-width="100" data-expected-height="50"></div> 45 </div> 46 47 <div class="grid" style="width: min-content; height: min-content;" data-expected-width="250" data-expected-height="125"> 48 <div class="item" data-offset-x="100" data-offset-y="50" data-expected-width="100" data-expected-height="50"></div> 49 </div> 50 51 <div class="grid" style="width: max-content; height: max-content;" data-expected-width="250" data-expected-height="125"> 52 <div class="item" data-offset-x="100" data-offset-y="50" data-expected-width="100" data-expected-height="50"></div> 53 </div> 54 55 </body>