<!DOCTYPE html>
<html>
<link href="resources/grid.css" rel="stylesheet">
<style>
.grid {
grid-template-columns: 50px 100px;
grid-template-rows: 50px 100px;
}
.negativeOrder {
order: -1;
}
.positiveOrder {
order: 10;
}
</style>
</head>
<script src="../../resources/check-layout.js"></script>
<body onload="checkLayout('.grid')">
<p>This test checks that the auto-placement algorithm takes 'order' into account when placing grid items.</p>
<!-- Step 1, grid item with a major-axis position that is not 'auto'. -->
<div style="position: relative">
<div class="grid gridAutoFlowRowDense">
<div class="sizedToGridArea firstRowAutoColumn" data-offset-x="50" data-offset-y="0" data-expected-width="100" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowAutoColumn negativeOrder" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50"></div>
</div>
</div>
<div style="position: relative">
<div class="grid gridAutoFlowRowDense">
<div class="sizedToGridArea firstRowAutoColumn positiveOrder" data-offset-x="50" data-offset-y="0" data-expected-width="100" data-expected-height="50"></div>
<div class="sizedToGridArea firstRowAutoColumn" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50"></div>
</div>
</div>
<!-- Step 4.1, grid items with a minor-axis position that is not 'auto'. -->
<div style="position: relative">
<div class="grid gridAutoFlowColumnDense">
<div class="sizedToGridArea secondRowAutoColumn" data-offset-x="50" data-offset-y="50" data-expected-width="100" data-expected-height="100"></div>
<div class="sizedToGridArea secondRowAutoColumn negativeOrder" data-offset-x="0" data-offset-y="50" data-expected-width="50" data-expected-height="100"></div>
</div>
</div>
<div style="position: relative">
<div class="grid gridAutoFlowColumnDense">
<div class="sizedToGridArea secondRowAutoColumn positiveOrder" data-offset-x="50" data-offset-y="50" data-expected-width="100" data-expected-height="100"></div>
<div class="sizedToGridArea secondRowAutoColumn" data-offset-x="0" data-offset-y="50" data-expected-width="50" data-expected-height="100"></div>
</div>
</div>
<!-- Step 4.2, both minor and major-axis position are 'auto'. -->
<div style="position: relative">
<div class="grid gridAutoFlowColumnDense">
<div class="sizedToGridArea" data-offset-x="0" data-offset-y="50" data-expected-width="50" data-expected-height="100"></div>
<div class="sizedToGridArea negativeOrder" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50"></div>
</div>
</div>
<div style="position: relative">
<div class="grid gridAutoFlowColumnDense">
<div class="sizedToGridArea positiveOrder" data-offset-x="0" data-offset-y="50" data-expected-width="50" data-expected-height="100"></div>
<div class="sizedToGridArea" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50"></div>
</div>
</div>
</body>
</html>