Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE HTML>
<title>CSS Grid Layout Test: border-box min and max height when computing the flex row</title>
<link rel="author" title="Sammy Gill" href="mailto:sammy.gill@apple.com"/>
<link href="/css/support/grid.css" rel="stylesheet"/>
<meta name="assert" content="This test ensures that minimum and maximum heights on a grid container with box-sizing: border-box exclude its border and padding when computing the flex fraction for grid rows."/>
<style>
.grid {
margin: 3px;
grid: minmax(10px, 1fr) minmax(10px, 4fr) / 50px;
grid-row-gap: 33px;
border: 5px dashed;
padding: 2px;
box-sizing: border-box;
}
.float { float: left; }
.item:nth-child(1) { background-color: purple; }
.item:nth-child(2) { background-color: blue; }
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<body onload="checkLayout('.grid')">
<div id="log"></div>
<p>This test PASS if all the grids in the same row look the same.</p>
<div class="grid float" style="max-height: 84px" data-expected-width="64" data-expected-height="84">
<div class="item" data-expected-width="50" data-expected-height="10"></div>
<div class="item" data-expected-width="50" data-expected-height="27"></div>
</div>
<div class="grid float" style="min-height: 84px; max-height: 74px" data-expected-width="64" data-expected-height="84">
<div class="item" data-expected-width="50" data-expected-height="10"></div>
<div class="item" data-expected-width="50" data-expected-height="27"></div>
</div>
<div class="grid float" style="height: 84px" data-expected-width="64" data-expected-height="84">
<div class="item" data-expected-width="50" data-expected-height="10"></div>
<div class="item" data-expected-width="50" data-expected-height="27"></div>
</div>
<br clear="all">
<div class="grid float" style="min-height: 122px" data-expected-width="64" data-expected-height="122">
<div class="item" data-expected-width="50" data-expected-height="15"></div>
<div class="item" data-expected-width="50" data-expected-height="60"></div>
</div>
<div class="grid float" style="min-height: 122px; max-height: 74px" data-expected-width="64" data-expected-height="122">
<div class="item" data-expected-width="50" data-expected-height="15"></div>
<div class="item" data-expected-width="50" data-expected-height="60"></div>
</div>
<div class="grid float" style="height: 122px" data-expected-width="64" data-expected-height="122">
<div class="item" data-expected-width="50" data-expected-height="15"></div>
<div class="item" data-expected-width="50" data-expected-height="60"></div>
</div>
</body>