blob: 5b3b4c08c5952c99d29e2b22cd92c9be45393720 [file] [log] [blame]
<!DOCTYPE html>
<html>
<link href="resources/grid.css" rel="stylesheet">
<style>
.gridFlexContent {
grid-template-columns: 50px;
grid-template-rows: 1fr 1fr;
}
.gridZeroFlexContent {
grid-template-columns: 50px;
grid-template-rows: minmax(auto, 0px);
}
.gridMaxFlexContent {
grid-template-columns: 50px;
grid-template-rows: minmax(30px, 2fr);
}
.gridTwoMaxFlexContent {
grid-template-columns: 50px;
grid-template-rows: minmax(10px, 1fr) minmax(10px, 2fr);
}
.gridTwoDoubleMaxFlexContent {
grid-template-columns: 50px;
grid-template-rows: minmax(10px, 0.5fr) minmax(10px, 2fr);
}
.gridRespectBaseSize {
grid-template-columns: 50px;
grid-template-rows: minmax(75px, 1fr) minmax(0px, 2fr);
}
.gridRespectProportions {
grid-template-columns: 50px;
grid-template-rows: minmax(25px, .25fr) minmax(0px, .5fr) minmax(0px, 2fr);
}
.gridRespectBaseSizeProportions {
grid-template-columns: 50px;
grid-template-rows: minmax(50px, .25fr) minmax(0px, .5fr) minmax(0px, 1fr);
}
.gridRespectBaseSizeBeforeProportions {
grid-template-columns: 50px;
grid-template-rows: minmax(50px, .25fr) minmax(0px, .5fr) minmax(0px, 1fr);
}
.thirdRowFirstColumn {
background-color: yellow;
grid-column: 1;
grid-row: 3;
}
</style>
<script src="../../resources/check-layout.js"></script>
<body onload="checkLayout('.grid');">
<p>Test that resolving auto tracks on grid items works properly.</p>
<div style="height: 0px">
<div class="grid gridFlexContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="0"></div>
</div>
</div>
<div style="height: 0px">
<div class="grid gridFlexContent" style="height: 100%;">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="0"></div>
</div>
</div>
<div style="height: 0px; position: relative;">
<div class="grid gridFlexContent">
<div class="sizedToGridArea firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="30">X<br>X</div>
<div class="sizedToGridArea secondRowFirstColumn" data-offset-x="0" data-offset-y="30" data-expected-width="50" data-expected-height="30">X<br>X<br>X</div>
</div>
</div>
<div style="height: 0px; position: relative;">
<div class="grid gridFlexContent" style="height: 100%;">
<div class="sizedToGridArea firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="20">X<br>X</div>
<div class="sizedToGridArea secondRowFirstColumn" data-offset-x="0" data-offset-y="20" data-expected-width="50" data-expected-height="30">X<br>X<br>X</div>
</div>
</div>
<div style="height: 0px">
<div class="grid gridZeroFlexContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="0"></div>
</div>
</div>
<!-- Allow the extra logical space distribution to occur. -->
<div style="width: 10px; height: 40px">
<div class="grid gridFlexContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="0"></div>
</div>
</div>
<div style="width: 10px; height: 40px">
<div class="grid gridFlexContent" style="height: 100%;">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="20"></div>
</div>
</div>
<div style="width: 10px; height: 40px; position: relative">
<div class="grid gridFlexContent">
<div class="sizedToGridArea firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="40">X<br>X<br>X</div>
<div class="sizedToGridArea secondRowFirstColumn" data-offset-x="0" data-offset-y="40" data-expected-width="50" data-expected-height="40">X<br>X<br>X<br>X</div>
</div>
</div>
<div style="width: 10px; height: 40px; position: relative">
<div class="grid gridFlexContent" style="height: 100%;">
<div class="sizedToGridArea firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="30">X<br>X<br>X</div>
<div class="sizedToGridArea secondRowFirstColumn" data-offset-x="0" data-offset-y="30" data-expected-width="50" data-expected-height="40">X<br>X<br>X<br>X</div>
</div>
</div>
<div style="width: 10px; height: 100px;">
<div class="grid gridFlexContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="0"></div>
</div>
</div>
<div style="width: 10px; height: 100px;">
<div class="grid gridFlexContent" style="height: 100%;">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
</div>
</div>
<div style="width: 10px; height: 100px; position: relative;">
<div class="grid gridFlexContent">
<div class="sizedToGridArea firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="40">X<br>X<br>X</div>
<div class="sizedToGridArea secondRowFirstColumn" data-offset-x="0" data-offset-y="40" data-expected-width="50" data-expected-height="40">X<br>X<br>X<br>X</div>
</div>
</div>
<div style="width: 10px; height: 100px; position: relative;">
<div class="grid gridFlexContent" style="height: 100%;">
<div class="sizedToGridArea firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50">X<br>X<br>X</div>
<div class="sizedToGridArea secondRowFirstColumn" data-offset-x="0" data-offset-y="50" data-expected-width="50" data-expected-height="50">X<br>X<br>X<br>X</div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMaxFlexContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="30"></div>
</div>
</div>
<!-- Allow the extra logical space distribution to occur. -->
<div style="width: 10px; height: 40px">
<div class="grid gridMaxFlexContent" style="height: 100%;">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="40"></div>
</div>
</div>
<div style="width: 10px; height: 40px">
<div class="grid gridMaxFlexContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="30"></div>
</div>
</div>
<div style="width: 10px; height: 100px;">
<div class="grid gridMaxFlexContent" style="height: 100%;">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="100"></div>
</div>
</div>
<div style="width: 10px; height: 100px;">
<div class="grid gridMaxFlexContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="30"></div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridTwoMaxFlexContent" style="height: 100%">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="10"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="10"></div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridTwoMaxFlexContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="10"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="20"></div>
</div>
</div>
<!-- Allow the extra logical space distribution to occur. -->
<div style="width: 10px; height: 60px">
<div class="grid gridTwoMaxFlexContent" style="height: 100%">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="20"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="40"></div>
</div>
</div>
<div style="width: 10px; height: 60px">
<div class="grid gridTwoMaxFlexContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="10"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="20"></div>
</div>
</div>
<div style="width: 10px; height: 120px;">
<div class="grid gridTwoMaxFlexContent" style="height: 100%">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="40"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="80"></div>
</div>
</div>
<div style="width: 10px; height: 120px;">
<div class="grid gridTwoMaxFlexContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="10"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="20"></div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridTwoDoubleMaxFlexContent" style="height: 100%">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="10"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="10"></div>
</div>
</div>
<!-- We normalize fraction flex factors to 1, so we don't keep exact proportions with >1 factors. -->
<div class="constrainedContainer">
<div class="grid gridTwoDoubleMaxFlexContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="10"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="20"></div>
</div>
</div>
<!-- Allow the extra logical space distribution to occur. -->
<div style="width: 10px; height: 60px">
<div class="grid gridTwoDoubleMaxFlexContent" style="height: 100%">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="12"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="48"></div>
</div>
</div>
<!-- We normalize fraction flex factors to 1, so we don't keep exact proportions with >1 factors. -->
<div style="width: 10px; height: 60px">
<div class="grid gridTwoDoubleMaxFlexContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="10"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="20"></div>
</div>
</div>
<div style="width: 10px; height: 120px;">
<div class="grid gridTwoDoubleMaxFlexContent" style="height: 100%">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="24"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="96"></div>
</div>
</div>
<!-- We normalize fraction flex factors to 1, so we don't keep exact proportions with >1 factors. -->
<div style="width: 10px; height: 120px;">
<div class="grid gridTwoDoubleMaxFlexContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="10"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="20"></div>
</div>
</div>
<!-- Flex track lengths must be proportional to their flex factors.. -->
<div style="width: 10px; height: 275px;">
<div class="grid gridRespectProportions" style="height: 100%;">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="25"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
<div class="sizedToGridArea thirdRowFirstColumn" data-expected-width="50" data-expected-height="200"></div>
</div>
</div>
<div style="width: 10px; height: 275px;">
<div class="grid gridRespectProportions">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="25"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="13"></div>
<div class="sizedToGridArea thirdRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
</div>
</div>
<!-- Flex track lengths must be proportional but still respecting their base sizes. -->
<div style="width: 10px; height: 350px;">
<div class="grid gridRespectBaseSizeProportions" style="height: 100%;">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="100"></div>
<div class="sizedToGridArea thirdRowFirstColumn" data-expected-width="50" data-expected-height="200"></div>
</div>
</div>
<div style="width: 10px; height: 350px;">
<div class="grid gridRespectBaseSizeProportions">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="25"></div>
<div class="sizedToGridArea thirdRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
</div>
</div>
<!-- Not enough space to repsect proportions, because minTrackBreadh it's a harder requirement -->
<div style="width: 10px; height: 275px;">
<div class="grid gridRespectBaseSizeBeforeProportions" style="height: 100%;">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="75"></div>
<div class="sizedToGridArea thirdRowFirstColumn" data-expected-width="50" data-expected-height="150"></div>
</div>
</div>
<div style="width: 10px; height: 275px;">
<div class="grid gridRespectBaseSizeBeforeProportions">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="25"></div>
<div class="sizedToGridArea thirdRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
</div>
</div>
</body>
</html>