summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-002.html
blob: 462daece10b8b3541ef29acf39bc6afc9dfd289d (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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Grid Layout Test: Self-Baseline alignment and sizing cyclic dependency</title>
<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#alignment">
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#column-align">
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#row-align">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-items">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-justify-items">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#baseline-alignment">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#valdef-justify-self-baseline">
<link rel="stylesheet" href="/css/support/grid.css">
<link rel="stylesheet" href="../../support/alignment.css">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
.inline-grid {
  position: relative;
  border: solid;
  text-orientation: sideways;
  font-family: Ahem;
}

.columns { grid-template-columns: 100px 100px; }
.rows { grid-template-rows: 100px 100px; }

.min-content-columns { grid-template-columns: min-content; }
.max-content-columns { grid-template-columns: max-content; }
.fit-content-columns { grid-template-columns: fit-content; }
.flex-columns        { grid-template-columns: 1fr; }
.max-flex-columns    { grid-template-columns: minmax(0px, 1fr); }
.auto-columns        { grid-template-columns: auto 100px; }

.min-content-rows { grid-template-rows: min-content; }
.max-content-rows { grid-template-rows: max-content; }
.fit-content-rows { grid-template-rows: fit-content; }
.flex-rows        { grid-template-rows: 1fr; }
.max-flex-rows    { grid-template-rows: minmax(0px, 1fr); }
.auto-rows        { grid-template-rows: auto 100px; }

.height25  { height: 25px; }
.height50  { height: 50px; }
.height200 { height: 200px; }
.width25   { width: 25px; }
.width50   { width: 50px; }
.width200  { width: 200px; }

.bigFont { font-size: 50px; }
.paddingLeft { padding-left: 25px; }
.paddingBottom { padding-bottom: 25px; }
.paddingRight { padding-right: 25px; }
</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('.inline-grid'); })">

<!-- NOTE: previously this test was asserting some "cyclic" behaviour where an item would switch baseline alignment participation - this is no longer the case per spec. -->
<pre>auto-sized rows - horizonal grid and verticalLR item - column-axis baseline</pre>
<div class="inline-grid alignItemsBaseline columns height200">
  <div class="firstRowFirstColumn bigFont paddingBottom" data-offset-x="0"   data-offset-y="97"   data-expected-width="100" data-expected-height="75">É</div>
  <div class="firstRowSecondColumn verticalLR"           data-offset-x="100" data-offset-y="0"   data-expected-width="100" data-expected-height="137">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="autoRowAutoColumnSpanning2 height25"       data-offset-x="0"   data-offset-y="137" data-expected-width="200" data-expected-height="25"></div>
</div>

<pre>min-content-sized rows - horizonal grid and verticalLR item - column-axis baseline</pre>
<div class="inline-grid alignItemsBaseline columns min-content-rows">
  <div class="firstRowFirstColumn bigFont paddingBottom" data-offset-x="0"   data-offset-y="59"  data-expected-width="100" data-expected-height="75">É</div>
  <div class="firstRowSecondColumn verticalLR"           data-offset-x="100" data-offset-y="0"  data-expected-width="100" data-expected-height="99">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="autoRowAutoColumnSpanning2 height25"       data-offset-x="0"   data-offset-y="99" data-expected-width="200" data-expected-height="25"></div>
</div>

<pre>max-content-sized rows - horizonal grid and verticalLR item - column-axis baseline</pre>
<div class="inline-grid alignItemsBaseline columns max-content-rows">
  <div class="firstRowFirstColumn bigFont paddingBottom" data-offset-x="0"   data-offset-y="59"   data-expected-width="100" data-expected-height="75">É</div>
  <div class="firstRowSecondColumn verticalLR"           data-offset-x="100" data-offset-y="0"   data-expected-width="100" data-expected-height="99">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="autoRowAutoColumnSpanning2 height25"       data-offset-x="0"   data-offset-y="99" data-expected-width="200" data-expected-height="25"></div>
</div>

<pre>fit-content-sized rows - horizonal grid and verticalLR item - column-axis baseline</pre>
<div class="inline-grid alignItemsBaseline columns fit-content-rows">
  <div class="firstRowFirstColumn bigFont paddingBottom" data-offset-x="0"   data-offset-y="59"   data-expected-width="100" data-expected-height="75">É</div>
  <div class="firstRowSecondColumn verticalLR"           data-offset-x="100" data-offset-y="0"   data-expected-width="100" data-expected-height="99">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="autoRowAutoColumnSpanning2 height25"       data-offset-x="0"   data-offset-y="99" data-expected-width="200" data-expected-height="25"></div>
</div>

