Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>CSS Grid Layout Test: Absolutely positioned descendants of a grid container with min-height or max-height</title>
<meta name="assert" content="This test checks that an absolutely positioned descendant whose containing block is a grid container with an indefinite height is positioned against the grid container's size after min-height and max-height have been applied.">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
.grid {
display: grid;
grid-template-columns: 100px;
position: relative;
font: 25px/1 Ahem;
margin: 50px 0;
}
.abspos {
position: absolute;
bottom: 0;
width: 10px;
height: 10px;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">
<div id="log"></div>
<p>max-height: 50px;</p>
<div class="grid" style="max-height: 50px;" data-expected-height="50">
<div>X<br>X<br>X<br>X<div class="abspos" data-offset-y="40"></div></div>
</div>
<p>min-height: 100px; grid-template-rows: 20px;</p>
<div class="grid" style="min-height: 100px; grid-template-rows: 20px;" data-expected-height="100">
<div><div class="abspos" data-offset-y="90"></div></div>
</div>
<p>box-sizing: border-box; max-height: 70px; padding: 10px;</p>
<div class="grid" style="box-sizing: border-box; max-height: 70px; padding: 10px;" data-expected-height="70">
<div>X<br>X<br>X<br>X<div class="abspos" data-offset-y="60"></div></div>
</div>
</body>
</html>