blob: 6f927e0eb07e93eea27653f95710ec14147aba82 [file] [log] [blame]
<!DOCTYPE html>
<html>
<script>
if (window.testRunner)
testRunner.overridePreference("WebKitCSSGridLayoutEnabled", 1);
</script>
<link href="resources/grid.css" rel="stylesheet">
<style>
.gridMinMinContent {
grid-columns: minmax(-webkit-min-content, 40px);
grid-rows: 50px;
}
.gridMaxMinContent {
grid-columns: minmax(30px, -webkit-min-content);
grid-rows: 20px;
}
.firstRowFirstColumn {
font: 10px/1 Ahem;
/* Make us fit our grid area. */
width: 100%;
height: 100%;
}
</style>
<script src="../../resources/check-layout.js"></script>
<body onload="checkLayout('.gridMinMinContent'); checkLayout('.gridMaxMinContent')">
<p>Test that resolving minmax function with min-content on grid items works properly.</p>
<div class="constrainedContainer">
<div class="grid gridMinMinContent">
<div class="firstRowFirstColumn" data-expected-width="30" data-expected-height="50">XXX XXX XXX</div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMinMinContent">
<!-- The 'max' logical width ends up being smaller than the 'min' so per the spec we ignore the 'max'. -->
<div class="firstRowFirstColumn" data-expected-width="50" data-expected-height="50">XXXXX XXXXX XXXXX XXXXX</div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMinMinContent">
<div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="50">XX XX XX XX XX XX</div>
</div>
</div>
<!-- Allow the extra logical space distribution to occur. -->
<div style="width: 40px; height: 10px">
<div class="grid gridMinMinContent">
<div class="firstRowFirstColumn" data-expected-width="40" data-expected-height="50">XX XX XX XX XX XX</div>
</div>
</div>
<div style="width: 100px; height: 10px;">
<div class="grid gridMinMinContent">
<!-- The 'max' logical width ends up being smaller than the 'min' so per the spec we ignore the 'max'. -->
<div class="firstRowFirstColumn" data-expected-width="50" data-expected-height="50">XXXXX XXXXX XXXXX XXXXX</div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMaxMinContent">
<div class="firstRowFirstColumn" data-expected-width="30" data-expected-height="20">XXX XXX XXX</div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMaxMinContent">
<div class="firstRowFirstColumn" data-expected-width="30" data-expected-height="20">XXXXX XXXXX XXXXX XXXXX</div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMaxMinContent">
<div class="firstRowFirstColumn" data-expected-width="30" data-expected-height="20">XX XX XX XX XX XX</div>
</div>
</div>
<!-- Allow the extra logical space distribution to occur. -->
<div style="width: 100px; height: 20px">
<div class="grid gridMaxMinContent">
<div class="firstRowFirstColumn" data-expected-width="50" data-expected-height="20">XXXXX XXXXX XXXXX XXXXX</div>
</div>
</div>
<div style="width: 100px; height: 20px">
<div class="grid gridMaxMinContent">
<!-- The 'max' logical width ends up being smaller than the 'min' so per the spec we ignore the 'max'. -->
<div class="firstRowFirstColumn" data-expected-width="30" data-expected-height="20">XX XX XX XX XX XX</div>
</div>
</div>
</body>
</html>