4 <link href=
"resources/grid.css" rel=
"stylesheet">
5 <script src=
"../../resources/check-layout.js"></script>
12 grid-template-columns:
100px
200px;
13 grid-template-rows:
200px
200px;
14 padding:
10px
15px
20px
30px;
15 border-width:
5px
10px
15px
20px;
18 width: -webkit-fit-content;
25 margin:
4px
8px
12px
16px;
30 justify-items: center;
49 align-items: self-start;
50 justify-items: self-start;
54 align-items: self-end;
55 justify-items: self-end;
60 justify-self: stretch;
65 <body onload=
"checkLayout('.grid')">
67 <p>This test checks that the 'margin', 'border' and 'padding' properties are applied together correctly for 'align' and 'justify' properties.
</p>
70 <p>border:
5px
10px
15px
20px | padding:
10px
15px
20px
30px | margin:
4px
8px
12px
16px
<br>
71 direction: LTR | align-items: 'auto' | justify-items: 'auto'
</p>
72 <div class=
"grid" data-expected-width=
"375" data-expected-height=
"450">
73 <div class=
"cell firstRowFirstColumn" data-offset-x=
"46" data-offset-y=
"14" data-expected-width=
"20" data-expected-height=
"40"></div>
74 <div class=
"cell firstRowSecondColumn" data-offset-x=
"146" data-offset-y=
"14" data-expected-width=
"20" data-expected-height=
"40"></div>
75 <div class=
"cell secondRowFirstColumn" data-offset-x=
"46" data-offset-y=
"214" data-expected-width=
"20" data-expected-height=
"40"></div>
76 <div class=
"cell secondRowSecondColumn" data-offset-x=
"146" data-offset-y=
"214" data-expected-width=
"20" data-expected-height=
"40"></div>
81 <p>border:
5px
10px
15px
20px | padding:
10px
15px
20px
30px | margin:
4px
8px
12px
16px
<br>
82 direction: LTR | align-items: 'center' | justify-items: 'center'
</p>
83 <div class=
"grid itemsCenter" data-expected-width=
"375" data-expected-height=
"450">
84 <div class=
"firstRowFirstColumn cell" data-offset-x=
"74" data-offset-y=
"86" data-expected-width=
"20" data-expected-height=
"40"></div>
85 <div class=
"stretch firstRowSecondColumn" data-offset-x=
"130" data-offset-y=
"10" data-expected-width=
"200" data-expected-height=
"200"></div>
86 <div class=
"stretch secondRowFirstColumn" data-offset-x=
"30" data-offset-y=
"210" data-expected-width=
"100" data-expected-height=
"200"></div>
87 <div class=
"cell secondRowSecondColumn" data-offset-x=
"224" data-offset-y=
"286" data-expected-width=
"20" data-expected-height=
"40"></div>
92 <p>border:
5px
10px
15px
20px | padding:
10px
15px
20px
30px | margin:
4px
8px
12px
16px
<br>
93 direction: LTR | align-items: 'end' | justify-items: 'end'
</p>
94 <div class=
"grid itemsEnd" data-expected-width=
"375" data-expected-height=
"450">
95 <div class=
"cell firstRowFirstColumn" data-offset-x=
"102" data-offset-y=
"158" data-expected-width=
"20" data-expected-height=
"40"></div>
96 <div class=
"stretch firstRowSecondColumn" data-offset-x=
"130" data-offset-y=
"10" data-expected-width=
"200" data-expected-height=
"200"></div>
97 <div class=
"stretch secondRowFirstColumn" data-offset-x=
"30" data-offset-y=
"210" data-expected-width=
"100" data-expected-height=
"200"></div>
98 <div class=
"cell secondRowSecondColumn" data-offset-x=
"302" data-offset-y=
"358" data-expected-width=
"20" data-expected-height=
"40"></div>
103 <p>border:
5px
10px
15px
20px | padding:
10px
15px
20px
30px | margin:
4px
8px
12px
16px
<br>
104 direction: LTR | align-items: 'left' | justify-items: 'left'
</p>
105 <div class=
"grid itemsLeft" data-expected-width=
"375" data-expected-height=
"450">
106 <div class=
"cell firstRowFirstColumn" data-offset-x=
"46" data-offset-y=
"14" data-expected-width=
"20" data-expected-height=
"40"></div>
107 <div class=
"stretch firstRowSecondColumn" data-offset-x=
"130" data-offset-y=
"10" data-expected-width=
"200" data-expected-height=
"200"></div>
108 <div class=
"stretch secondRowFirstColumn" data-offset-x=
"30" data-offset-y=
"210" data-expected-width=
"100" data-expected-height=
"200"></div>
109 <div class=
"cell secondRowSecondColumn" data-offset-x=
"146" data-offset-y=
"214" data-expected-width=
"20" data-expected-height=
"40"></div>
114 <p>border:
5px
10px
15px
20px | padding:
10px
15px
20px
30px | margin:
4px
8px
12px
16px
<br>
115 direction: LTR | align-items: 'right' | justify-items: 'right'
</p>
116 <div class=
"grid itemsRight" data-expected-width=
"375" data-expected-height=
"450">
117 <div class=
"cell firstRowFirstColumn" data-offset-x=
"102" data-offset-y=
"14" data-expected-width=
"20" data-expected-height=
"40"></div>
118 <div class=
"stretch firstRowSecondColumn" data-offset-x=
"130" data-offset-y=
"10" data-expected-width=
"200" data-expected-height=
"200"></div>
119 <div class=
"stretch secondRowFirstColumn" data-offset-x=
"30" data-offset-y=
"210" data-expected-width=
"100" data-expected-height=
"200"></div>
120 <div class=
"cell secondRowSecondColumn" data-offset-x=
"302" data-offset-y=
"214" data-expected-width=
"20" data-expected-height=
"40"></div>
125 <p>border:
5px
10px
15px
20px | padding:
10px
15px
20px
30px | margin:
4px
8px
12px
16px
<br>
126 direction: LTR (ortho) | align-items: 'self-start' | justify-items: 'self-start'
</p>
127 <div class=
"grid directionLTR itemsSelfStart" data-expected-width=
"375" data-expected-height=
"450">
128 <div class=
"directionRTL cell firstRowFirstColumn" data-offset-x=
"102" data-offset-y=
"14" data-expected-width=
"20" data-expected-height=
"40"></div>
129 <div class=
"directionRTL stretch firstRowSecondColumn" data-offset-x=
"130" data-offset-y=
"10" data-expected-width=
"200" data-expected-height=
"200"></div>
130 <div class=
"directionRTL stretch secondRowFirstColumn" data-offset-x=
"30" data-offset-y=
"210" data-expected-width=
"100" data-expected-height=
"200"></div>
131 <div class=
"directionRTL cell secondRowSecondColumn" data-offset-x=
"302" data-offset-y=
"214" data-expected-width=
"20" data-expected-height=
"40"></div>
136 <p>border:
5px
10px
15px
20px | padding:
10px
15px
20px
30px | margin:
4px
8px
12px
16px
<br>
137 direction: LTR (ortho) | align-items: 'self-end' | justify-items: 'self-end'
</p>
138 <div class=
"grid directionLTR itemsSelfEnd" data-expected-width=
"375" data-expected-height=
"450">
139 <div class=
"directionRTL cell firstRowFirstColumn" data-offset-x=
"46" data-offset-y=
"158" data-expected-width=
"20" data-expected-height=
"40"></div>
140 <div class=
"directionRTL stretch firstRowSecondColumn" data-offset-x=
"130" data-offset-y=
"10" data-expected-width=
"200" data-expected-height=
"200"></div>
141 <div class=
"directionRTL stretch secondRowFirstColumn" data-offset-x=
"30" data-offset-y=
"210" data-expected-width=
"100" data-expected-height=
"200"></div>
142 <div class=
"directionRTL cell secondRowSecondColumn" data-offset-x=
"146" data-offset-y=
"358" data-expected-width=
"20" data-expected-height=
"40"></div>
147 <p>border:
5px
10px
15px
20px | padding:
10px
15px
20px
30px | margin:
4px
8px
12px
16px
<br>
148 direction: LTR (parall) | align-items: 'self-start' | justify-items: 'self-start'
</p>
149 <div class=
"grid directionLTR itemsSelfStart" data-expected-width=
"375" data-expected-height=
"450">
150 <div class=
"directionLTR cell firstRowFirstColumn" data-offset-x=
"46" data-offset-y=
"14" data-expected-width=
"20" data-expected-height=
"40"></div>
151 <div class=
"directionLTR stretch firstRowSecondColumn" data-offset-x=
"130" data-offset-y=
"10" data-expected-width=
"200" data-expected-height=
"200"></div>
152 <div class=
"directionLTR stretch secondRowFirstColumn" data-offset-x=
"30" data-offset-y=
"210" data-expected-width=
"100" data-expected-height=
"200"></div>
153 <div class=
"directionLTR cell secondRowSecondColumn" data-offset-x=
"146" data-offset-y=
"214" data-expected-width=
"20" data-expected-height=
"40"></div>
158 <p>border:
5px
10px
15px
20px | padding:
10px
15px
20px
30px | margin:
4px
8px
12px
16px
<br>
159 direction: LTR - (parall) | align-items: 'self-end' | justify-items: 'self-end'
</p>
160 <div class=
"grid directionLTR itemsSelfEnd" data-expected-width=
"375" data-expected-height=
"450">
161 <div class=
"directionLTR cell firstRowFirstColumn" data-offset-x=
"102" data-offset-y=
"158" data-expected-width=
"20" data-expected-height=
"40"></div>
162 <div class=
"directionLTR stretch firstRowSecondColumn" data-offset-x=
"130" data-offset-y=
"10" data-expected-width=
"200" data-expected-height=
"200"></div>
163 <div class=
"directionLTR stretch secondRowFirstColumn" data-offset-x=
"30" data-offset-y=
"210" data-expected-width=
"100" data-expected-height=
"200"></div>
164 <div class=
"directionLTR cell secondRowSecondColumn" data-offset-x=
"302" data-offset-y=
"358" data-expected-width=
"20" data-expected-height=
"40"></div>
168 <!-- RTL direction. -->
170 <p>border:
5px
10px
15px
20px | padding:
10px
15px
20px
30px | margin:
4px
8px
12px
16px
<br>
171 direction: RTL | align-items: 'auto' | justify-items: 'auto'
</p>
172 <div class=
"grid directionRTL" data-expected-width=
"375" data-expected-height=
"450">
173 <div class=
"cell firstRowFirstColumn" data-offset-x=
"302" data-offset-y=
"14" data-expected-width=
"20" data-expected-height=
"40"></div>
174 <div class=
"cell firstRowSecondColumn" data-offset-x=
"202" data-offset-y=
"14" data-expected-width=
"20" data-expected-height=
"40"></div>
175 <div class=
"cell secondRowFirstColumn" data-offset-x=
"302" data-offset-y=
"214" data-expected-width=
"20" data-expected-height=
"40"></div>
176 <div class=
"cell secondRowSecondColumn" data-offset-x=
"202" data-offset-y=
"214" data-expected-width=
"20" data-expected-height=
"40"></div>
181 <p>border:
5px
10px
15px
20px | padding:
10px
15px
20px
30px | margin:
4px
8px
12px
16px
<br>
182 direction: RTL | align-items: 'center' | justify-items: 'center'
</p>
183 <div class=
"grid directionRTL itemsCenter" data-expected-width=
"375" data-expected-height=
"450">
184 <div class=
"cell firstRowFirstColumn" data-offset-x=
"274" data-offset-y=
"86" data-expected-width=
"20" data-expected-height=
"40"></div>
185 <div class=
"stretch firstRowSecondColumn" data-offset-x=
"30" data-offset-y=
"10" data-expected-width=
"200" data-expected-height=
"200"></div>
186 <div class=
"stretch secondRowFirstColumn" data-offset-x=
"230" data-offset-y=
"210" data-expected-width=
"100" data-expected-height=
"200"></div>
187 <div class=
"cell secondRowSecondColumn" data-offset-x=
"124" data-offset-y=
"286" data-expected-width=
"20" data-expected-height=
"40"></div>
192 <p>border:
5px
10px
15px
20px | padding:
10px
15px
20px
30px | margin:
4px
8px
12px
16px
<br>
193 direction: RTL | align-items: 'end' | justify-items: 'end'
</p>
194 <div class=
"grid directionRTL itemsEnd" data-expected-width=
"375" data-expected-height=
"450">
195 <div class=
"cell firstRowFirstColumn" data-offset-x=
"246" data-offset-y=
"158" data-expected-width=
"20" data-expected-height=
"40"></div>
196 <div class=
"stretch firstRowSecondColumn" data-offset-x=
"30" data-offset-y=
"10" data-expected-width=
"200" data-expected-height=
"200"></div>
197 <div class=
"stretch secondRowFirstColumn" data-offset-x=
"230" data-offset-y=
"210" data-expected-width=
"100" data-expected-height=
"200"></div>
198 <div class=
"cell secondRowSecondColumn" data-offset-x=
"46" data-offset-y=
"358" data-expected-width=
"20" data-expected-height=
"40"></div>
203 <p>border:
5px
10px
15px
20px | padding:
10px
15px
20px
30px | margin:
4px
8px
12px
16px
<br>
204 direction: RTL | align-items: 'left' | justify-items: 'left'
</p>
205 <div class=
"grid directionRTL itemsLeft" data-expected-width=
"375" data-expected-height=
"450">
206 <div class=
"cell firstRowFirstColumn" data-offset-x=
"246" data-offset-y=
"14" data-expected-width=
"20" data-expected-height=
"40"></div>
207 <div class=
"stretch firstRowSecondColumn" data-offset-x=
"30" data-offset-y=
"10" data-expected-width=
"200" data-expected-height=
"200"></div>
208 <div class=
"stretch secondRowFirstColumn" data-offset-x=
"230" data-offset-y=
"210" data-expected-width=
"100" data-expected-height=
"200"></div>
209 <div class=
"cell secondRowSecondColumn" data-offset-x=
"46" data-offset-y=
"214" data-expected-width=
"20" data-expected-height=
"40"></div>
214 <p>border:
5px
10px
15px
20px | padding:
10px
15px
20px
30px | margin:
4px
8px
12px
16px
<br>
215 direction: RTL | align-items: 'right' | justify-items: 'right'
</p>
216 <div class=
"grid directionRTL itemsRight" data-expected-width=
"375" data-expected-height=
"450">
217 <div class=
"cell firstRowFirstColumn" data-offset-x=
"302" data-offset-y=
"14" data-expected-width=
"20" data-expected-height=
"40"></div>
218 <div class=
"stretch firstRowSecondColumn" data-offset-x=
"30" data-offset-y=
"10" data-expected-width=
"200" data-expected-height=
"200"></div>
219 <div class=
"stretch secondRowFirstColumn" data-offset-x=
"230" data-offset-y=
"210" data-expected-width=
"100" data-expected-height=
"200"></div>
220 <div class=
"cell secondRowSecondColumn" data-offset-x=
"202" data-offset-y=
"214" data-expected-width=
"20" data-expected-height=
"40"></div>
225 <p>border:
5px
10px
15px
20px | padding:
10px
15px
20px
30px | margin:
4px
8px
12px
16px
<br>
226 direction: RTL (ortho) | align-items: 'self-start' | justify-items: 'self-start'
</p>
227 <div class=
"grid directionRTL itemsSelfStart" data-expected-width=
"375" data-expected-height=
"450">
228 <div class=
"directionLTR cell firstRowFirstColumn" data-offset-x=
"246" data-offset-y=
"14" data-expected-width=
"20" data-expected-height=
"40"></div>
229 <div class=
"directionLTR stretch firstRowSecondColumn" data-offset-x=
"30" data-offset-y=
"10" data-expected-width=
"200" data-expected-height=
"200"></div>
230 <div class=
"directionLTR stretch secondRowFirstColumn" data-offset-x=
"230" data-offset-y=
"210" data-expected-width=
"100" data-expected-height=
"200"></div>
231 <div class=
"directionLTR cell secondRowSecondColumn" data-offset-x=
"46" data-offset-y=
"214" data-expected-width=
"20" data-expected-height=
"40"></div>
236 <p>border:
5px
10px
15px
20px | padding:
10px
15px
20px
30px | margin:
4px
8px
12px
16px
<br>
237 direction: RTL (ortho) | align-items: 'self-end' | justify-items: 'self-end'
</p>
238 <div class=
"grid directionRTL itemsSelfEnd" data-expected-width=
"375" data-expected-height=
"450">
239 <div class=
"directionLTR cell firstRowFirstColumn" data-offset-x=
"302" data-offset-y=
"158" data-expected-width=
"20" data-expected-height=
"40"></div>
240 <div class=
"directionLTR stretch firstRowSecondColumn" data-offset-x=
"30" data-offset-y=
"10" data-expected-width=
"200" data-expected-height=
"200"></div>
241 <div class=
"directionLTR stretch secondRowFirstColumn" data-offset-x=
"230" data-offset-y=
"210" data-expected-width=
"100" data-expected-height=
"200"></div>
242 <div class=
"directionLTR cell secondRowSecondColumn" data-offset-x=
"202" data-offset-y=
"358" data-expected-width=
"20" data-expected-height=
"40"></div>
247 <p>border:
5px
10px
15px
20px | padding:
10px
15px
20px
30px | margin:
4px
8px
12px
16px
<br>
248 direction: RTL (parall) | align-items: 'self-start' | justify-items: 'self-start'
</p>
249 <div class=
"grid directionRTL itemsSelfStart" data-expected-width=
"375" data-expected-height=
"450">
250 <div class=
"directionRTL cell firstRowFirstColumn" data-offset-x=
"302" data-offset-y=
"14" data-expected-width=
"20" data-expected-height=
"40"></div>
251 <div class=
"directionRTL stretch firstRowSecondColumn" data-offset-x=
"30" data-offset-y=
"10" data-expected-width=
"200" data-expected-height=
"200"></div>
252 <div class=
"directionRTL stretch secondRowFirstColumn" data-offset-x=
"230" data-offset-y=
"210" data-expected-width=
"100" data-expected-height=
"200"></div>
253 <div class=
"directionRTL cell secondRowSecondColumn" data-offset-x=
"202" data-offset-y=
"214" data-expected-width=
"20" data-expected-height=
"40"></div>
258 <p>border:
5px
10px
15px
20px | padding:
10px
15px
20px
30px | margin:
4px
8px
12px
16px
<br>
259 direction: RTL (parall) | align-items: 'self-end' | justify-items: 'self-end'
</p>
260 <div class=
"grid directionRTL itemsSelfEnd" data-expected-width=
"375" data-expected-height=
"450">
261 <div class=
"directionRTL cell firstRowFirstColumn" data-offset-x=
"246" data-offset-y=
"158" data-expected-width=
"20" data-expected-height=
"40"></div>
262 <div class=
"directionRTL stretch firstRowSecondColumn" data-offset-x=
"30" data-offset-y=
"10" data-expected-width=
"200" data-expected-height=
"200"></div>
263 <div class=
"directionRTL stretch secondRowFirstColumn" data-offset-x=
"230" data-offset-y=
"210" data-expected-width=
"100" data-expected-height=
"200"></div>
264 <div class=
"directionRTL cell secondRowSecondColumn" data-offset-x=
"46" data-offset-y=
"358" data-expected-width=
"20" data-expected-height=
"40"></div>