blob: 4ee05131028e90ac7415074a47b034f2b62c72bb [file] [log] [blame]
<!DOCTYPE html>
<link href="resources/grid.css" rel="stylesheet">
<link href="resources/grid-alignment.css" rel="stylesheet">
<style>
.freeSpaceForColumnsGrid {
grid-template: 100% / minmax(20px, 0.7fr);
width: 50px;
height: 100px;
}
.freeSpaceForRowsGrid {
grid-template: minmax(20px, 0.7fr) / 100%;
width: 50px;
height: 100px;
}
.container { position: relative; }
.item {
width: 100%;
height: 50px;
background-color: red;
}
.item2 {
width: 50px;
height: 100%;
background-color: red;
}
</style>
<script src="../../resources/check-layout.js"></script>
<body onload="checkLayout('.grid');">
<p>This test checks that freeSpace is properly computed after computing fr tracks so that we could use it for content distribution</p>
<p>Grid with justify-content: start.</p>
<div class="container">
<div class="grid freeSpaceForColumnsGrid justifyContentStart">
<div class="item" data-offset-x="0" data-offset-y="0" data-expected-width="35" data-expected-height="50"></div>
</div>
</div>
<p>Grid with justify-content: center.</p>
<div class="container">
<div class="grid freeSpaceForColumnsGrid justifyContentCenter">
<div class="item" data-offset-x="8" data-offset-y="0" data-expected-width="35" data-expected-height="50"></div>
</div>
</div>
<p>Grid with justify-content: end.</p>
<div class="container">
<div class="grid freeSpaceForColumnsGrid justifyContentEnd">
<div class="item" data-offset-x="15" data-offset-y="0" data-expected-width="35" data-expected-height="50"></div>
</div>
</div>
<p>Grid with align-content: start.</p>
<div class="container">
<div class="grid freeSpaceForRowsGrid alignContentStart">
<div class="item2" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="70"></div>
</div>
</div>
<p>Grid with align-content: center.</p>
<div class="container">
<div class="grid freeSpaceForRowsGrid alignContentCenter">
<div class="item2" data-offset-x="0" data-offset-y="15" data-expected-width="50" data-expected-height="70"></div>
</div>
</div>
<p>Grid with align-content: end.</p>
<div class="container">
<div class="grid freeSpaceForRowsGrid alignContentEnd">
<div class="item2" data-offset-x="0" data-offset-y="30" data-expected-width="50" data-expected-height="70"></div>
</div>
</div>
</body>