<!DOCTYPE html>
<html>
<script src="../../resources/check-layout.js"></script>
<link href="resources/grid.css" rel="stylesheet">
<style>
.grid {
padding: 20px 30px 40px 50px;
grid-template-rows: 100px 100px;
grid-template-columns: 100px 100px;
width: 200px;
}
.item {
width: 20px;
height: 40px;
}
</style>
</head>
<body onload="checkLayout('.grid')">
<div>This test checks that the grid items are shifted by the grid container's paddings before and start.</div>
<div style="position: relative">
<div class="grid" data-expected-width="280" data-expected-height="260">
<div class="item firstRowFirstColumn" data-offset-x="50" data-offset-y="20" data-expected-width="20" data-expected-height="40"></div>
<div class="item firstRowSecondColumn" data-offset-x="150" data-offset-y="20" data-expected-width="20" data-expected-height="40"></div>
<div class="item secondRowFirstColumn" data-offset-x="50" data-offset-y="120" data-expected-width="20" data-expected-height="40"></div>
<div class="item secondRowSecondColumn" data-offset-x="150" data-offset-y="120" data-expected-width="20" data-expected-height="40"></div>
</div>
</div>
<div style="position: relative">
<div class="grid verticalRL" data-expected-width="280" data-expected-height="260">
<div class="item firstRowFirstColumn" data-offset-x="230" data-offset-y="20" data-expected-width="20" data-expected-height="40"></div>
<div class="item firstRowSecondColumn" data-offset-x="230" data-offset-y="120" data-expected-width="20" data-expected-height="40"></div>
<div class="item secondRowFirstColumn" data-offset-x="130" data-offset-y="20" data-expected-width="20" data-expected-height="40"></div>
<div class="item secondRowSecondColumn" data-offset-x="130" data-offset-y="120" data-expected-width="20" data-expected-height="40"></div>
</div>
</div>
<div style="position: relative">
<div class="grid verticalLR" data-expected-width="280" data-expected-height="260">
<div class="item firstRowFirstColumn" data-offset-x="50" data-offset-y="20" data-expected-width="20" data-expected-height="40"></div>
<div class="item firstRowSecondColumn" data-offset-x="50" data-offset-y="120" data-expected-width="20" data-expected-height="40"></div>
<div class="item secondRowFirstColumn" data-offset-x="150" data-offset-y="20" data-expected-width="20" data-expected-height="40"></div>
<div class="item secondRowSecondColumn" data-offset-x="150" data-offset-y="120" data-expected-width="20" data-expected-height="40"></div>
</div>
</div>
<!-- rtl direciton -->
<div style="position: relative">
<div class="grid directionRTL" data-expected-width="280" data-expected-height="260">
<div class="item firstRowFirstColumn" data-offset-x="230" data-offset-y="20" data-expected-width="20" data-expected-height="40"></div>
<div class="item firstRowSecondColumn" data-offset-x="130" data-offset-y="20" data-expected-width="20" data-expected-height="40"></div>
<div class="item secondRowFirstColumn" data-offset-x="230" data-offset-y="120" data-expected-width="20" data-expected-height="40"></div>
<div class="item secondRowSecondColumn" data-offset-x="130" data-offset-y="120" data-expected-width="20" data-expected-height="40"></div>
</div>
</div>
<div style="position: relative">
<div class="grid verticalRL directionRTL" data-expected-width="280" data-expected-height="260">
<div class="item firstRowFirstColumn" data-offset-x="230" data-offset-y="180" data-expected-width="20" data-expected-height="40"></div>
<div class="item firstRowSecondColumn" data-offset-x="230" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div>
<div class="item secondRowFirstColumn" data-offset-x="130" data-offset-y="180" data-expected-width="20" data-expected-height="40"></div>
<div class="item secondRowSecondColumn" data-offset-x="130" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div>
</div>
</div>
<div style="position: relative">
<div class="grid verticalLR directionRTL" data-expected-width="280" data-expected-height="260">
<div class="item firstRowFirstColumn" data-offset-x="50" data-offset-y="180" data-expected-width="20" data-expected-height="40"></div>
<div class="item firstRowSecondColumn" data-offset-x="50" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div>
<div class="item secondRowFirstColumn" data-offset-x="150" data-offset-y="180" data-expected-width="20" data-expected-height="40"></div>
<div class="item secondRowSecondColumn" data-offset-x="150" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div>
</div>
</div>
</body>
</html>