summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-order-auto-flow-resolution.html
blob: 46a203c70c1802502e8889f62aabbff534137830 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!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>