blob: 6c995102d06b70453092edcb87c85fca22296bff [file] [log] [blame]
<!DOCTYPE html>
<html>
<script>
if (window.testRunner)
testRunner.overridePreference("WebKitCSSGridLayoutEnabled", 1);
</script>
<link href="resources/grid.css" rel="stylesheet">
<style>
.gridMinMaxContent {
grid-columns: 20px;
grid-rows: minmax(-webkit-max-content, 50px);
}
.gridMaxMaxContent {
grid-columns: 20px;
grid-rows: minmax(30px, -webkit-max-content);
}
.firstRowFirstColumn {
font: 10px/1 Ahem;
/* Make us fit our grid area. */
width: 100%;
height: 100%;
}
.verticalRL {
-webkit-writing-mode: vertical-rl;
}
</style>
<script src="../../resources/check-layout.js"></script>
<body onload="checkLayout('.gridMinMaxContent'); checkLayout('.gridMaxMaxContent')">
<p>Test that resolving minmax function with max-content on grid items works properly.</p>
<div class="constrainedContainer">
<div class="grid gridMinMaxContent">
<div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="30">XX XX XX</div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMinMaxContent">
<div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="50">XX XX XX XX XX</div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMinMaxContent">
<!-- 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="20" data-expected-height="80">XX XX XX XX XX XX XX XX</div>
</div>
</div>
<!-- Allow the extra logical space distribution to occur. -->
<div style="width: 10px; height: 100px;">
<div class="grid gridMinMaxContent">
<div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="50">XX XX XX</div>
</div>
</div>
<div style="width: 10px; height: 100px;">
<div class="grid gridMinMaxContent">
<!-- 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="20" data-expected-height="80">XX XX XX XX XX XX XX XX</div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMaxMaxContent">
<div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="30">XX</div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMaxMaxContent">
<div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="30">XX XX XX</div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMaxMaxContent">
<div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="30">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 gridMaxMaxContent">
<div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="30">XX XX XX</div>
</div>
</div>
<div style="width: 100px; height: 20px">
<div class="grid gridMaxMaxContent">
<!-- 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="20" data-expected-height="30">XX XX XX XX XX</div>
</div>
</div>
</body>
</html>