blob: 81ff63ef47980d1e2d84ece4716e75345eaa5dc6 [file] [log] [blame]
<!DOCTYPE html>
<html>
<script>
if (window.testRunner)
testRunner.overridePreference("WebKitCSSGridLayoutEnabled", 1);
</script>
<link href="resources/grid.css" rel="stylesheet">
<style>
.gridAutoAutoContent {
grid-columns: auto auto;
grid-rows: 50px 100px;
}
.gridFixedAutoContent {
grid-columns: 10px auto;
grid-rows: 50px 100px;
}
.gridMinMaxMin {
grid-columns: minmax(-webkit-min-content, 50px) minmax(-webkit-max-content, 140px);
grid-rows: 50px 100px;
}
.gridMinMaxMax {
grid-columns: minmax(50px, -webkit-min-content) minmax(40px, -webkit-max-content);
grid-rows: 50px 100px;
}
</style>
<script src="../../resources/check-layout.js"></script>
<body onload="checkLayout('.grid');">
<p>Test that resolving spanning minmax tracks on grid items works properly.</p>
<div class="constrainedContainer">
<div class="grid gridAutoAutoContent">
<div class="sizedToGridArea firstRowBothColumn" data-expected-width="30" data-expected-height="50">XXX XXX XXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="15" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="15" data-expected-height="50"></div>
</div>
</div>
<!-- Allow the extra logical space distribution to occur. -->
<div style="width: 40px; height: 10px">
<div class="grid gridAutoAutoContent">
<div class="sizedToGridArea firstRowBothColumn" data-expected-width="40" data-expected-height="50">XX XX XX XX XX XX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="20" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="20" data-expected-height="50"></div>
</div>
</div>
<div style="width: 100px; height: 10px;">
<div class="grid gridAutoAutoContent">
<div class="sizedToGridArea firstRowBothColumn" data-expected-width="50" data-expected-height="50">XXXXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="25" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="25" data-expected-height="50"></div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridFixedAutoContent">
<div class="sizedToGridArea firstRowBothColumn" data-expected-width="30" data-expected-height="50">XXX XXX XXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="10" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="20" data-expected-height="50"></div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridFixedAutoContent">
<div class="sizedToGridArea bothRowBothColumn" data-expected-width="30" data-expected-height="150">XXX XXX XXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="10" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="20" data-expected-height="50"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="10" data-expected-height="100"></div>
<div class="sizedToGridArea secondRowSecondColumn" data-expected-width="20" data-expected-height="100"></div>
</div>
</div>
<!-- Allow the extra logical space distribution to occur. -->
<div style="width: 40px; height: 10px">
<div class="grid gridFixedAutoContent">
<div class="sizedToGridArea firstRowBothColumn" data-expected-width="40" data-expected-height="50">XX XX XX XX XX XX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="10" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="30" data-expected-height="50"></div>
</div>
</div>
<div style="width: 100px; height: 10px;">
<div class="grid gridFixedAutoContent">
<div class="sizedToGridArea firstRowBothColumn" data-expected-width="50" data-expected-height="50">XXXXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="10" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="40" data-expected-height="50"></div>
</div>
</div>
<div style="width: 100px; height: 100px">
<div class="grid gridFixedAutoContent">
<div class="sizedToGridArea bothRowBothColumn" data-expected-width="50" data-expected-height="150">XXXXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="10" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="40" data-expected-height="50"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="10" data-expected-height="100"></div>
<div class="sizedToGridArea secondRowSecondColumn" data-expected-width="40" data-expected-height="100"></div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMinMaxMin">
<div class="sizedToGridArea firstRowBothColumn" data-expected-width="110" data-expected-height="50">XXX XXX XXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="15" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="95" data-expected-height="50"></div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMinMaxMin">
<div class="sizedToGridArea bothRowBothColumn" data-expected-width="110" data-expected-height="150">XXX XXX XXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="15" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="95" data-expected-height="50"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="15" data-expected-height="100"></div>
<div class="sizedToGridArea secondRowSecondColumn" data-expected-width="95" data-expected-height="100"></div>
</div>
</div>
<!-- Allow the extra logical space distribution to occur. -->
<div style="width: 100px; height: 10px">
<div class="grid gridMinMaxMin">
<div class="sizedToGridArea firstRowBothColumn" data-expected-width="100" data-expected-height="50">XX XX XX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="20" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="80" data-expected-height="50"></div>
</div>
</div>
<div style="width: 100px; height: 10px">
<div class="grid gridMinMaxMin">
<div class="sizedToGridArea bothRowBothColumn" data-expected-width="100" data-expected-height="150">XX XX XX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="20" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="80" data-expected-height="50"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="20" data-expected-height="100"></div>
<div class="sizedToGridArea secondRowSecondColumn" data-expected-width="80" data-expected-height="100"></div>
</div>
</div>
<div class="unconstrainedContainer">
<div class="grid gridMinMaxMin">
<div class="sizedToGridArea firstRowBothColumn" data-expected-width="195" data-expected-height="50">XXXXX XXXXX XXXXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="145" data-expected-height="50"></div>
</div>
</div>
<div class="unconstrainedContainer">
<div class="grid gridMinMaxMin">
<div class="sizedToGridArea bothRowBothColumn" data-expected-width="195" data-expected-height="150">XXXXX XXXXX XXXXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="145" data-expected-height="50"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="100"></div>
<div class="sizedToGridArea secondRowSecondColumn" data-expected-width="145" data-expected-height="100"></div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMinMaxMax">
<div class="sizedToGridArea firstRowBothColumn" data-expected-width="90" data-expected-height="50">XXX XXX XXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="40" data-expected-height="50"></div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMinMaxMax">
<div class="sizedToGridArea bothRowBothColumn" data-expected-width="90" data-expected-height="150">XXXXX XXXXX XXXXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="40" data-expected-height="50"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="100"></div>
<div class="sizedToGridArea secondRowSecondColumn" data-expected-width="40" data-expected-height="100"></div>
</div>
</div>
<!-- Allow the extra logical space distribution to occur. -->
<div style="width: 105px; height: 10px">
<div class="grid gridMinMaxMax">
<div class="sizedToGridArea firstRowBothColumn" data-expected-width="105" data-expected-height="50">XXX XXX XXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="55" data-expected-height="50"></div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMinMaxMax">
<div class="sizedToGridArea bothRowBothColumn" data-expected-width="90" data-expected-height="150">XXXXX XXXXX XXXXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="40" data-expected-height="50"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="100"></div>
<div class="sizedToGridArea secondRowSecondColumn" data-expected-width="40" data-expected-height="100"></div>
</div>
</div>
<div class="unconstrainedContainer">
<div class="grid gridMinMaxMax">
<div class="sizedToGridArea firstRowBothColumn" data-expected-width="110" data-expected-height="50">XXX XXX XXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="60" data-expected-height="50"></div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMinMaxMax">
<div class="sizedToGridArea bothRowBothColumn" data-expected-width="90" data-expected-height="150">XXXXX XXXXX XXXXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="40" data-expected-height="50"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="100"></div>
<div class="sizedToGridArea secondRowSecondColumn" data-expected-width="40" data-expected-height="100"></div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMinMaxMax">
<div class="sizedToGridArea firstRowBothColumn" data-expected-width="90" data-expected-height="50">XXXXXXXXXXXX XXXXXXXXXXXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="40" data-expected-height="50"></div>
</div>
</div>
<div class="constrainedContainer">
<div class="grid gridMinMaxMax">
<div class="sizedToGridArea bothRowBothColumn" data-expected-width="90" data-expected-height="150">XXXXXXXXXXXX XXXXXXXXXXXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="50" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="40" data-expected-height="50"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="50" data-expected-height="100"></div>
<div class="sizedToGridArea secondRowSecondColumn" data-expected-width="40" data-expected-height="100"></div>
</div>
</div>
<!-- Allow the extra logical space distribution to occur. -->
<div style="width: 140px; height: 10px">
<div class="grid gridMinMaxMax">
<div class="sizedToGridArea firstRowBothColumn" data-expected-width="140" data-expected-height="50">XXXXXXXXXXXX XXXXXXXXXXXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="65" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="75" data-expected-height="50"></div>
</div>
</div>
<div style="width: 140px; height: 10px">
<div class="grid gridMinMaxMax">
<div class="sizedToGridArea bothRowBothColumn" data-expected-width="140" data-expected-height="150">XXXXXXXXXXXX XXXXXXXXXXXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="65" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="75" data-expected-height="50"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="65" data-expected-height="100"></div>
<div class="sizedToGridArea secondRowSecondColumn" data-expected-width="75" data-expected-height="100"></div>
</div>
</div>
<div class="unconstrainedContainer">
<div class="grid gridMinMaxMax">
<div class="sizedToGridArea firstRowBothColumn" data-expected-width="250" data-expected-height="50">XXXXXXXXXXXX XXXXXXXXXXXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="65" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="185" data-expected-height="50"></div>
</div>
</div>
<div class="unconstrainedContainer">
<div class="grid gridMinMaxMax">
<div class="sizedToGridArea bothRowBothColumn" data-expected-width="250" data-expected-height="150">XXXXXXXXXXXX XXXXXXXXXXXX</div>
<div class="sizedToGridArea firstRowFirstColumn" data-expected-width="65" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowSecondColumn" data-expected-width="185" data-expected-height="50"></div>
<div class="sizedToGridArea secondRowFirstColumn" data-expected-width="65" data-expected-height="100"></div>
<div class="sizedToGridArea secondRowSecondColumn" data-expected-width="185" data-expected-height="100"></div>
</div>
</div>
</body>
</html>