blob: 285c3245241a2f5c63498fe7d52d97920a7f8c09 [file] [log] [blame]
<!DOCTYPE html>
<html>
<script>
if (window.testRunner)
testRunner.overridePreference("WebKitCSSGridLayoutEnabled", 1);
</script>
<link href="resources/grid.css" rel="stylesheet">
<style>
.gridMaxMaxContent {
grid-columns: 50px;
grid-rows: minmax(10px, -webkit-max-content) minmax(10px, 1fr);
}
.gridMinMinContent {
grid-columns: 50px;
grid-rows: minmax(10px, 1fr) minmax(-webkit-min-content, 50px);
}
.gridWithIntrinsicSizeBiggerThanFlex {
grid-columns: 50px;
grid-rows: minmax(-webkit-min-content, 0.5fr) minmax(18px, 2fr);
}
.gridShrinkBelowItemsIntrinsicSize {
grid-columns: 50px;
grid-rows: minmax(0px, 1fr) minmax(0px, 2fr);
}
.gridWithNonFlexingItems {
grid-columns: 50px;
grid-rows: 40px minmax(-webkit-min-content, 1fr) auto minmax(20px, 2fr);
}
.thirdRowFirstColumn {
grid-column: 1;
grid-row: 3;
}
.fourthRowFirstColumn {
grid-column: 1;
grid-row: 4;
}
</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 class="constrainedContainer">
<div class="grid gridMaxMaxContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="10">XXXXX</div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="10"></div>
</div>
</div>
<!-- Allow the extra logical space distribution to occur. -->
<div style="width: 10px; height: 40px">
<div class="grid gridMaxMaxContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="10">XXXXX</div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="30"></div>
</div>
</div>
<div style="width: 10px; height: 110px;">
<div class="grid gridMaxMaxContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="10">XXXXX</div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="100"></div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMinMinContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="10">XXXXX XXXX</div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="20">XXXXX XXXX</div>
</div>
</div>
<!-- Allow the extra logical space distribution to occur. -->
<div style="width: 10px; height: 40px">
<div class="grid gridMinMinContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="10">XXXXX XXXX</div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="30">XXXXX XXXX</div>
</div>
</div>
<div style="width: 10px; height: 110px;">
<div class="grid gridMinMinContent">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="60">XXXXX XXXX</div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="50">XXXXX XXXX</div>
</div>
</div>
<div style="width: 10px; height: 60px;">
<div class="grid gridWithIntrinsicSizeBiggerThanFlex">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="40">XXXXX XXXXX XXXXX XXXXX</div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="20"></div>
</div>
</div>
<div style="width: 10px; height: 60px;">
<div class="grid gridShrinkBelowItemsIntrinsicSize">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="20">XXXXX XXXXX XXXXX XXXXX XXXXX</div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="40">XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX</div>
</div>
</div>
<!-- No space available for the <flex> -->
<div style="width: 10px; height: 100px;">
<div class="grid gridWithNonFlexingItems">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="40"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="40">XXXXX XXXXX XXXXX XXXXX</div>
<div class="sizedToGridArea thirdRowFirstColumn" data-expected-width="50" data-expected-height="60">XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX</div>
<div class="sizedToGridArea fourthRowFirstColumn" data-expected-width="50" data-expected-height="20"></div>
</div>
</div>
<!-- The second track should be sized after the min-content as the <flex> value should be too small. -->
<div style="width: 10px; height: 180px;">
<div class="grid gridWithNonFlexingItems">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="40"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="40">XXXXX XXXXX XXXXX XXXXX</div>
<div class="sizedToGridArea thirdRowFirstColumn" data-expected-width="50" data-expected-height="60">XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX</div>
<div class="sizedToGridArea fourthRowFirstColumn" data-expected-width="50" data-expected-height="40"></div>
</div>
</div>
<div style="width: 10px; height: 400px;">
<div class="grid gridWithNonFlexingItems">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="40"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="100">XXXXX XXXXX XXXXX XXXXX</div>
<div class="sizedToGridArea thirdRowFirstColumn" data-expected-width="50" data-expected-height="60">XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX</div>
<div class="sizedToGridArea fourthRowFirstColumn" data-expected-width="50" data-expected-height="200"></div>
</div>
</div>
</body>
</html>