<pre>flex-sized rows - horizonal grid and verticalLR item - column-axis baseline</pre>
<div class="inline-grid alignItemsBaseline columns flex-rows">
  <div class="firstRowFirstColumn bigFont paddingBottom" data-offset-x="0"   data-offset-y="59"   data-expected-width="100" data-expected-height="75">É</div>
  <div class="firstRowSecondColumn verticalLR"           data-offset-x="100" data-offset-y="0"   data-expected-width="100" data-expected-height="99">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="autoRowAutoColumnSpanning2 height25"       data-offset-x="0"   data-offset-y="99" data-expected-width="200" data-expected-height="25"></div>
</div>

<pre>max-flex-sized rows - horizonal grid and verticalLR item - column-axis baseline<br>baseline is not applied initially, but orthogonal items force repeating the track sizing and height is not indefinite in that phase.</pre>
<!-- https://github.com/w3c/csswg-drafts/issues/3046 -->
<div class="inline-grid alignItemsBaseline columns auto-rows">
  <div class="firstRowFirstColumn bigFont paddingBottom" data-offset-x="0"   data-offset-y="59"   data-expected-width="100" data-expected-height="75">É</div>
  <div class="firstRowSecondColumn verticalLR"           data-offset-x="100" data-offset-y="0"   data-expected-width="100" data-expected-height="99">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="autoRowAutoColumnSpanning2 height25"       data-offset-x="0"   data-offset-y="99" data-expected-width="200" data-expected-height="25"></div>
</div>

<pre>auto-sized columns - horizontal grid item - row-axis baseline</pre>
<div class="inline-grid justifyItemsBaseline rows width200">
  <div class="firstRowFirstColumn bigFont verticalLR paddingLeft" data-offset-x="0"   data-offset-y="0"   data-expected-width="75"  data-expected-height="100">É</div>
  <div class="secondRowFirstColumn"                               data-offset-x="35"   data-offset-y="100" data-expected-width="175" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="firstRowSpanning2AutoColumn width25"                data-offset-x="175" data-offset-y="0"   data-expected-width="25"  data-expected-height="200"></div>
</div>

<pre>min-content-sized columns - horizontal grid item - row-axis baseline</pre>
<div class="inline-grid justifyItemsBaseline rows min-content-columns">
  <div class="firstRowFirstColumn bigFont verticalLR paddingLeft" data-offset-x="0"  data-offset-y="0"   data-expected-width="75" data-expected-height="100">É</div>
  <div class="secondRowFirstColumn"                               data-offset-x="35"  data-offset-y="100" data-expected-width="99" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="firstRowSpanning2AutoColumn width25"                data-offset-x="99" data-offset-y="0"   data-expected-width="25" data-expected-height="200"></div>
</div>

<pre>max-content-sized columns - horizontal grid item - row-axis baseline</pre>
<div class="inline-grid justifyItemsBaseline rows max-content-columns">
  <div class="firstRowFirstColumn bigFont verticalLR paddingLeft" data-offset-x="0"   data-offset-y="0"   data-expected-width="75"  data-expected-height="100">É</div>
  <div class="secondRowFirstColumn"                               data-offset-x="35"   data-offset-y="100" data-expected-width="416" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="firstRowSpanning2AutoColumn width25"                data-offset-x="451" data-offset-y="0"   data-expected-width="25"  data-expected-height="200"></div>
</div>

<pre>fit-content-sized columns - horizontal grid item - row-axis baseline</pre>
<div class="inline-grid justifyItemsBaseline rows fit-content-columns">
  <div class="firstRowFirstColumn bigFont verticalLR paddingLeft" data-offset-x="0"   data-offset-y="0"   data-expected-width="75"  data-expected-height="100">É</div>
  <div class="secondRowFirstColumn"                               data-offset-x="35"   data-offset-y="100" data-expected-width="416" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="firstRowSpanning2AutoColumn width25"                data-offset-x="451" data-offset-y="0"   data-expected-width="25"  data-expected-height="200"></div>
</div>

<pre>flex-sized columns - horizontal grid item - row-axis baseline</pre>
<div class="inline-grid justifyItemsBaseline rows flex-columns">
  <div class="firstRowFirstColumn bigFont verticalLR paddingLeft" data-offset-x="0"   data-offset-y="0"   data-expected-width="75"  data-expected-height="100">É</div>
  <div class="secondRowFirstColumn"                               data-offset-x="35"   data-offset-y="100" data-expected-width="416" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="firstRowSpanning2AutoColumn width25"                data-offset-x="451" data-offset-y="0"   data-expected-width="25"  data-expected-height="200"></div>
</div>

