blob: d69aa7e2b3d4a3196195148c37b38998682a4cb6 [file] [log] [blame]
<!DOCTYPE html>
<link href="resources/grid.css" rel="stylesheet">
<link href="resources/grid-alignment.css" rel="stylesheet">
<link href="../css-intrinsic-dimensions/resources/width-keyword-classes.css" rel="stylesheet">
<script src="../../resources/check-layout.js"></script>
<style>
body {
margin: 0;
}
.container {
position: relative;
}
.grid {
grid-template-columns: 100px 100px;
grid-template-rows: 150px 150px;
font: 10px/1 ahem;
}
.widthAndHeightSet {
width: 20px;
height: 40px;
}
.onlyWidthSet { width: 20px; }
.onlyHeightSet { height: 40px; }
.maxHeight { max-height: 160px; }
.maxWidth { max-width: 90px; }
.minWidth { min-width: 120px; }
.minHeight { min-height: 220px; }
.topAutoMargin { margin-top: auto; }
.bottomAutoMargin { margin-bottom: auto; }
.leftAutoMargin { margin-left: auto; }
.rightAutoMargin { margin-right: auto; }
</style>
<body onload="checkLayout('.grid')">
<div id="log"></div>
<p>This test checks that stretching alignment works as expected with orthogonal flows.</p>
<p>HORIZONTAL vs VERTICAL-RL</p>
<p><b>row1/col1:</b> fixed width and height - <b>row1/col2:</b> fixed width and auto height - <b>row2/col1:</b> auto width and fixed height - <b>row2/col2:</b> auto width and height, but start.</p>
<div class="container">
<div class="grid fit-content" data-expected-width="200" data-expected-height="300">
<div class="verticalRL firstRowFirstColumn selfStretch widthAndHeightSet " data-expected-width="20" data-expected-height="40">XXX</div>
<div class="verticalRL firstRowSecondColumn sefStretch onlyWidthSet " data-expected-width="20" data-expected-height="150">XXX</div>
<div class="verticalRL secondRowFirstColumn selfStretch onlyHeightSet " data-expected-width="100" data-expected-height="40">XXX</div>
<div class="verticalRL secondRowSecondColumn selfSelfStart " data-expected-width="10" data-expected-height="30">XXX</div>
</div>
</div>
<p><b>row1/co1l:</b> bottom auto margin - <b>row1/col2:</b> left auto margin - <b>row2/col1:</b> top auto margin - <b>row2/col2:</b> right auto margin.</p>
<div class="container">
<div class="grid fit-content" data-expected-width="200" data-expected-height="300">
<div class="verticalRL firstRowFirstColumn selfStretch bottomAutoMargin " data-expected-width="100" data-expected-height="30">XXX</div>
<div class="verticalRL firstRowSecondColumn seffStretch leftAutoMargin " data-expected-width="10" data-expected-height="150">XXX</div>
<div class="verticalRL secondRowFirstColumn selffStretch topAutoMargin " data-expected-width="100" data-expected-height="30">XXX</div>
<div class="verticalRL secondRowSecondColumn selffStretch rightAutoMargin " data-expected-width="10" data-expected-height="150">XXX</div>
</div>
</div>
<p>HORIZONTAL vs VERTICAL-LR</p>
<p><b>row1/col1:</b> fixed width and height - <b>row1/col2:</b> fixed width and auto height - <b>row2/col1:</b> auto width and fixed height - <b>row2/col2:</b> auto width and height, but start.</p>
<div class="container">
<div class="grid fit-content" data-expected-width="200" data-expected-height="300">
<div class="verticalLR firstRowFirstColumn selfStretch widthAndHeightSet " data-expected-width="20" data-expected-height="40">XXX</div>
<div class="verticalLR firstRowSecondColumn sefStretch onlyWidthSet " data-expected-width="20" data-expected-height="150">XXX</div>
<div class="verticalLR secondRowFirstColumn selfStretch onlyHeightSet " data-expected-width="100" data-expected-height="40">XXX</div>
<div class="verticalLR secondRowSecondColumn selfSelfStart " data-expected-width="10" data-expected-height="30">XXX</div>
</div>
</div>
<p><b>row1/co1l:</b> bottom auto margin - <b>row1/col2:</b> left auto margin - <b>row2/col1:</b> top auto margin - <b>row2/col2:</b> right auto margin.</p>
<div class="container">
<div class="grid fit-content" data-expected-width="200" data-expected-height="300">
<div class="verticalLR firstRowFirstColumn selfStretch bottomAutoMargin " data-expected-width="100" data-expected-height="30">XXX</div>
<div class="verticalLR firstRowSecondColumn seffStretch leftAutoMargin " data-expected-width="10" data-expected-height="150">XXX</div>
<div class="verticalLR secondRowFirstColumn selffStretch topAutoMargin " data-expected-width="100" data-expected-height="30">XXX</div>
<div class="verticalLR secondRowSecondColumn selffStretch rightAutoMargin " data-expected-width="10" data-expected-height="150">XXX</div>
</div>
</div>
<p>VERTICAL-RL vs HORIZONTAL</p>
<p><b>row1/col1:</b> fixed width and height - <b>row1/col2:</b> fixed width and auto height - <b>row2/col1:</b> auto width and fixed height - <b>row2/col2:</b> auto width and height, but start.</p>
<div class="container">
<div class="grid fit-content verticalRL" data-expected-width="300" data-expected-height="200">
<div class="horizonalTB firstRowFirstColumn selfStretch widthAndHeightSet " data-expected-width="20" data-expected-height="40">XXX</div>
<div class="horizonalTB firstRowSecondColumn sefStretch onlyWidthSet " data-expected-width="20" data-expected-height="100">XXX</div>
<div class="horizonalTB secondRowFirstColumn selfStretch onlyHeightSet " data-expected-width="150" data-expected-height="40">XXX</div>
<div class="horizonalTB secondRowSecondColumn selfSelfStart " data-expected-width="10" data-expected-height="30">XXX</div>
</div>
</div>
<p><b>row1/co1l:</b> bottom auto margin - <b>row1/col2:</b> left auto margin - <b>row2/col1:</b> top auto margin - <b>row2/col2:</b> right auto margin.</p>
<div class="container">
<div class="grid fit-content verticalRL" data-expected-width="300" data-expected-height="200">
<div class="horizonalTB firstRowFirstColumn selfStretch bottomAutoMargin " data-expected-width="150" data-expected-height="30">XXX</div>
<div class="horizonalTB firstRowSecondColumn seffStretch leftAutoMargin " data-expected-width="10" data-expected-height="100">XXX</div>
<div class="horizonalTB secondRowFirstColumn selffStretch topAutoMargin " data-expected-width="150" data-expected-height="30">XXX</div>
<div class="horizonalTB secondRowSecondColumn selffStretch rightAutoMargin " data-expected-width="10" data-expected-height="100">XXX</div>
</div>
</div>
<p>VERTICAL-LR vs HORIZONTAL</p>
<p><b>row1/col1:</b> fixed width and height - <b>row1/col2:</b> fixed width and auto height - <b>row2/col1:</b> auto width and fixed height - <b>row2/col2:</b> auto width and height, but start.</p>
<div class="container">
<div class="grid fit-content verticalLR" data-expected-width="300" data-expected-height="200">
<div class="horizonalTB firstRowFirstColumn selfStretch widthAndHeightSet " data-expected-width="20" data-expected-height="40">XXX</div>
<div class="horizonalTB firstRowSecondColumn sefStretch onlyWidthSet " data-expected-width="20" data-expected-height="100">XXX</div>
<div class="horizonalTB secondRowFirstColumn selfStretch onlyHeightSet " data-expected-width="150" data-expected-height="40">XXX</div>
<div class="horizonalTB secondRowSecondColumn selfSelfStart " data-expected-width="10" data-expected-height="30">XXX</div>
</div>
</div>
<p><b>row1/co1l:</b> bottom auto margin - <b>row1/col2:</b> left auto margin - <b>row2/col1:</b> top auto margin - <b>row2/col2:</b> right auto margin.</p>
<div class="container">
<div class="grid fit-content verticalLR" data-expected-width="300" data-expected-height="200">
<div class="horizonalTB firstRowFirstColumn selfStretch bottomAutoMargin " data-expected-width="150" data-expected-height="30">XXX</div>
<div class="horizonalTB firstRowSecondColumn seffStretch leftAutoMargin " data-expected-width="10" data-expected-height="100">XXX</div>
<div class="horizonalTB secondRowFirstColumn selffStretch topAutoMargin " data-expected-width="150" data-expected-height="30">XXX</div>
<div class="horizonalTB secondRowSecondColumn selffStretch rightAutoMargin " data-expected-width="10" data-expected-height="100">XXX</div>
</div>
</div>
</body>