blob: c2601d3097e6f7b68b5d27c622adf4afde0221d3 (
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
<!DOCTYPE html>
<link href="resources/grid.css" rel="stylesheet">
<style>
.grid {
grid-template-columns: 100px 200px;
grid-template-rows: 50px 150px;
width: 500px;
height: 300px;
border: 5px solid black;
margin: 30px;
padding: 15px;
/* Ensures that the grid container is the containing block of the absolutely positioned grid children. */
position: relative;
}
.absolute {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: lime;
}
</style>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../resources/check-layout-th.js"></script>
<body onload="checkLayout('.grid')">
<div id="log"></div>
<p>This test checks that positioned grid items can be placed directly on the padding.</p>
<div class="grid">
<div class="absolute" style="grid-column: auto / 1; grid-row: auto / 1;"
data-offset-x="0" data-offset-y="0" data-expected-width="15" data-expected-height="15">
</div>
<div class="absolute" style="grid-column: 1 / 2; grid-row: auto / 1;"
data-offset-x="15" data-offset-y="0" data-expected-width="100" data-expected-height="15">
</div>
<div class="absolute" style="grid-column: auto / 1; grid-row: 1 / 2;"
data-offset-x="0" data-offset-y="15" data-expected-width="15" data-expected-height="50">
</div>
<div class="absolute" style="grid-column: 3 / auto; grid-row: 3 / auto;"
data-offset-x="315" data-offset-y="215" data-expected-width="215" data-expected-height="115">
</div>
<div class="absolute" style="grid-column: 2 / 3; grid-row: 3 / auto;"
data-offset-x="115" data-offset-y="215" data-expected-width="200" data-expected-height="115">
</div>
<div class="absolute" style="grid-column: 3 / auto; grid-row: 2 / 3;"
data-offset-x="315" data-offset-y="65" data-expected-width="215" data-expected-height="150">
</div>
</div>
<div class="grid">
<div class="absolute" style="grid-column: -5 / 1; grid-row: -5 / 1;"
data-offset-x="0" data-offset-y="0" data-expected-width="15" data-expected-height="15">
</div>
<div class="absolute" style="grid-column: 1 / 2; grid-row: -5 / 1;"
data-offset-x="15" data-offset-y="0" data-expected-width="100" data-expected-height="15">
</div>
<div class="absolute" style="grid-column: -5 / 1; grid-row: 1 / 2;"
data-offset-x="0" data-offset-y="15" data-expected-width="15" data-expected-height="50">
</div>
<div class="absolute" style="grid-column: 3 / 5; grid-row: 3 / 5;"
data-offset-x="315" data-offset-y="215" data-expected-width="215" data-expected-height="115">
</div>
<div class="absolute" style="grid-column: 2 / 3; grid-row: 3 / 5;"
data-offset-x="115" data-offset-y="215" data-expected-width="200" data-expected-height="115">
</div>
<div class="absolute" style="grid-column: 3 / 5; grid-row: 2 / 3;"
data-offset-x="315" data-offset-y="65" data-expected-width="215" data-expected-height="150">
</div>
</div>
<div class="grid">
<div class="absolute" style="grid-column: span 2 / 1; grid-row: span 2 / 1;"
data-offset-x="0" data-offset-y="0" data-expected-width="15" data-expected-height="15">
</div>
<div class="absolute" style="grid-column: 1 / 2; grid-row: span 2 / 1;"
data-offset-x="15" data-offset-y="0" data-expected-width="100" data-expected-height="15">
</div>
<div class="absolute" style="grid-column: span 2 / 1; grid-row: 1 / 2;"
data-offset-x="0" data-offset-y="15" data-expected-width="15" data-expected-height="50">
</div>
<div class="absolute" style="grid-column: 3 / span 2; grid-row: 3 / span 2;"
data-offset-x="315" data-offset-y="215" data-expected-width="215" data-expected-height="115">
</div>
<div class="absolute" style="grid-column: 2 / 3; grid-row: 3 / span 2;"
data-offset-x="115" data-offset-y="215" data-expected-width="200" data-expected-height="115">
</div>
<div class="absolute" style="grid-column: 3 / span 2; grid-row: 2 / 3;"
data-offset-x="315" data-offset-y="65" data-expected-width="215" data-expected-height="150">
</div>
</div>
<div class="grid">
<div class="absolute" style="grid-column: foo / 1; grid-row: foo / 1;"
data-offset-x="0" data-offset-y="0" data-expected-width="15" data-expected-height="15">
</div>
<div class="absolute" style="grid-column: 1 / 2; grid-row: foo / 1;"
data-offset-x="15" data-offset-y="0" data-expected-width="100" data-expected-height="15">
</div>
<div class="absolute" style="grid-column: foo / 1; grid-row: 1 / 2;"
data-offset-x="0" data-offset-y="15" data-expected-width="15" data-expected-height="50">
</div>
<div class="absolute" style="grid-column: 3 / foo; grid-row: 3 / foo;"
data-offset-x="315" data-offset-y="215" data-expected-width="215" data-expected-height="115">
</div>
<div class="absolute" style="grid-column: 2 / 3; grid-row: 3 / foo;"
data-offset-x="115" data-offset-y="215" data-expected-width="200" data-expected-height="115">
</div>
<div class="absolute" style="grid-column: 3 / foo; grid-row: 2 / 3;"
data-offset-x="315" data-offset-y="65" data-expected-width="215" data-expected-height="150">
</div>
</div>
</body>
|