blob: a03b549a9af3c5732b0740a4f0f2008b972dd7e7 (
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Grid Layout Test: fit-content() tracks don't stretch</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#track-sizing" title="7.2. Explicit Track Sizing: the grid-template-rows and grid-template-columns properties">
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#grid-align" title="10.5. Aligning the Grid: the justify-content and align-content properties">
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#algo-stretch" title="11.8. Stretch auto Tracks">
<meta name="flags" content="ahem dom">
<meta name="assert" content="This test checks that 'fit-content()' tracks behave the same with 'normal', 'stretch' or 'start' values for content distribution properties.">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
.grid {
display: grid;
width: 400px;
height: 200px;
font: 25px/1 Ahem;
}
.constrainedGrid {
width: 20px;
height: 10px;
}
.fitContent200x100 {
grid-template-columns: fit-content(200px);
grid-template-rows: fit-content(100px);
}
.placeContentStretch {
place-content: stretch;
}
.placeContentStart {
place-content: start;
}
</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>
<h1>1) place-content: normal</h1>
<h2>1.2) Unconstrained grid container</h2>
<div class="grid" data-expected-width="400" data-expected-height="200">
<div data-expected-width="400" data-expected-height="200">X</div>
</div>
<div class="grid" data-expected-width="400" data-expected-height="200">
<div data-expected-width="400" data-expected-height="200">XXXX XXX XX X</div>
</div>
<div class="grid fitContent200x100" data-expected-width="400" data-expected-height="200">
<div data-expected-width="25" data-expected-height="25">X</div>
</div>
<div class="grid fitContent200x100" data-expected-width="400" data-expected-height="200">
<div data-expected-width="200" data-expected-height="50">XXXX XXX XX X</div>
</div>
<div class="grid fitContent200x100" data-expected-width="400" data-expected-height="200">
<div data-expected-width="225" data-expected-height="50">XXXXXXXXX X</div>
</div>
<div class="grid fitContent200x100" data-expected-width="400" data-expected-height="200">
<div data-expected-width="50" data-expected-height="125">XX<br>X<br>X<br>X<br>X</div>
</div>
<h2>1.2) Constrained grid container</h2>
<div class="grid constrainedGrid" data-expected-width="20" data-expected-height="10">
<div data-expected-width="25" data-expected-height="25">X</div>
</div>
<div class="grid constrainedGrid" data-expected-width="20" data-expected-height="10">
<div data-expected-width="100" data-expected-height="75">XXXX XXX XX X</div>
</div>
<div class="grid constrainedGrid fitContent200x100" data-expected-width="20" data-expected-height="10">
<div data-expected-width="25" data-expected-height="25">X</div>
</div>
<div class="grid constrainedGrid fitContent200x100" data-expected-width="20" data-expected-height="10">
<div data-expected-width="100" data-expected-height="75">XXXX XXX XX X</div>
</div>
<div class="grid constrainedGrid fitContent200x100" data-expected-width="20" data-expected-height="10">
<div data-expected-width="225" data-expected-height="50">XXXXXXXXX X</div>
</div>
<div class="grid constrainedGrid fitContent200x100" data-expected-width="20" data-expected-height="10">
<div data-expected-width="50" data-expected-height="125">XX<br>X<br>X<br>X<br>X</div>
</div>
<h1>2) place-content: stretch</h1>
<h2>2.2) Unconstrained grid container</h2>
<div class="grid placeContentStretch" data-expected-width="400" data-expected-height="200">
<div data-expected-width="400" data-expected-height="200">X</div>
</div>
<div class="grid placeContentStretch" data-expected-width="400" data-expected-height="200">
<div data-expected-width="400" data-expected-height="200">XXXX XXX XX X</div>
</div>
<div class="grid placeContentStretch fitContent200x100" data-expected-width="400" data-expected-height="200">
<div data-expected-width="25" data-expected-height="25">X</div>
</div>
<div class="grid placeContentStretch fitContent200x100" data-expected-width="400" data-expected-height="200">
<div data-expected-width="200" data-expected-height="50">XXXX XXX XX X</div>
</div>
<div class="grid placeContentStretch fitContent200x100" data-expected-width="400" data-expected-height="200">
<div data-expected-width="225" data-expected-height="50">XXXXXXXXX X</div>
</div>
<div class="grid placeContentStretch fitContent200x100" data-expected-width="400" data-expected-height="200">
<div data-expected-width="50" data-expected-height="125">XX<br>X<br>X<br>X<br>X</div>
</div>
<h2>2.2) Constrained grid container</h2>
<div class="grid placeContentStretch constrainedGrid" data-expected-width="20" data-expected-height="10">
<div data-expected-width="25" data-expected-height="25">X</div>
</div>
<div class="grid placeContentStretch constrainedGrid" data-expected-width="20" data-expected-height="10">
<div data-expected-width="100" data-expected-height="75">XXXX XXX XX X</div>
</div>
<div class="grid placeContentStretch constrainedGrid fitContent200x100" data-expected-width="20" data-expected-height="10">
<div data-expected-width="25" data-expected-height="25">X</div>
</div>
<div class="grid placeContentStretch constrainedGrid fitContent200x100" data-expected-width="20" data-expected-height="10">
<div data-expected-width="100" data-expected-height="75">XXXX XXX XX X</div>
</div>
<div class="grid placeContentStretch constrainedGrid fitContent200x100" data-expected-width="20" data-expected-height="10">
<div data-expected-width="225" data-expected-height="50">XXXXXXXXX X</div>
</div>
<div class="grid placeContentStretch constrainedGrid fitContent200x100" data-expected-width="20" data-expected-height="10">
<div data-expected-width="50" data-expected-height="125">XX<br>X<br>X<br>X<br>X</div>
</div>
<h1>3) place-content: start</h1>
<h2>3.1) Unconstrained grid container</h2>
<div class="grid placeContentStart" data-expected-width="400" data-expected-height="200">
<div data-expected-width="25" data-expected-height="25">X</div>
</div>
<div class="grid placeContentStart" data-expected-width="400" data-expected-height="200">
<div data-expected-width="325" data-expected-height="25">XXXX XXX XX X</div>
</div>
<div class="grid placeContentStart fitContent200x100" data-expected-width="400" data-expected-height="200">
<div data-expected-width="25" data-expected-height="25">X</div>
</div>
<div class="grid placeContentStart fitContent200x100" data-expected-width="400" data-expected-height="200">
<div data-expected-width="200" data-expected-height="50">XXXX XXX XX X</div>
</div>
<div class="grid placeContentStart fitContent200x100" data-expected-width="400" data-expected-height="200">
<div data-expected-width="225" data-expected-height="50">XXXXXXXXX X</div>
</div>
<div class="grid placeContentStart fitContent200x100" data-expected-width="400" data-expected-height="200">
<div data-expected-width="50" data-expected-height="125">XX<br>X<br>X<br>X<br>X</div>
</div>
<h2>3.2) Constrained grid container</h2>
<div class="grid placeContentStart constrainedGrid" data-expected-width="20" data-expected-height="10">
<div data-expected-width="25" data-expected-height="25">X</div>
</div>
<div class="grid placeContentStart constrainedGrid" data-expected-width="20" data-expected-height="10">
<div data-expected-width="100" data-expected-height="75">XXXX XXX XX X</div>
</div>
<div class="grid placeContentStart constrainedGrid fitContent200x100" data-expected-width="20" data-expected-height="10">
<div data-expected-width="25" data-expected-height="25">X</div>
</div>
<div class="grid placeContentStart constrainedGrid fitContent200x100" data-expected-width="20" data-expected-height="10">
<div data-expected-width="100" data-expected-height="75">XXXX XXX XX X</div>
</div>
<div class="grid placeContentStart constrainedGrid fitContent200x100" data-expected-width="20" data-expected-height="10">
<div data-expected-width="225" data-expected-height="50">XXXXXXXXX X</div>
</div>
<div class="grid placeContentStart constrainedGrid fitContent200x100" data-expected-width="20" data-expected-height="10">
<div data-expected-width="50" data-expected-height="125">XX<br>X<br>X<br>X<br>X</div>
</div>
</body>
|