Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<meta charset="utf-8">
<meta name="assert" content="An implicit row with the initial grid-auto-rows: auto is sized to its item's content height, regardless of the height of the grid container's containing block.">
<link rel="stylesheet" href="/css/support/grid.css">
<link rel="stylesheet" href="/fonts/ahem.css">
<style>
.gridAutoContent {
grid-template-columns: 50px;
/* grid-template-rows is left unset so that the grid item's row is implicit. */
}
.firstRowFirstColumn {
font: 10px/1 Ahem;
/* Make us fit our grid area. */
width: 100%;
height: 100%;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<body onload="document.fonts.ready.then(() => { checkLayout('.gridAutoContent'); })">
<p>Test that auto implicit rows are sized to their grid items' content.</p>
<div class="constrainedContainer">
<div class="grid gridAutoContent">
<div class="firstRowFirstColumn" data-expected-width="50" data-expected-height="30">XXXXX XXXXX XXXXX</div>
</div>
</div>
<!-- Allow the extra space distribution to occur. -->
<div style="width: 40px; height: 10px">
<div class="grid gridAutoContent">
<div class="firstRowFirstColumn" data-expected-width="50" data-expected-height="30">XXXXX XXXXX XXXXX</div>
</div>
</div>
<div style="width: 100px; height: 10px;">
<div class="grid gridAutoContent">
<div class="firstRowFirstColumn" data-expected-width="50" data-expected-height="60">XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX</div>
</div>
</div>
</body>