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;
75 .justifyItemsStretch {
76 justify-items: stretch;
88 justify-self: stretch;
96 <body onload=
"checkLayout('.grid')">
98 <p>This test checks that the 'stretch' value is applied correctly for 'align' and 'justify' properties.
</p>
100 <div style=
"position: relative">
101 <div class=
"grid" data-expected-width=
"200" data-expected-height=
"400">
102 <div class=
"alignSelfStretch justifySelfStart firstRowFirstColumn" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"0" data-expected-height=
"200"></div>
103 <div class=
"widthAndHeightSet alignSelfStretch justifySelfStart firstRowSecondColumn" data-offset-x=
"100" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
104 <div class=
"onlyWidthSet alignSelfStretch justifySelfStart secondRowFirstColumn" data-offset-x=
"0" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"200"></div>
105 <div class=
"onlyHeightSet alignSelfStretch justifySelfStart secondRowSecondColumn" data-offset-x=
"100" data-offset-y=
"200" data-expected-width=
"0" data-expected-height=
"40"></div>
109 <div style=
"position: relative">
110 <div class=
"grid" data-expected-width=
"200" data-expected-height=
"400">
111 <div class=
"alignSelfStart justifySelfStretch firstRowFirstColumn" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"0"></div>
112 <div class=
"widthAndHeightSet alignSelfStart justifySelfStretch firstRowSecondColumn" data-offset-x=
"100" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
113 <div class=
"onlyWidthSet alignSelfStart justifySelfStretch secondRowFirstColumn" data-offset-x=
"0" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"0"></div>
114 <div class=
"onlyHeightSet alignSelfStart justifySelfStretch secondRowSecondColumn" data-offset-x=
"100" data-offset-y=
"200" data-expected-width=
"100" data-expected-height=
"40"></div>
118 <div style=
"position: relative">
119 <div class=
"grid" data-expected-width=
"200" data-expected-height=
"400">
120 <div class=
"maxHeight alignSelfStretch justifySelfStart firstRowFirstColumn" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"0" data-expected-height=
"160"></div>
121 <div class=
"minWidth widthAndHeightSet alignSelfStretch justifySelfStart firstRowSecondColumn" data-offset-x=
"100" data-offset-y=
"0" data-expected-width=
"120" data-expected-height=
"40"></div>
122 <div class=
"minHeight onlyWidthSet alignSelfStretch justifySelfStart secondRowFirstColumn" data-offset-x=
"0" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"220"></div>
123 <div class=
"maxWidth onlyHeightSet alignSelfStretch justifySelfStretch secondRowSecondColumn" data-offset-x=
"100" data-offset-y=
"200" data-expected-width=
"90" data-expected-height=
"40"></div>
127 <div style=
"position: relative">
128 <div class=
"grid" data-expected-width=
"200" data-expected-height=
"400">
129 <div class=
"alignSelfStretch justifySelfStretch firstRowFirstColumn" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"200"></div>
130 <div class=
"widthAndHeightSet alignSelfStretch justifySelfStretch firstRowSecondColumn" data-offset-x=
"100" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
131 <div class=
"onlyWidthSet alignSelfStretch justifySelfStretch secondRowFirstColumn" data-offset-x=
"0" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"200"></div>
132 <div class=
"onlyHeightSet alignSelfStretch justifySelfStretch secondRowSecondColumn" data-offset-x=
"100" data-offset-y=
"200" data-expected-width=
"100" data-expected-height=
"40"></div>
136 <div style=
"position: relative">
137 <div class=
"grid alignItemsStretch justifyItemsStart" data-expected-width=
"200" data-expected-height=
"400">
138 <div class=
"firstRowFirstColumn" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"0" data-expected-height=
"200"></div>
139 <div class=
"widthAndHeightSet firstRowSecondColumn" data-offset-x=
"100" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
140 <div class=
"onlyWidthSet secondRowFirstColumn" data-offset-x=
"0" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"200"></div>
141 <div class=
"onlyHeightSet secondRowSecondColumn" data-offset-x=
"100" data-offset-y=
"200" data-expected-width=
"0" data-expected-height=
"40"></div>
145 <div style=
"position: relative">
146 <div class=
"grid alignItemsStart justifyItemsStretch" data-expected-width=
"200" data-expected-height=
"400">
147 <div class=
"firstRowFirstColumn" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"0"></div>
148 <div class=
"widthAndHeightSet firstRowSecondColumn" data-offset-x=
"100" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
149 <div class=
"onlyWidthSet secondRowFirstColumn" data-offset-x=
"0" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"0"></div>
150 <div class=
"onlyHeightSet secondRowSecondColumn" data-offset-x=
"100" data-offset-y=
"200" data-expected-width=
"100" data-expected-height=
"40"></div>
154 <div style=
"position: relative">
155 <div class=
"grid alignItemsStretch justifyItemsStretch" data-expected-width=
"200" data-expected-height=
"400">
156 <div class=
"firstRowFirstColumn" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"200"></div>
157 <div class=
"widthAndHeightSet firstRowSecondColumn" data-offset-x=
"100" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
158 <div class=
"onlyWidthSet secondRowFirstColumn" data-offset-x=
"0" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"200"></div>
159 <div class=
"onlyHeightSet secondRowSecondColumn" data-offset-x=
"100" data-offset-y=
"200" data-expected-width=
"100" data-expected-height=
"40"></div>
163 <div style=
"position: relative">
164 <div class=
"grid alignItemsAuto justifyItemsAuto" data-expected-width=
"200" data-expected-height=
"400">
165 <div class=
"firstRowFirstColumn" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"200"></div>
166 <div class=
"widthAndHeightSet firstRowSecondColumn" data-offset-x=
"100" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
167 <div class=
"onlyWidthSet secondRowFirstColumn" data-offset-x=
"0" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"200"></div>
168 <div class=
"onlyHeightSet secondRowSecondColumn" data-offset-x=
"100" data-offset-y=
"200" data-expected-width=
"100" data-expected-height=
"40"></div>
172 <div style=
"position: relative">
173 <div class=
"grid" data-expected-width=
"200" data-expected-height=
"400">
174 <div class=
"firstRowFirstColumn" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"200"></div>
175 <div class=
"widthAndHeightSet firstRowSecondColumn" data-offset-x=
"100" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
176 <div class=
"onlyWidthSet secondRowFirstColumn" data-offset-x=
"0" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"200"></div>
177 <div class=
"onlyHeightSet secondRowSecondColumn" data-offset-x=
"100" data-offset-y=
"200" data-expected-width=
"100" data-expected-height=
"40"></div>
181 <div style=
"position: relative">
182 <div class=
"grid" data-expected-width=
"200" data-expected-height=
"400">
183 <div class=
"firstRowFirstColumn" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"200"></div>
184 <div class=
"firstRowSecondColumn" data-offset-x=
"100" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"200"></div>
185 <div class=
"secondRowFirstColumn" data-offset-x=
"0" data-offset-y=
"200" data-expected-width=
"100" data-expected-height=
"200"></div>
186 <div class=
"secondRowSecondColumn" data-offset-x=
"100" data-offset-y=
"200" data-expected-width=
"100" data-expected-height=
"200"></div>
190 <!-- RTL direction (it should not affect the block-flow direction). -->
191 <div style=
"position: relative">
192 <div class=
"grid directionRTL alignItemsStretch justifyItemsStretch" data-expected-width=
"200" data-expected-height=
"400">
193 <div class=
"firstRowFirstColumn" data-offset-x=
"100" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"200"></div>
194 <div class=
"widthAndHeightSet firstRowSecondColumn" data-offset-x=
"80" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
195 <div class=
"onlyWidthSet secondRowFirstColumn" data-offset-x=
"180" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"200"></div>
196 <div class=
"onlyHeightSet secondRowSecondColumn" data-offset-x=
"0" data-offset-y=
"200" data-expected-width=
"100" data-expected-height=
"40"></div>
200 <!-- RTL direction (it should not affect the block-flow) with opposite directions grid container vs grid item. -->
201 <div style=
"position: relative">
202 <div class=
"grid alignItemsStretch justifyItemsStretch" data-expected-width=
"200" data-expected-height=
"400">
203 <div class=
"firstRowFirstColumn directionRTL" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"200"></div>
204 <div class=
"widthAndHeightSet firstRowSecondColumn directionRTL" data-offset-x=
"100" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"40"></div>
205 <div class=
"onlyWidthSet secondRowFirstColumn directionRTL" data-offset-x=
"0" data-offset-y=
"200" data-expected-width=
"20" data-expected-height=
"200"></div>
206 <div class=
"onlyHeightSet secondRowSecondColumn directionRTL" data-offset-x=
"100" data-offset-y=
"200" data-expected-width=
"100" data-expected-height=
"40"></div>
210 <!-- Vertical RL writing mode. -->
211 <div style=
"position: relative">
212 <div class=
"grid verticalRL alignItemsStretch justifyItemsStretch" data-expected-width=
"400" data-expected-height=
"200">
213 <div class=
"firstRowFirstColumn" data-offset-x=
"200" data-offset-y=
"0" data-expected-width=
"200" data-expected-height=
"100"></div>
214 <div class=
"widthAndHeightSet firstRowSecondColumn" data-offset-x=
"380" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40"></div>
215 <div class=
"onlyWidthSet secondRowFirstColumn" data-offset-x=
"180" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"100"></div>
216 <div class=
"onlyHeightSet secondRowSecondColumn" data-offset-x=
"0" data-offset-y=
"100" data-expected-width=
"200" data-expected-height=
"40"></div>
220 <div style=
"position: relative">
221 <div class=
"grid verticalRL" data-expected-width=
"400" data-expected-height=
"200">
222 <div class=
"firstRowFirstColumn" data-offset-x=
"200" data-offset-y=
"0" data-expected-width=
"200" data-expected-height=
"100"></div>
223 <div class=
"firstRowSecondColumn" data-offset-x=
"200" data-offset-y=
"100" data-expected-width=
"200" data-expected-height=
"100"></div>
224 <div class=
"secondRowFirstColumn" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"200" data-expected-height=
"100"></div>
225 <div class=
"secondRowSecondColumn" data-offset-x=
"0" data-offset-y=
"100" data-expected-width=
"200" data-expected-height=
"100"></div>
229 <!-- Vertical LR writing mode. -->
230 <div style=
"position: relative">
231 <div class=
"grid verticalLR alignItemsStretch justifyItemsStretch" data-expected-width=
"400" data-expected-height=
"200">
232 <div class=
"firstRowFirstColumn" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"200" data-expected-height=
"100"></div>
233 <div class=
"widthAndHeightSet firstRowSecondColumn" data-offset-x=
"0" data-offset-y=
"100" data-expected-width=
"20" data-expected-height=
"40"></div>
234 <div class=
"onlyWidthSet secondRowFirstColumn" data-offset-x=
"200" data-offset-y=
"0" data-expected-width=
"20" data-expected-height=
"100"></div>
235 <div class=
"onlyHeightSet secondRowSecondColumn" data-offset-x=
"200" data-offset-y=
"100" data-expected-width=
"200" data-expected-height=
"40"></div>
239 <div style=
"position: relative">
240 <div class=
"grid verticalLR" data-expected-width=
"400" data-expected-height=
"200">
241 <div class=
"firstRowFirstColumn" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"200" data-expected-height=
"100"></div>
242 <div class=
"firstRowSecondColumn" data-offset-x=
"0" data-offset-y=
"100" data-expected-width=
"200" data-expected-height=
"100"></div>
243 <div class=
"secondRowFirstColumn" data-offset-x=
"200" data-offset-y=
"0" data-expected-width=
"200" data-expected-height=
"100"></div>
244 <div class=
"secondRowSecondColumn" data-offset-x=
"200" data-offset-y=
"100" data-expected-width=
"200" data-expected-height=
"100"></div>