4 <link href=
"resources/grid.css" rel=
"stylesheet">
5 <style type=
"text/css">
8 grid-template-areas: ". a a"
14 grid-template-areas: ". a-start a-start"
20 grid-template-columns: 50px 100px 200px;
21 grid-template-rows: 50px 100px 200px;
25 grid-template-columns: [a
] 50px [b b-start
] 100px [c
-start
] 200px [d
];
26 grid-template-rows: [e
] 50px [f
-end
] 100px [g g-start
] 200px [h
];
29 .gridWithNamedLineBeforeGridArea {
30 grid-template-columns: [a-start c-start
] 50px [d-start
] 100px 200px;
31 grid-template-rows: [c-start
] 50px [d-start
] 100px 200px;
34 .gridWithNamedLineAfterGridArea {
35 grid-template-columns: 50px 100px [a-start
] 200px;
36 grid-template-rows: 50px 100px [c-start
] 200px;
40 grid-template-columns: 50px 100px [a-end
] 200px [c-end
];
41 grid-template-rows: 50px [c-end
] 100px [d-end
] 200px;
45 grid-template-columns: [d-start
] 50px [d-start
] 100px [d-start
] 200px;
46 grid-template-rows: 50px [c-end
] 100px [c-end
] 200px [c-end
];
50 grid-template-columns: 50px [z-start
] 100px [z-end
] 200px;
51 grid-template-rows: 50px [z-start
] 100px 200px [z-end
];
55 <script src=
"../../resources/check-layout.js"></script>
57 <body onload=
"checkLayout('.grid')">
59 <p>This test checks that we resolve named grid line per the specification.
</p>
61 <!-- Check positioning using unique grid-line names -->
62 <div style=
"position: relative">
63 <div class=
"grid gridUniqueNames">
64 <div class=
"sizedToGridArea" style=
"grid-column: b;" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"50"></div>
65 <div class=
"sizedToGridArea" style=
"grid-row: e;" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"50" data-expected-height=
"50"></div>
66 <div class=
"sizedToGridArea" style=
"grid-column: b-start;" data-offset-x=
"50" data-offset-y=
"50" data-expected-width=
"100" data-expected-height=
"100"></div>
67 <div class=
"sizedToGridArea" style=
"grid-row: g-start;" data-offset-x=
"0" data-offset-y=
"150" data-expected-width=
"50" data-expected-height=
"200"></div>
71 <div style=
"position: relative">
72 <div class=
"grid gridUniqueNames">
73 <div class=
"sizedToGridArea" style=
"grid-column: b / d;" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"300" data-expected-height=
"50"></div>
74 <div class=
"sizedToGridArea" style=
"grid-row: g / h;" data-offset-x=
"0" data-offset-y=
"150" data-expected-width=
"50" data-expected-height=
"200"></div>
75 <div class=
"sizedToGridArea" style=
"grid-column: c; grid-row: f;" data-offset-x=
"150" data-offset-y=
"50" data-expected-width=
"200" data-expected-height=
"100"></div>
79 <!-- Check positioning using unique grid-line names mixed with integers -->
80 <div style=
"position: relative">
81 <div class=
"grid gridUniqueNames">
82 <div class=
"sizedToGridArea" style=
"grid-column: b / 4;" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"300" data-expected-height=
"50"></div>
83 <div class=
"sizedToGridArea" style=
"grid-row: 3 / h;" data-offset-x=
"0" data-offset-y=
"150" data-expected-width=
"50" data-expected-height=
"200"></div>
84 <div class=
"sizedToGridArea" style=
"grid-column: 2; grid-row: g;" data-offset-x=
"50" data-offset-y=
"150" data-expected-width=
"100" data-expected-height=
"200"></div>
85 <div class=
"sizedToGridArea" style=
"grid-column: a; grid-row: 2;" data-offset-x=
"0" data-offset-y=
"50" data-expected-width=
"50" data-expected-height=
"100"></div>
89 <!-- Check that without named gridAreas there are no implicit grid-line names defined -->
90 <div style=
"position: relative">
91 <div class=
"grid gridUniqueNames">
92 <div class=
"sizedToGridArea" style=
"grid-column: c-start;" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"50" data-expected-height=
"50"></div>
93 <div class=
"sizedToGridArea" style=
"grid-row: f-start;" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"50"></div>
94 <div class=
"sizedToGridArea" style=
"grid-column: c-start; grid-row: f-end" data-offset-x=
"150" data-offset-y=
"0" data-expected-width=
"200" data-expected-height=
"50"></div>
95 <div class=
"sizedToGridArea" style=
"grid-column: b-end; grid-row: h-start" data-offset-x=
"0" data-offset-y=
"50" data-expected-width=
"50" data-expected-height=
"100"></div>
99 <!-- Check that gridArea's implicit names are well defined -->
100 <div style=
"position: relative">
101 <div class=
"grid gridAreas gridNoLineNames">
102 <div class=
"sizedToGridArea" style=
"grid-column: a-start; grid-row: d-start;" data-offset-x=
"50" data-offset-y=
"150" data-expected-width=
"100" data-expected-height=
"200"></div>
103 <div class=
"sizedToGridArea" style=
"grid-column: a-start; grid-row: d;" data-offset-x=
"50" data-offset-y=
"150" data-expected-width=
"100" data-expected-height=
"200"></div>
104 <div class=
"sizedToGridArea" style=
"grid-column: d-start; grid-row: c-start;" data-offset-x=
"150" data-offset-y=
"50" data-expected-width=
"200" data-expected-height=
"100"></div>
108 <!-- Check positioning using grid areas -->
109 <div style=
"position: relative">
110 <div class=
"grid gridAreas gridNoLineNames gridAutoFlowRowDense">
111 <div class=
"sizedToGridArea" style=
"grid-column: d;" data-offset-x=
"150" data-offset-y=
"0" data-expected-width=
"200" data-expected-height=
"50"></div>
112 <div class=
"sizedToGridArea" style=
"grid-row: d;" data-offset-x=
"0" data-offset-y=
"150" data-expected-width=
"50" data-expected-height=
"200"></div>
113 <div class=
"sizedToGridArea" style=
"grid-column: c;" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"50" data-expected-height=
"50"></div>
114 <div class=
"sizedToGridArea" style=
"grid-row: c;" data-offset-x=
"0" data-offset-y=
"50" data-expected-width=
"50" data-expected-height=
"100"></div>
118 <div style=
"position: relative">
119 <div class=
"grid gridAreas gridNoLineNames">
120 <div class=
"sizedToGridArea" style=
"grid-column: a;" data-offset-x=
"50" data-offset-y=
"150" data-expected-width=
"300" data-expected-height=
"200"></div>
121 <div class=
"sizedToGridArea" style=
"grid-row: a;" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"50" data-expected-height=
"150"></div>
122 <div class=
"sizedToGridArea" style=
"grid-column: a; grid-row: a;" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"300" data-expected-height=
"150"></div>
126 <!-- Use grid area's implicit line names if defined before explicitly named grid lines -->
127 <div style=
"position: relative">
128 <div class=
"grid gridAreas gridWithNamedLineAfterGridArea gridAutoFlowRowDense">
129 <div class=
"sizedToGridArea" style=
"grid-column: d;" data-offset-x=
"150" data-offset-y=
"0" data-expected-width=
"200" data-expected-height=
"50"></div>
130 <div class=
"sizedToGridArea" style=
"grid-row: d;" data-offset-x=
"0" data-offset-y=
"150" data-expected-width=
"50" data-expected-height=
"200"></div>
131 <div class=
"sizedToGridArea" style=
"grid-column: c;" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"50" data-expected-height=
"50"></div>
132 <div class=
"sizedToGridArea" style=
"grid-row: c;" data-offset-x=
"0" data-offset-y=
"50" data-expected-width=
"50" data-expected-height=
"100"></div>
136 <div style=
"position: relative">
137 <div class=
"grid gridAreas gridWithNamedLineAfterGridArea">
138 <div class=
"sizedToGridArea" style=
"grid-column-start: a-start;" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"50"></div>
139 <div class=
"sizedToGridArea" style=
"grid-row-start: c-start;" data-offset-x=
"0" data-offset-y=
"50" data-expected-width=
"50" data-expected-height=
"100"></div>
143 <div style=
"position: relative">
144 <div class=
"grid gridAreas gridWithNamedLineAfterGridArea">
145 <div class=
"sizedToGridArea" style=
"grid-column: a;" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"300" data-expected-height=
"50"></div>
146 <div class=
"sizedToGridArea" style=
"grid-row: d;" data-offset-x=
"0" data-offset-y=
"150" data-expected-width=
"50" data-expected-height=
"200"></div>
147 <div class=
"sizedToGridArea" style=
"grid-column: a; grid-row: d;" data-offset-x=
"50" data-offset-y=
"150" data-expected-width=
"300" data-expected-height=
"200"></div>
151 <!-- Use explicitly named grid lines if they're defined before the grid area -->
152 <div style=
"position: relative">
153 <div class=
"grid gridAreas gridWithNamedLineBeforeGridArea">
154 <div class=
"sizedToGridArea" style=
"grid-column: d;" data-offset-x=
"50" data-offset-y=
"150" data-expected-width=
"300" data-expected-height=
"200"></div>
155 <div class=
"sizedToGridArea" style=
"grid-row: d;" data-offset-x=
"0" data-offset-y=
"50" data-expected-width=
"50" data-expected-height=
"300"></div>
156 <div class=
"sizedToGridArea" style=
"grid-column: c;" data-offset-x=
"0" data-offset-y=
"350" data-expected-width=
"50" data-expected-height=
"0"></div>
157 <div class=
"sizedToGridArea" style=
"grid-row: c;" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"150"></div>
161 <div style=
"position: relative">
162 <div class=
"grid gridAreas gridWithNamedLineBeforeGridArea">
163 <div class=
"sizedToGridArea" style=
"grid-column-start: d-start;" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"50"></div>
164 <div class=
"sizedToGridArea" style=
"grid-row-start: d-start;" data-offset-x=
"0" data-offset-y=
"50" data-expected-width=
"50" data-expected-height=
"100"></div>
168 <div style=
"position: relative">
169 <div class=
"grid gridAreas gridWithNamedLineBeforeGridArea">
170 <div class=
"sizedToGridArea" style=
"grid-column: a;" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"350" data-expected-height=
"50"></div>
171 <div class=
"sizedToGridArea" style=
"grid-row: d;" data-offset-x=
"350" data-offset-y=
"50" data-expected-width=
"0" data-expected-height=
"300"></div>
172 <div class=
"sizedToGridArea" style=
"grid-column: a; grid-row: d;" data-offset-x=
"0" data-offset-y=
"50" data-expected-width=
"350" data-expected-height=
"300"></div>
176 <!-- Check that a "-start" ident in a end column or a "-end" ident in a start column is not treated as a implicit grid line of a grid area -->
177 <div style=
"position: relative">
178 <div class=
"grid gridAreas gridNoLineNames">
179 <div class=
"sizedToGridArea" style=
"grid-column: a / a-start; grid-row: d-start;" data-offset-x=
"50" data-offset-y=
"150" data-expected-width=
"100" data-expected-height=
"200"></div>
180 <div class=
"sizedToGridArea" style=
"grid-column: d / d-start; grid-row: c-start;" data-offset-x=
"150" data-offset-y=
"50" data-expected-width=
"200" data-expected-height=
"100"></div>
181 <div class=
"sizedToGridArea" style=
"grid-column: c; grid-row: a / a-start;" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"50" data-expected-height=
"50"></div>
182 <div class=
"sizedToGridArea" style=
"grid-column: d; grid-row: c / c-start;" data-offset-x=
"150" data-offset-y=
"50" data-expected-width=
"200" data-expected-height=
"100"></div>
186 <!-- Check that we propertly resolve explicit "-end" lines inside grid areas -->
187 <div style=
"position: relative">
188 <div class=
"grid gridAreas gridWithEndLines">
189 <div class=
"sizedToGridArea" style=
"grid-column: a" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"50"></div>
190 <div class=
"sizedToGridArea" style=
"grid-column: a; grid-row: c" data-offset-x=
"50" data-offset-y=
"50" data-expected-width=
"100" data-expected-height=
"100"></div>
191 <div class=
"sizedToGridArea" style=
"grid-row: d;" data-offset-x=
"0" data-offset-y=
"150" data-expected-width=
"50" data-expected-height=
"200"></div>
192 <div class=
"sizedToGridArea" style=
"grid-column: a; grid-row: d;" data-offset-x=
"50" data-offset-y=
"150" data-expected-width=
"100" data-expected-height=
"200"></div>
196 <!-- Check that we always pick the first definition when multiple grid lines have the same name -->
197 <div style=
"position: relative">
198 <div class=
"grid gridAreas gridRepeatedNames">
199 <div class=
"sizedToGridArea" style=
"grid-column: d; grid-row: c" data-offset-x=
"0" data-offset-y=
"50" data-expected-width=
"350" data-expected-height=
"100"></div>
200 <div class=
"sizedToGridArea" style=
"grid-column: d-start / d-end; grid-row: c-start / c-end" data-offset-x=
"0" data-offset-y=
"50" data-expected-width=
"350" data-expected-height=
"100"></div>
201 <div class=
"sizedToGridArea" style=
"grid-column: c; grid-row: d" data-offset-x=
"0" data-offset-y=
"150" data-expected-width=
"50" data-expected-height=
"200"></div>
205 <!-- Check behavior with areas named *-start or *-end -->
206 <div style=
"position: relative">
207 <div class=
"grid gridAreasSpecial gridNoLineNames">
208 <div class=
"sizedToGridArea" style=
"grid-column: a;" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"50" data-expected-height=
"50"></div>
209 <div class=
"sizedToGridArea" style=
"grid-row: a;" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"50"></div>
210 <div class=
"sizedToGridArea" style=
"grid-column: a; grid-row: a;" data-offset-x=
"150" data-offset-y=
"0" data-expected-width=
"200" data-expected-height=
"50"></div>
214 <div style=
"position: relative">
215 <div class=
"grid gridAreasSpecial gridNoLineNames">
216 <div class=
"sizedToGridArea" style=
"grid-column: a-start;" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"300" data-expected-height=
"50"></div>
217 <div class=
"sizedToGridArea" style=
"grid-row: a-end;" data-offset-x=
"0" data-offset-y=
"50" data-expected-width=
"50" data-expected-height=
"100"></div>
218 <div class=
"sizedToGridArea" style=
"grid-column: a-start; grid-row: a-end;" data-offset-x=
"50" data-offset-y=
"50" data-expected-width=
"300" data-expected-height=
"100"></div>
222 <div style=
"position: relative">
223 <div class=
"grid gridAreasSpecial gridWithNamedLineBeforeGridArea">
224 <div class=
"sizedToGridArea" style=
"grid-column: a-start;" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"300" data-expected-height=
"50"></div>
225 <div class=
"sizedToGridArea" style=
"grid-row: a-end;" data-offset-x=
"0" data-offset-y=
"50" data-expected-width=
"50" data-expected-height=
"100"></div>
226 <div class=
"sizedToGridArea" style=
"grid-column: a-start; grid-row: a-end;" data-offset-x=
"50" data-offset-y=
"50" data-expected-width=
"300" data-expected-height=
"100"></div>
230 <div style=
"position: relative">
231 <div class=
"grid gridAreasSpecial gridWithNamedLineAfterGridArea">
232 <div class=
"sizedToGridArea" style=
"grid-column: a-start;" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"300" data-expected-height=
"50"></div>
233 <div class=
"sizedToGridArea" style=
"grid-row: d;" data-offset-x=
"0" data-offset-y=
"150" data-expected-width=
"50" data-expected-height=
"200"></div>
234 <div class=
"sizedToGridArea" style=
"grid-column: a-start; grid-row: d;" data-offset-x=
"50" data-offset-y=
"150" data-expected-width=
"300" data-expected-height=
"200"></div>
238 <!-- Check behavior with lines named *-start or *-end -->
239 <div style=
"position: relative">
240 <div class=
"grid gridAreasSpecial gridUniqueNames">
241 <div class=
"sizedToGridArea" style=
"grid-column: -start;" data-offset-x=
"150" data-offset-y=
"0" data-expected-width=
"200" data-expected-height=
"50"></div>
242 <div class=
"sizedToGridArea" style=
"grid-row: -end;" data-offset-x=
"0" data-offset-y=
"50" data-expected-width=
"50" data-expected-height=
"100"></div>
243 <div class=
"sizedToGridArea" style=
"grid-column-end: -start; grid-row-start: -end;" data-offset-x=
"50" data-offset-y=
"50" data-expected-width=
"100" data-expected-height=
"100"></div>
247 <!-- Check that <custom-ident>-{start|end} named lines define implicit named areas -->
248 <div style=
"position: relative">
249 <div class=
"grid gridAreas gridImplicitArea">
250 <div class=
"sizedToGridArea" style=
"grid-column: z;" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"50"></div>
251 <div class=
"sizedToGridArea" style=
"grid-row: z;" data-offset-x=
"0" data-offset-y=
"50" data-expected-width=
"50" data-expected-height=
"300"></div>
252 <div class=
"sizedToGridArea" style=
"grid-column-end: z; grid-row-start: z;" data-offset-x=
"50" data-offset-y=
"50" data-expected-width=
"100" data-expected-height=
"100"></div>