blob: a3b908f1d2aa73dc6454c7eb11de62f658d516a2 [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-size: 10px;
}
.item {
width: 20px;
height: 50px;
}
</style>
<body onload="checkLayout('.grid')">
<div id="log"></div>
<p>This test checks that grid items alignment works as expected with HORIZONTAL-TB vs VERTICAL-RL orthogonal flows.</p>
<p>Orthogonal flows: HORIZONTAL-TB vs VERTICAL-RL</p>
<p>Direction: LTR vs LTR</p>
<div class="container">
<div class="grid fit-content directionLTR">
<div class="item firstRowFirstColumn verticalRL selfEnd" data-offset-x="80" data-offset-y="100">end</div>
<div class="item firstRowSecondColumn verticalRL selfCenter" data-offset-x="140" data-offset-y="50">center</div>
<div class="item secondRowFirstColumn verticalRL selfLeft" data-offset-x="0" data-offset-y="150">left</div>
<div class="item secondRowSecondColumn verticalRL selfRight" data-offset-x="180" data-offset-y="150">right</div>
</div>
</div>
<br>
<div class="container">
<div class="grid fit-content directionLTR">
<div class="item firstRowFirstColumn verticalRL selfSelfEnd" data-offset-x="0" data-offset-y="100">s-end</div>
<div class="item firstRowSecondColumn verticalRL selfStart" data-offset-x="100" data-offset-y="0">start</div>
<div class="item secondRowFirstColumn verticalRL" data-offset-x="0" data-offset-y="150">default</div>
<div class="item secondRowSecondColumn verticalRL selfSelfStart" data-offset-x="180" data-offset-y="150">s-start</div>
</div>
</div>
<p>Direction: RTL vs LTR</p>
<div class="container">
<div class="grid fit-content directionRTL">
<div class="item firstRowFirstColumn directionLTR verticalRL selfEnd" data-offset-x="100" data-offset-y="100">end</div>
<div class="item firstRowSecondColumn directionLTR verticalRL selfCenter" data-offset-x="40" data-offset-y="50">center</div>
<div class="item secondRowFirstColumn directionLTR verticalRL selfLeft" data-offset-x="100" data-offset-y="150">left</div>
<div class="item secondRowSecondColumn directionLTR verticalRL selfRight" data-offset-x="80" data-offset-y="150">right</div>
</div>
</div>
<br>
<div class="container">
<div class="grid fit-content directionRTL">
<div class="item firstRowFirstColumn directionLTR verticalRL selfSelfEnd" data-offset-x="100" data-offset-y="100">s-end</div>
<div class="item firstRowSecondColumn directionLTR verticalRL selfStart" data-offset-x="80" data-offset-y="0">start</div>
<div class="item secondRowFirstColumn directionLTR verticalRL" data-offset-x="180" data-offset-y="150">default</div>
<div class="item secondRowSecondColumn directionLTR verticalRL selfSelfStart" data-offset-x="80" data-offset-y="150">s-start</div>
</div>
</div>
<p>Direction: LTR vs RTL</p>
<div class="container">
<div class="grid fit-content directionLTR">
<div class="item firstRowFirstColumn directionRTL verticalRL selfEnd" data-offset-x="80" data-offset-y="100">end</div>
<div class="item firstRowSecondColumn directionRTL verticalRL selfCenter" data-offset-x="140" data-offset-y="50">center</div>
<div class="item secondRowFirstColumn directionRTL verticalRL selfLeft" data-offset-x="0" data-offset-y="150">left</div>
<div class="item secondRowSecondColumn directionRTL verticalRL selfRight" data-offset-x="180" data-offset-y="150">right</div>
</div>
</div>
<br>
<div class="container">
<div class="grid fit-content directionLTR">
<div class="item firstRowFirstColumn directionRTL verticalRL selfSelfEnd" data-offset-x="0" data-offset-y="0">s-end</div>
<div class="item firstRowSecondColumn directionRTL verticalRL selfStart" data-offset-x="100" data-offset-y="0">start</div>
<div class="item secondRowFirstColumn directionRTL verticalRL" data-offset-x="0" data-offset-y="150">default</div>
<div class="item secondRowSecondColumn directionRTL verticalRL selfSelfStart" data-offset-x="180" data-offset-y="250">s-start</div>
</div>
</div>
<p>Direction: RTL vs RTL</p>
<div class="container">
<div class="grid fit-content directionRTL">
<div class="item firstRowFirstColumn verticalRL selfEnd" data-offset-x="100" data-offset-y="100">end</div>
<div class="item firstRowSecondColumn verticalRL selfCenter" data-offset-x="40" data-offset-y="50">center</div>
<div class="item secondRowFirstColumn verticalRL selfLeft" data-offset-x="100" data-offset-y="150">left</div>
<div class="item secondRowSecondColumn verticalRL selfRight" data-offset-x="80" data-offset-y="150">right</div>
</div>
</div>
<br>
<div class="container">
<div class="grid fit-content directionRTL">
<div class="item firstRowFirstColumn verticalRL selfSelfEnd" data-offset-x="100" data-offset-y="0">s-end</div>
<div class="item firstRowSecondColumn verticalRL selfStart" data-offset-x="80" data-offset-y="0">start</div>
<div class="item secondRowFirstColumn verticalRL" data-offset-x="180" data-offset-y="150">default</div>
<div class="item secondRowSecondColumn verticalRL selfSelfStart" data-offset-x="80" data-offset-y="250">s-start</div>
</div>
</div>
<!-- HORIZONTAL-TB vs VERTICAL-LR -->
<p>Orthogonal flows: HORIZONTAL-TB vs VERTICAL-LR</p>
<p>Direction: LTR vs LTR</p>
<div class="container">
<div class="grid fit-content drectionLTR">
<div class="item firstRowFirstColumn verticalLR selfEnd" data-offset-x="80" data-offset-y="100">end</div>
<div class="item firstRowSecondColumn verticalLR selfCenter" data-offset-x="140" data-offset-y="50">center</div>
<div class="item secondRowFirstColumn verticalLR selfLeft" data-offset-x="0" data-offset-y="150">left</div>
<div class="item secondRowSecondColumn verticalLR selfRight" data-offset-x="180" data-offset-y="150">right</div>
</div>
</div>
<br>
<div class="container">
<div class="grid fit-content drectionLTR">
<div class="item firstRowFirstColumn verticalLR selfSelfEnd" data-offset-x="80" data-offset-y="100">s-end</div>
<div class="item firstRowSecondColumn verticalLR selfStart" data-offset-x="100" data-offset-y="0">start</div>
<div class="item secondRowFirstColumn verticalLR" data-offset-x="0" data-offset-y="150">default</div>
<div class="item secondRowSecondColumn verticalLR selfSelfStart" data-offset-x="100" data-offset-y="150">s-start</div>
</div>
</div>
<p>Direction: RTL vs LTR</p>
<div class="container">
<div class="grid fit-content directionRTL">
<div class="item firstRowFirstColumn directionLTR verticalLR selfEnd" data-offset-x="100" data-offset-y="100">end</div>
<div class="item firstRowSecondColumn directionLTR verticalLR selfCenter" data-offset-x="40" data-offset-y="50">center</div>
<div class="item secondRowFirstColumn directionLTR verticalLR selfLeft" data-offset-x="100" data-offset-y="150">left</div>
<div class="item secondRowSecondColumn directionLTR verticalLR selfRight" data-offset-x="80" data-offset-y="150">right</div>
</div>
</div>
<br>
<div class="container">
<div class="grid fit-content directionRTL">
<div class="item firstRowFirstColumn directionLTR verticalLR selfSelfEnd" data-offset-x="180" data-offset-y="100">s-end</div>
<div class="item firstRowSecondColumn directionLTR verticalLR selfStart" data-offset-x="80" data-offset-y="0">start</div>
<div class="item secondRowFirstColumn directionLTR verticalLR" data-offset-x="180" data-offset-y="150">default</div>
<div class="item secondRowSecondColumn directionLTR verticalLR selfSelfStart" data-offset-x="0" data-offset-y="150">s-start</div>
</div>
</div>
<p>Direction: RTL vs RTL</p>
<div class="container">
<div class="grid fit-content directionRTL">
<div class="item firstRowFirstColumn verticalLR selfEnd" data-offset-x="100" data-offset-y="100">end</div>
<div class="item firstRowSecondColumn verticalLR selfCenter" data-offset-x="40" data-offset-y="50">center</div>
<div class="item secondRowFirstColumn verticalLR selfLeft" data-offset-x="100" data-offset-y="150">left</div>
<div class="item secondRowSecondColumn verticalLR selfRight" data-offset-x="80" data-offset-y="150">right</div>
</div>
</div>
<br>
<div class="container">
<div class="grid fit-content directionRTL">
<div class="item firstRowFirstColumn verticalLR selfSelfEnd" data-offset-x="180" data-offset-y="0">s-end</div>
<div class="item firstRowSecondColumn verticalLR selfStart" data-offset-x="80" data-offset-y="0">start</div>
<div class="item secondRowFirstColumn verticalLR" data-offset-x="180" data-offset-y="150">default</div>
<div class="item secondRowSecondColumn verticalLR selfSelfStart" data-offset-x="0" data-offset-y="250">s-start</div>
</div>
</div>
</body>