Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="assert" content="An 'auto' row track is sized from the content height of its grid item.">
<link rel="stylesheet" href="/css/support/grid.css">
<link rel="stylesheet" href="/fonts/ahem.css">
<style>
.gridAutoContent {
grid-template-columns: 50px;
grid-template-rows: auto;
}
.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 resolving auto tracks on grid items works properly.</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 logical 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: 40px; 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>