blob: 2da63d6c7d7e88b56a6b05682917e7581563c8b1 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<link href="resources/grid.css" rel="stylesheet">
<style>
.grid {
grid-template-columns: 20% 50% 30%;
grid-template-rows: 40%;
}
.fixedSize {
width: 400px;
height: 400px;
}
.calculatedSize {
width: calc(200px + 20%);
height: calc(300px + 10%);
}
.percentageSize {
width: 50%;
height: 50%;
}
.indefiniteSize {
width: -webkit-fit-content;
height: auto;
}
.legacyIntrinsicSize {
width: intrinsic;
height: intrinsic;
}
.firstRowFirstColumn {
color: blue;
background-color: cyan;
}
.firstRowSecondColumn {
color: green;
background-color: lime;
}
.firstRowThirdColumn {
color: brown;
background-color: yellow;
grid-column: 3;
grid-row: 1;
}
</style>
<script src="../../resources/check-layout.js"></script>
</head>
<body onload="checkLayout('.grid');">
<p>This test checks percentage track breadths are resolved properly regarding the container size.</p>
<div class="unconstrainedContainer">
<div class="grid">
<div class="firstRowFirstColumn sizedToGridArea" data-expected-width="200" data-expected-height="10">XX</div>
<div class="firstRowSecondColumn sizedToGridArea" data-expected-width="500" data-expected-height="10">XXXXX</div>
<div class="firstRowThirdColumn sizedToGridArea" data-expected-width="300" data-expected-height="10">XXX</div>
</div>
</div>
<div class="indefiniteSize">
<div class="grid">
<div class="firstRowFirstColumn sizedToGridArea" data-expected-width="20" data-expected-height="10">XX</div>
<div class="firstRowSecondColumn sizedToGridArea" data-expected-width="50" data-expected-height="10">XXXXX</div>
<div class="firstRowThirdColumn sizedToGridArea" data-expected-width="30" data-expected-height="10">XXX</div>
</div>
</div>
<div class="unconstrainedContainer">
<div class="grid fixedSize">
<div class="firstRowFirstColumn sizedToGridArea" data-expected-width="80" data-expected-height="160">XX</div>
<div class="firstRowSecondColumn sizedToGridArea" data-expected-width="200" data-expected-height="160">XXXXX</div>
<div class="firstRowThirdColumn sizedToGridArea" data-expected-width="120" data-expected-height="160">XXX</div>
</div>
</div>
<div class="indefiniteSize">
<div class="grid fixedSize">
<div class="firstRowFirstColumn sizedToGridArea" data-expected-width="80" data-expected-height="160">XX</div>
<div class="firstRowSecondColumn sizedToGridArea" data-expected-width="200" data-expected-height="160">XXXXX</div>
<div class="firstRowThirdColumn sizedToGridArea" data-expected-width="120" data-expected-height="160">XXX</div>
</div>
</div>
<div class="indefiniteSize">
<div class="grid calculatedSize">
<div class="firstRowFirstColumn sizedToGridArea" data-expected-width="20" data-expected-height="10">XX</div>
<div class="firstRowSecondColumn sizedToGridArea" data-expected-width="50" data-expected-height="10">XXXXX</div>
<div class="firstRowThirdColumn sizedToGridArea" data-expected-width="30" data-expected-height="10">XXX</div>
</div>
</div>
<div class="unconstrainedContainer">
<div class="grid calculatedSize">
<div class="firstRowFirstColumn sizedToGridArea" data-expected-width="80" data-expected-height="160">XX</div>
<div class="firstRowSecondColumn sizedToGridArea" data-expected-width="200" data-expected-height="160">XXXXX</div>
<div class="firstRowThirdColumn sizedToGridArea" data-expected-width="120" data-expected-height="160">XXX</div>
</div>
</div>
<div class="indefiniteSize">
<div class="grid percentageSize">
<div class="firstRowFirstColumn sizedToGridArea" data-expected-width="20" data-expected-height="10">XX</div>
<div class="firstRowSecondColumn sizedToGridArea" data-expected-width="50" data-expected-height="10">XXXXX</div>
<div class="firstRowThirdColumn sizedToGridArea" data-expected-width="30" data-expected-height="10">XXX</div>
</div>
</div>
<div class="unconstrainedContainer">
<div class="grid percentageSize">
<div class="firstRowFirstColumn sizedToGridArea" data-expected-width="100" data-expected-height="200">XX</div>
<div class="firstRowSecondColumn sizedToGridArea" data-expected-width="250" data-expected-height="200">XXXXX</div>
<div class="firstRowThirdColumn sizedToGridArea" data-expected-width="150" data-expected-height="200">XXX</div>
</div>
</div>
<div class="indefiniteSize">
<div class="grid indefiniteSize">
<div class="firstRowFirstColumn sizedToGridArea" data-expected-width="20" data-expected-height="10">XX</div>
<div class="firstRowSecondColumn sizedToGridArea" data-expected-width="50" data-expected-height="10">XXXXX</div>
<div class="firstRowThirdColumn sizedToGridArea" data-expected-width="30" data-expected-height="10">XXX</div>
</div>
</div>
<div class="unconstrainedContainer">
<div class="grid indefiniteSize">
<div class="firstRowFirstColumn sizedToGridArea" data-expected-width="20" data-expected-height="10">XX</div>
<div class="firstRowSecondColumn sizedToGridArea" data-expected-width="50" data-expected-height="10">XXXXX</div>
<div class="firstRowThirdColumn sizedToGridArea" data-expected-width="30" data-expected-height="10">XXX</div>
</div>
</div>
<div class="indefiniteSize">
<div class="grid legacyIntrinsicSize">
<div class="firstRowFirstColumn sizedToGridArea" data-expected-width="20" data-expected-height="10">XX</div>
<div class="firstRowSecondColumn sizedToGridArea" data-expected-width="50" data-expected-height="10">XXXXX</div>
<div class="firstRowThirdColumn sizedToGridArea" data-expected-width="30" data-expected-height="10">XXX</div>
</div>
</div>
<div class="unconstrainedContainer">
<div class="grid legacyIntrinsicSize">
<div class="firstRowFirstColumn sizedToGridArea" data-expected-width="20" data-expected-height="10">XX</div>
<div class="firstRowSecondColumn sizedToGridArea" data-expected-width="50" data-expected-height="10">XXXXX</div>
<div class="firstRowThirdColumn sizedToGridArea" data-expected-width="30" data-expected-height="10">XXX</div>
</div>
</div>
</body>
</html>