summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-grid/abspos/positioned-grid-items-should-not-take-up-space-001.html
blob: bb3be69cfbc7e88bf75d1c6cc3ab90edd8046e95 (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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Grid Layout Test: Positioned grid items should not take up space</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#abspos" title="9. Absolute Positioning">
<meta name="assert" content="This test checks that positioned items shouldn't take up space or otherwise participate in the layout of the grid.">
<link rel="stylesheet" href="/fonts/ahem.css">
<link href="/css/support/grid.css" rel="stylesheet">
<style>

.grid {
  grid-template-columns: 50px 100px;
  grid-template-rows: 50px 100px;
  width: 150px;
  height: 150px;
  /* Ensures that the grid container is the containing block of the absolutely positioned grid children. */
  position: relative;
  /* Ensures that the grid container is the containing block of the fixed positioned grid children. */
  transform: translate(10px, 20px);
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.offsetLeft100 {
  left: 100px;
}

</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
  setup({ explicit_done: true });
</script>

<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<div id="log"></div>

<p>Absolutely positioned:</p>

<div class="grid">
  <div class="sizedToGridArea absolute autoRowAutoColumn"
    data-offset-x="0" data-offset-y="0" data-expected-width="150" data-expected-height="150">
  </div>
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50">
  </div>
</div>

<div class="grid">
  <div class="sizedToGridArea absolute autoRowAutoColumn offsetLeft100"
    data-offset-x="100" data-offset-y="0" data-expected-width="150" data-expected-height="150">
  </div>
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50">
  </div>
</div>

<div class="grid">
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50">
  </div>
  <div class="sizedToGridArea absolute autoRowAutoColumn"
    data-offset-x="0" data-offset-y="0" data-expected-width="150" data-expected-height="150">
  </div>
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="50" data-offset-y="0" data-expected-width="100" data-expected-height="50">
  </div>
</div>

<div class="grid">
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50">
  </div>
  <div class="sizedToGridArea absolute autoRowAutoColumn offsetLeft100"
    data-offset-x="100" data-offset-y="0" data-expected-width="150" data-expected-height="150">
  </div>
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="50" data-offset-y="0" data-expected-width="100" data-expected-height="50">
  </div>
</div>

<div class="grid">
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50">
  </div>
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="50" data-offset-y="0" data-expected-width="100" data-expected-height="50">
    <div class="sizedToGridArea absolute autoRowAutoColumn"
      data-offset-x="50" data-offset-y="0" data-expected-width="150" data-expected-height="150">
    </div>
  </div>
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="0" data-offset-y="50" data-expected-width="50" data-expected-height="100">
  </div>
</div>

<div class="grid">
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50">
  </div>
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="50" data-offset-y="0" data-expected-width="100" data-expected-height="50">
    <div class="sizedToGridArea absolute autoRowAutoColumn offsetLeft100"
      data-offset-x="100" data-offset-y="0" data-expected-width="150" data-expected-height="150">
    </div>
  </div>
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="0" data-offset-y="50" data-expected-width="50" data-expected-height="100">
  </div>
</div>

<p>Fixed positioned:</p>

<div class="grid">
  <div class="sizedToGridArea fixed autoRowAutoColumn"
    data-offset-x="0" data-offset-y="0" data-expected-width="150" data-expected-height="150">
  </div>
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50">
  </div>
</div>

<div class="grid">
  <div class="sizedToGridArea fixed autoRowAutoColumn offsetLeft100"
    data-offset-x="100" data-offset-y="0" data-expected-width="150" data-expected-height="150">
  </div>
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50">
  </div>
</div>

<div class="grid">
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50">
  </div>
  <div class="sizedToGridArea fixed autoRowAutoColumn"
    data-offset-x="0" data-offset-y="0" data-expected-width="150" data-expected-height="150">
  </div>
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="50" data-offset-y="0" data-expected-width="100" data-expected-height="50">
  </div>
</div>

<div class="grid">
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50">
  </div>
  <div class="sizedToGridArea fixed autoRowAutoColumn offsetLeft100"
    data-offset-x="100" data-offset-y="0" data-expected-width="150" data-expected-height="150">
  </div>
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="50" data-offset-y="0" data-expected-width="100" data-expected-height="50">
  </div>
</div>

<div class="grid">
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50">
  </div>
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="50" data-offset-y="0" data-expected-width="100" data-expected-height="50">
    <div class="sizedToGridArea fixed autoRowAutoColumn"
      data-offset-x="50" data-offset-y="0" data-expected-width="150" data-expected-height="150">
    </div>
  </div>
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="0" data-offset-y="50" data-expected-width="50" data-expected-height="100">
  </div>
</div>

<div class="grid">
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50">
  </div>
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="50" data-offset-y="0" data-expected-width="100" data-expected-height="50">
    <div class="sizedToGridArea fixed autoRowAutoColumn offsetLeft100"
      data-offset-x="100" data-offset-y="0" data-expected-width="150" data-expected-height="150">
    </div>
  </div>
  <div class="sizedToGridArea autoRowAutoColumn"
    data-offset-x="0" data-offset-y="50" data-expected-width="50" data-expected-height="100">
  </div>
</div>

</body>