4 <link href=
"resources/grid.css" rel=
"stylesheet">
5 <script src=
"../../resources/check-layout.js"></script>
12 grid-template-columns:
100px
100px;
13 grid-template-rows:
200px
200px;
14 width: -webkit-fit-content;
58 align-self: flex-start;
66 align-self: self-start;
79 <body onload=
"checkLayout('.grid')">
81 <p>This test checks that the align-self property is applied correctly.
</p>
83 <div style=
"position: relative">
84 <div class=
"grid" data-expected-width=
"200" data-expected-height=
"400">
85 <div class=
"alignSelfStretch firstRowFirstColumn" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"200"></div>
86 <div class=
"cell alignSelfStart firstRowSecondColumn" data-offset-x=
"100" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
87 <div class=
"cell alignSelfEnd firstRowSecondColumn" data-offset-x=
"100" data-offset-y=
"160" data-expected-width=
"20" data-expected-height=
"40"></div>
88 <div class=
"cell alignSelfCenter secondRowFirstColumn" data-offset-x=
"0" data-offset-y=
"280" data-expected-width=
"20" data-expected-height=
"40"></div>
89 <div class=
"cell alignSelfRight secondRowSecondColumn" data-offset-x=
"100" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"40"></div>
90 <div class=
"cell alignSelfLeft secondRowSecondColumn" data-offset-x=
"100" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"40"></div>
94 <div style=
"position: relative">
95 <div class=
"grid" data-expected-width=
"200" data-expected-height=
"400">
96 <div class=
"cell alignSelfFlexEnd firstRowFirstColumn" data-offset-x=
"0" data-offset-y=
"160" data-expected-width=
"20" data-expected-height=
"40"></div>
97 <div class=
"cell alignSelfFlexStart firstRowSecondColumn" data-offset-x=
"100" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
98 <div class=
"cell alignSelfSelfStart secondRowFirstColumn" data-offset-x=
"0" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"40"></div>
99 <div class=
"cell alignSelfSelfEnd secondRowSecondColumn" data-offset-x=
"100" data-offset-y=
"360" data-expected-width=
"20" data-expected-height=
"40"></div>
103 <!-- Default alignment and initial values. -->
104 <div style=
"position: relative">
105 <div class=
"grid alignItemsCenter" data-expected-width=
"200" data-expected-height=
"400">
106 <div class=
"cell alignSelfAuto firstRowFirstColumn" data-offset-x=
"0" data-offset-y=
"80" data-expected-width=
"20" data-expected-height=
"40"></div>
107 <div class=
"cell firstRowSecondColumn" data-offset-x=
"100" data-offset-y=
"80" data-expected-width=
"20" data-expected-height=
"40"></div>
108 <div class=
"cell alignSelfSelfStart secondRowFirstColumn" data-offset-x=
"0" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"40"></div>
109 <div class=
"cell alignSelfSelfEnd secondRowSecondColumn" data-offset-x=
"100" data-offset-y=
"360" data-expected-width=
"20" data-expected-height=
"40"></div>
113 <div style=
"position: relative">
114 <div class=
"grid" data-expected-width=
"200" data-expected-height=
"400">
115 <div class=
"alignSelfAuto firstRowFirstColumn" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"200"></div>
116 <div class=
"cell firstRowSecondColumn" data-offset-x=
"100" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
117 <div class=
"cell alignSelfStart secondRowFirstColumn" data-offset-x=
"0" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"40"></div>
118 <div class=
"cell alignSelfEnd secondRowSecondColumn" data-offset-x=
"100" data-offset-y=
"360" data-expected-width=
"20" data-expected-height=
"40"></div>
122 <!-- RTL direction (it should not affect the block-flow direction). -->
123 <div style=
"position: relative">
124 <div class=
"grid directionRTL" data-expected-width=
"200" data-expected-height=
"400">
125 <div class=
"alignSelfStretch firstRowFirstColumn" data-offset-x=
"100" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"200"></div>
126 <div class=
"cell alignSelfStart firstRowSecondColumn" data-offset-x=
"80" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
127 <div class=
"cell alignSelfEnd firstRowSecondColumn" data-offset-x=
"80" data-offset-y=
"160" data-expected-width=
"20" data-expected-height=
"40"></div>
128 <div class=
"cell alignSelfCenter secondRowFirstColumn" data-offset-x=
"180" data-offset-y=
"280" data-expected-width=
"20" data-expected-height=
"40"></div>
129 <div class=
"cell alignSelfRight secondRowSecondColumn" data-offset-x=
"80" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"40"></div>
130 <div class=
"cell alignSelfLeft secondRowSecondColumn" data-offset-x=
"80" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"40"></div>
134 <div style=
"position: relative">
135 <div class=
"grid directionRTL" data-expected-width=
"200" data-expected-height=
"400">
136 <div class=
"cell alignSelfFlexEnd firstRowFirstColumn" data-offset-x=
"180" data-offset-y=
"160" data-expected-width=
"20" data-expected-height=
"40"></div>
137 <div class=
"cell alignSelfFlexStart firstRowSecondColumn" data-offset-x=
"80" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
138 <div class=
"cell alignSelfSelfStart secondRowFirstColumn" data-offset-x=
"180" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"40"></div>
139 <div class=
"cell alignSelfSelfEnd secondRowSecondColumn" data-offset-x=
"80" data-offset-y=
"360" data-expected-width=
"20" data-expected-height=
"40"></div>
143 <!-- RTL direction (it should not affect the block-flow) with opposite directions grid container vs grid item. -->
144 <div style=
"position: relative">
145 <div class=
"grid" data-expected-width=
"200" data-expected-height=
"400">
146 <div class=
"alignSelfStretch firstRowFirstColumn directionRTL" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"200"></div>
147 <div class=
"cell alignSelfStart firstRowSecondColumn directionRTL" data-offset-x=
"100" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
148 <div class=
"cell alignSelfEnd firstRowSecondColumn directionRTL" data-offset-x=
"100" data-offset-y=
"160" data-expected-width=
"20" data-expected-height=
"40"></div>
149 <div class=
"cell alignSelfCenter secondRowFirstColumn directionRTL" data-offset-x=
"0" data-offset-y=
"280" data-expected-width=
"20" data-expected-height=
"40"></div>
150 <div class=
"cell alignSelfRight secondRowSecondColumn directionRTL" data-offset-x=
"100" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"40"></div>
151 <div class=
"cell alignSelfLeft secondRowSecondColumn directionRTL" data-offset-x=
"100" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"40"></div>
155 <div style=
"position: relative">
156 <div class=
"grid" data-expected-width=
"200" data-expected-height=
"400">
157 <div class=
"cell alignSelfFlexEnd firstRowFirstColumn directionRTL" data-offset-x=
"0" data-offset-y=
"160" data-expected-width=
"20" data-expected-height=
"40"></div>
158 <div class=
"cell alignSelfFlexStart firstRowSecondColumn directionRTL" data-offset-x=
"100" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
159 <div class=
"cell alignSelfSelfStart secondRowFirstColumn directionRTL" data-offset-x=
"0" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"40"></div>
160 <div class=
"cell alignSelfSelfEnd secondRowSecondColumn directionRTL" data-offset-x=
"100" data-offset-y=
"360" data-expected-width=
"20" data-expected-height=
"40"></div>
164 <!-- Vertical RL writing mode. -->
165 <div style=
"position: relative">
166 <div class=
"grid verticalRL" data-expected-width=
"400" data-expected-height=
"200">
167 <div class=
"alignSelfStretch firstRowFirstColumn" data-offset-x=
"200" data-offset-y=
"0" data-expected-width=
"200" data-expected-height=
"100"></div>
168 <div class=
"cell alignSelfStart firstRowSecondColumn" data-offset-x=
"380" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40"></div>
169 <div class=
"cell alignSelfEnd firstRowSecondColumn" data-offset-x=
"200" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40"></div>
170 <div class=
"cell alignSelfCenter secondRowFirstColumn" data-offset-x=
"90" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
171 <div class=
"cell alignSelfRight secondRowSecondColumn" data-offset-x=
"180" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40"></div>
172 <div class=
"cell alignSelfLeft secondRowSecondColumn" data-offset-x=
"180" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40"></div>
176 <div style=
"position: relative">
177 <div class=
"grid verticalRL" data-expected-width=
"400" data-expected-height=
"200">
178 <div class=
"cell alignSelfFlexEnd firstRowFirstColumn" data-offset-x=
"200" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
179 <div class=
"cell alignSelfFlexStart firstRowSecondColumn" data-offset-x=
"380" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40"></div>
180 <div class=
"cell alignSelfSelfStart secondRowFirstColumn" data-offset-x=
"180" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
181 <div class=
"cell alignSelfSelfEnd secondRowSecondColumn" data-offset-x=
"0" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40"></div>
185 <!-- Vertical LR writing mode. -->
186 <div style=
"position: relative">
187 <div class=
"grid verticalLR" data-expected-width=
"400" data-expected-height=
"200">
188 <div class=
"alignSelfStretch firstRowFirstColumn" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"200" data-expected-height=
"100"></div>
189 <div class=
"cell alignSelfStart firstRowSecondColumn" data-offset-x=
"0" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40"></div>
190 <div class=
"cell alignSelfEnd firstRowSecondColumn" data-offset-x=
"180" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40"></div>
191 <div class=
"cell alignSelfCenter secondRowFirstColumn" data-offset-x=
"290" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
192 <div class=
"cell alignSelfRight secondRowSecondColumn" data-offset-x=
"200" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40"></div>
193 <div class=
"cell alignSelfLeft secondRowSecondColumn" data-offset-x=
"200" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40"></div>
197 <div style=
"position: relative">
198 <div class=
"grid verticalLR" data-expected-width=
"400" data-expected-height=
"200">
199 <div class=
"cell alignSelfFlexEnd firstRowFirstColumn" data-offset-x=
"180" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
200 <div class=
"cell alignSelfFlexStart firstRowSecondColumn" data-offset-x=
"0" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40"></div>
201 <div class=
"cell alignSelfSelfStart secondRowFirstColumn" data-offset-x=
"200" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
202 <div class=
"cell alignSelfSelfEnd secondRowSecondColumn" data-offset-x=
"380" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40"></div>
206 <!-- Vertical RL writing mode with opposite block-flow directions grid container vs grid item. -->
207 <div style=
"position: relative">
208 <div class=
"grid verticalRL" data-expected-width=
"400" data-expected-height=
"200">
209 <div class=
"alignSelfStretch firstRowFirstColumn verticalLR" data-offset-x=
"200" data-offset-y=
"0" data-expected-width=
"200" data-expected-height=
"100">
211 <div class=
"cell alignSelfStart firstRowSecondColumn verticalLR" data-offset-x=
"380" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40">
212 <div class=
"item"></div>
214 <div class=
"cell alignSelfEnd firstRowSecondColumn verticalLR" data-offset-x=
"200" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40">
215 <div class=
"item"></div>
217 <div class=
"cell alignSelfCenter secondRowFirstColumn verticalLR" data-offset-x=
"90" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40">
218 <div class=
"item"></div>
220 <div class=
"cell alignSelfRight secondRowSecondColumn verticalLR" data-offset-x=
"180" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40">
221 <div class=
"item"></div>
223 <div class=
"cell alignSelfLeft secondRowSecondColumn verticalLR" data-offset-x=
"180" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40">
224 <div class=
"item"></div>
229 <div style=
"position: relative">
230 <div class=
"grid verticalRL" data-expected-width=
"400" data-expected-height=
"200">
231 <div class=
"cell alignSelfFlexEnd firstRowFirstColumn verticalLR" data-offset-x=
"200" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40">
232 <div class=
"item"></div>
234 <div class=
"cell alignSelfFlexStart firstRowSecondColumn verticalLR" data-offset-x=
"380" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40">
235 <div class=
"item"></div>
237 <div class=
"cell alignSelfSelfStart secondRowFirstColumn verticalLR" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40">
238 <div class=
"item"></div>
240 <div class=
"cell alignSelfSelfEnd secondRowSecondColumn verticalLR" data-offset-x=
"180" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40">
241 <div class=
"item"></div>
246 <!-- Vertical LR writing mode with opposite block-flow directions grid container vs grid item. -->
247 <div style=
"position: relative">
248 <div class=
"grid verticalLR" data-expected-width=
"400" data-expected-height=
"200">
249 <div class=
"alignSelfStretch firstRowFirstColumn verticalRL" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"200" data-expected-height=
"100">
251 <div class=
"cell alignSelfStart firstRowSecondColumn verticalRL" data-offset-x=
"0" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40">
252 <div class=
"item"></div>
254 <div class=
"cell alignSelfEnd firstRowSecondColumn verticalRL" data-offset-x=
"180" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40">
255 <div class=
"item"></div>
257 <div class=
"cell alignSelfCenter secondRowFirstColumn verticalRL" data-offset-x=
"290" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40">
258 <div class=
"item"></div>
260 <div class=
"cell alignSelfRight secondRowSecondColumn verticalRL" data-offset-x=
"200" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40">
261 <div class=
"item"></div>
263 <div class=
"cell alignSelfLeft secondRowSecondColumn verticalRL" data-offset-x=
"200" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40">
264 <div class=
"item"></div>
269 <div style=
"position: relative">
270 <div class=
"grid verticalLR" data-expected-width=
"400" data-expected-height=
"200">
271 <div class=
"cell alignSelfFlexEnd firstRowFirstColumn verticalRL" data-offset-x=
"180" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40">
272 <div class=
"item"></div>
274 <div class=
"cell alignSelfFlexStart firstRowSecondColumn verticalRL" data-offset-x=
"0" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40">
275 <div class=
"item"></div>
277 <div class=
"cell alignSelfSelfStart secondRowFirstColumn verticalRL" data-offset-x=
"380" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40">
278 <div class=
"item"></div>
280 <div class=
"cell alignSelfSelfEnd secondRowSecondColumn verticalRL" data-offset-x=
"200" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40">
281 <div class=
"item"></div>