<pre>max-flex-sized columns - horizontal grid item - row-axis baseline<br>baseline is not applied initially, but orthogonal items force repeating the track sizing and height is not indefinite in that phase.</pre>
<!-- https://github.com/w3c/csswg-drafts/issues/3046 -->
<div class="inline-grid justifyItemsBaseline auto-rows max-flex-columns">
  <div class="firstRowFirstColumn bigFont verticalLR paddingLeft" data-offset-x="0"   data-offset-y="0"   data-expected-width="75"  data-expected-height="50">É</div>
  <div class="secondRowFirstColumn verticalLR"                    data-offset-x="32"  data-offset-y="50"  data-expected-width="80"  data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="firstRowSpanning2AutoColumn width25"                data-offset-x="112" data-offset-y="0"   data-expected-width="25"  data-expected-height="150"></div>
</div>

<pre>auto-sized rows - verticalLR grid and horizontal item - column-axis baseline</pre>
<div class="inline-grid verticalLR alignItemsBaseline columns width200">
  <div class="firstRowFirstColumn bigFont paddingLeft" data-offset-x="0"   data-offset-y="0"   data-expected-width="75"  data-expected-height="100">É</div>
  <div class="firstRowSecondColumn horizontalTB"       data-offset-x="35"   data-offset-y="100" data-expected-width="175" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="autoRowAutoColumnSpanning2 width25"      data-offset-x="175" data-offset-y="0"   data-expected-width="25"  data-expected-height="200"></div>
</div>

<pre>min-content-sized rows - verticalLR grid and horizontal item - column-axis baseline</pre>
<div class="inline-grid verticalLR alignItemsBaseline columns min-content-rows">
  <div class="firstRowFirstColumn bigFont paddingLeft" data-offset-x="0"  data-offset-y="0"   data-expected-width="75" data-expected-height="100">É</div>
  <div class="firstRowSecondColumn horizontalTB"       data-offset-x="35"  data-offset-y="100" data-expected-width="99" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="autoRowAutoColumnSpanning2 width25"      data-offset-x="99" data-offset-y="0"   data-expected-width="25" data-expected-height="200"></div>
</div>

<pre>max-content-sized rows - verticalLR grid and horizontal item - column-axis baseline</pre>
<div class="inline-grid verticalLR alignItemsBaseline columns max-content-rows">
  <div class="firstRowFirstColumn bigFont paddingLeft" data-offset-x="0"   data-offset-y="0"   data-expected-width="75"  data-expected-height="100">É</div>
  <div class="firstRowSecondColumn horizontalTB"       data-offset-x="35"   data-offset-y="100" data-expected-width="416" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="autoRowAutoColumnSpanning2 width25"      data-offset-x="451" data-offset-y="0"   data-expected-width="25"  data-expected-height="200"></div>
</div>

<pre>fit-content-sized rows - verticalLR grid and horizontal item - column-axis baseline</pre>
<div class="inline-grid verticalLR alignItemsBaseline columns fit-content-rows">
  <div class="firstRowFirstColumn bigFont paddingLeft" data-offset-x="0"   data-offset-y="0"   data-expected-width="75"  data-expected-height="100">É</div>
  <div class="firstRowSecondColumn horizontalTB"       data-offset-x="35"   data-offset-y="100" data-expected-width="416" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="autoRowAutoColumnSpanning2 width25"      data-offset-x="451" data-offset-y="0"   data-expected-width="25"  data-expected-height="200"></div>
</div>

<pre>flex-sized rows - verticalLR grid and horizontal item - column-axis baseline</pre>
<div class="inline-grid verticalLR alignItemsBaseline columns flex-rows">
  <div class="firstRowFirstColumn bigFont paddingLeft" data-offset-x="0"   data-offset-y="0"   data-expected-width="75"  data-expected-height="100">É</div>
  <div class="firstRowSecondColumn horizontalTB"       data-offset-x="35"   data-offset-y="100" data-expected-width="416" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="autoRowAutoColumnSpanning2 width25"      data-offset-x="451" data-offset-y="0"   data-expected-width="25"  data-expected-height="200"></div>
</div>

<pre>max-flex-sized rows - verticalLR grid and horizontal item - column-axis baseline<br>baseline is not applied initially, but orthogonal items force repeating the track sizing and height is not indefinite in that phase.</pre>
<!-- https://github.com/w3c/csswg-drafts/issues/3046 -->
<div class="inline-grid verticalLR alignItemsBaseline auto-columns max-flex-rows">
  <div class="firstRowFirstColumn bigFont"        data-offset-x="0"   data-offset-y="0"   data-expected-width="50"  data-expected-height="50">É</div>
  <div class="firstRowSecondColumn horizontalBT"  data-offset-x="7"  data-offset-y="50"   data-expected-width="80"  data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="autoRowAutoColumnSpanning2 width25" data-offset-x="87" data-offset-y="0"    data-expected-width="25"  data-expected-height="150"></div>
