blob: 319fae44d03dcd03b539127de5ee1035dd644a1b [file] [log] [blame]
<!DOCTYPE html>
<html>
<script>
if (window.testRunner)
testRunner.overridePreference("WebKitCSSGridLayoutEnabled", 1);
</script>
<link href="resources/grid.css" rel="stylesheet">
<style>
.grid {
width: 100px;
height: 200px;
}
#grid1 {
grid-columns: minmax(20px, 80px) 60px;
grid-rows: 30px;
}
#grid2 {
/* First minmax more constraining than available logical width. */
grid-columns: minmax(50%, 60px) minmax(10px, 40%);
grid-rows: 30px;
}
#grid3 {
/* Overlapping range. */
grid-columns: minmax(10px, 80px) minmax(20px, 50px);
grid-rows: 30px;
}
#grid4 {
grid-columns: minmax(20px, 80px) 160px;
grid-rows: 30px;
-webkit-writing-mode: vertical-rl;
}
#grid5 {
/* 50% > 80px, 80px should be ignored. */
grid-columns: minmax(50%, 80px) minmax(10px, 60%);
grid-rows: 30px;
-webkit-writing-mode: vertical-lr;
}
#grid6 {
/* Overlapping range. */
grid-columns: minmax(10px, 180px) minmax(30px, 150px);
grid-rows: 30px;
-webkit-writing-mode: horizontal-bt;
}
.firstRowFirstColumn {
width: 100%;
height: 100%;
}
.firstRowSecondColumn {
width: 100%;
height: 100%;
}
</style>
<script src="../../resources/check-layout.js"></script>
<body onload="checkLayout('.grid')">
<p><a href="https://webkit.org/b/104700">Bug 104700<a>: [CSS Grid Layout] Implement grid items sizing for fixed minmax grid tracks</p>
<p>Checks that a grid element with fixed minmax properly compute the logical width in several writing-mode.</p>
<div class="grid" id="grid1" data-expected-width="100" data-expected-height="200">
<div class="firstRowFirstColumn" data-expected-height="30" data-expected-width="40"></div>
<div class="firstRowSecondColumn" data-expected-height="30" data-expected-width="60"></div>
</div>
<div class="grid" id="grid2" data-expected-width="100" data-expected-height="200">
<div class="firstRowFirstColumn" data-expected-height="30" data-expected-width="60"></div>
<div class="firstRowSecondColumn" data-expected-height="30" data-expected-width="40"></div>
</div>
<div class="grid" id="grid3" data-expected-width="100" data-expected-height="200">
<div class="firstRowFirstColumn" data-expected-height="30" data-expected-width="50"></div>
<div class="firstRowSecondColumn" data-expected-height="30" data-expected-width="50"></div>
</div>
<div class="grid" id="grid4" data-expected-width="100" data-expected-height="200">
<div class="firstRowFirstColumn" data-expected-height="40" data-expected-width="30"></div>
<div class="firstRowSecondColumn" data-expected-height="160" data-expected-width="30"></div>
</div>
<div class="grid" id="grid5" data-expected-width="100" data-expected-height="200">
<div class="firstRowFirstColumn" data-expected-height="100" data-expected-width="30"></div>
<div class="firstRowSecondColumn" data-expected-height="100" data-expected-width="30"></div>
</div>
<div class="grid" id="grid6" data-expected-width="100" data-expected-height="200">
<div class="firstRowFirstColumn" data-expected-height="30" data-expected-width="40"></div>
<div class="firstRowSecondColumn" data-expected-height="30" data-expected-width="60"></div>
</div>
</body>
</html>