</div>

<pre>auto-sized rows - verticalRL grid and horizontal item - column-axis baseline</pre>
<pre>baseline alignment is not supported, because the RL items do not share an alignment context with the LR items</pre>
<div class="inline-grid verticalRL alignItemsBaseline columns width200">
  <div class="firstRowFirstColumn bigFont paddingLeft" data-offset-x="28" data-offset-y="0"   data-expected-width="75"  data-expected-height="100">É</div>
  <div class="firstRowSecondColumn horizontalTB"       data-offset-x="63"  data-offset-y="100" data-expected-width="137" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="autoRowAutoColumnSpanning2 width25"      data-offset-x="38"   data-offset-y="0"   data-expected-width="25"  data-expected-height="200"></div>
</div>

<pre>min-content-sized rows - verticalRL grid and horizontal item - column-axis baseline</pre>
<pre>baseline alignment is not supported, because the RL items do not share an alignment context with the LR items</pre>
<div class="inline-grid verticalRL alignItemsBaseline columns min-content-rows">
  <div class="firstRowFirstColumn bigFont paddingLeft" data-offset-x="-10" data-offset-y="0"   data-expected-width="75" data-expected-height="100">É</div>
  <div class="firstRowSecondColumn horizontalTB"       data-offset-x="25" data-offset-y="100" data-expected-width="99" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="autoRowAutoColumnSpanning2 width25"      data-offset-x="0"  data-offset-y="0"   data-expected-width="25" data-expected-height="200"></div>
</div>

<pre>max-content-sized rows - verticalRL grid and horizontal item - column-axis baseline</pre>
<pre>baseline alignment is not supported, because the RL items do not share an alignment context with the LR items</pre>
<div class="inline-grid verticalRL alignItemsBaseline columns max-content-rows">
  <div class="firstRowFirstColumn bigFont paddingLeft" data-offset-x="-10" data-offset-y="0"   data-expected-width="75"  data-expected-height="100">É</div>
  <div class="firstRowSecondColumn horizontalTB"       data-offset-x="25"  data-offset-y="100" data-expected-width="99" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="autoRowAutoColumnSpanning2 width25"      data-offset-x="0"   data-offset-y="0"   data-expected-width="25"  data-expected-height="200"></div>
</div>

<pre>fit-content-sized rows - verticalRL grid and horizontal item - column-axis baseline</pre>
<pre>baseline alignment is not supported, because the RL items do not share an alignment context with the LR items</pre>
<div class="inline-grid verticalRL alignItemsBaseline auto-columns fit-content-rows">
  <div class="firstRowFirstColumn bigFont paddingLeft" data-offset-x="-10" data-offset-y="0"   data-expected-width="75"  data-expected-height="50">É</div>
  <div class="firstRowSecondColumn horizontalTB"       data-offset-x="25"  data-offset-y="50" data-expected-width="99" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="autoRowAutoColumnSpanning2 width25"      data-offset-x="0"   data-offset-y="0"   data-expected-width="25"  data-expected-height="150"></div>
</div>

<pre>flex-sized rows - verticalRL grid and horizontal item - column-axis baseline</pre>
<pre>baseline alignment is not supported, because the RL items do not share an alignment context with the LR items</pre>
<div class="inline-grid verticalRL alignItemsBaseline auto-columns flex-rows">
  <div class="firstRowFirstColumn bigFont paddingLeft" data-offset-x="-10" data-offset-y="0"   data-expected-width="75"  data-expected-height="50">É</div>
  <div class="firstRowSecondColumn horizontalTB"       data-offset-x="25"  data-offset-y="50" data-expected-width="99" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="autoRowAutoColumnSpanning2 width25"      data-offset-x="0"   data-offset-y="0"   data-expected-width="25"  data-expected-height="150"></div>
</div>

<pre>max-flex-sized rows - verticalRL grid and horizontal item - column-axis baseline</pre>
<pre>baseline alignment is not supported, because the RL items do not share an alignment context with the LR items</pre>
<div class="inline-grid verticalRL alignItemsBaseline auto-columns max-flex-rows">
  <div class="firstRowFirstColumn bigFont paddingLeft" data-offset-x="-10"  data-offset-y="0"   data-expected-width="75"  data-expected-height="50">É</div>
  <div class="firstRowSecondColumn horizontalTB"       data-offset-x="25"   data-offset-y="50"  data-expected-width="99" data-expected-height="100">ÉÉ É ÉÉ ÉÉÉÉ É ÉÉ ÉÉÉ ÉÉ É</div>
  <div class="autoRowAutoColumnSpanning2 width25"      data-offset-x="0"    data-offset-y="0"   data-expected-width="25"  data-expected-height="150"></div>
</div>

</body>