OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <link href="resources/grid.css" rel="stylesheet"> |
| 5 <style type="text/css"> |
| 6 |
| 7 .gridAreas { |
| 8 grid-template-areas: ". a a" |
| 9 "c a a" |
| 10 ". . d"; |
| 11 } |
| 12 |
| 13 .gridAreasSpecial { |
| 14 grid-template-areas: ". a-start a-start" |
| 15 "c a-end a-end" |
| 16 ". . d"; |
| 17 } |
| 18 |
| 19 .gridNoLineNames { |
| 20 grid-template-columns: 50px 100px 200px; |
| 21 grid-template-rows: 50px 100px 200px; |
| 22 } |
| 23 |
| 24 .gridUniqueNames { |
| 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); |
| 27 } |
| 28 |
| 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; |
| 32 } |
| 33 |
| 34 .gridWithNamedLineAfterGridArea { |
| 35 grid-template-columns: 50px 100px (a-start) 200px; |
| 36 grid-template-rows: 50px 100px (c-start) 200px; |
| 37 } |
| 38 |
| 39 .gridWithEndLines { |
| 40 grid-template-columns: 50px 100px (a-end) 200px (c-end); |
| 41 grid-template-rows: 50px (c-end) 100px (d-end) 200px; |
| 42 } |
| 43 |
| 44 .gridRepeatedNames { |
| 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); |
| 47 } |
| 48 |
| 49 </style> |
| 50 <script src="../../resources/check-layout.js"></script> |
| 51 </head> |
| 52 <body onload="checkLayout('.grid')"> |
| 53 |
| 54 <p>This test checks that we resolve named grid line per the specification.</p> |
| 55 |
| 56 <!-- Check positioning using unique grid-line names --> |
| 57 <div style="position: relative"> |
| 58 <div class="grid gridUniqueNames"> |
| 59 <div class="sizedToGridArea" style="grid-column: 'b';" data-offset-x="50" da
ta-offset-y="0" data-expected-width="100" data-expected-height="50"></div> |
| 60 <div class="sizedToGridArea" style="grid-row: 'e';" data-offset-x="0" data-o
ffset-y="0" data-expected-width="50" data-expected-height="50"></div> |
| 61 <div class="sizedToGridArea" style="grid-column: 'b-start';" data-offset-x="
50" data-offset-y="0" data-expected-width="100" data-expected-height="50"></div> |
| 62 <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> |
| 63 </div> |
| 64 </div> |
| 65 |
| 66 <div style="position: relative"> |
| 67 <div class="grid gridUniqueNames"> |
| 68 <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> |
| 69 <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> |
| 70 <div class="sizedToGridArea" style="grid-column: 'c'; grid-row: 'f';" data-o
ffset-x="150" data-offset-y="50" data-expected-width="200" data-expected-height=
"100"></div> |
| 71 </div> |
| 72 </div> |
| 73 |
| 74 <!-- Check positioning using unique grid-line names mixed with integers --> |
| 75 <div style="position: relative"> |
| 76 <div class="grid gridUniqueNames"> |
| 77 <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> |
| 78 <div class="sizedToGridArea" style="grid-row: 3 / 'h';" data-offset-x="0" da
ta-offset-y="150" data-expected-width="50" data-expected-height="200"></div> |
| 79 <div class="sizedToGridArea" style="grid-column: 2; grid-row: 'g';" data-off
set-x="50" data-offset-y="150" data-expected-width="100" data-expected-height="2
00"></div> |
| 80 <div class="sizedToGridArea" style="grid-column: 'a'; grid-row: 2;" data-off
set-x="0" data-offset-y="50" data-expected-width="50" data-expected-height="100"
></div> |
| 81 </div> |
| 82 </div> |
| 83 |
| 84 <!-- Check that without named gridAreas there are no implicit grid-line names de
fined --> |
| 85 <div style="position: relative"> |
| 86 <div class="grid gridUniqueNames"> |
| 87 <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> |
| 88 <div class="sizedToGridArea" style="grid-row: 'f-start';" data-offset-x="0"
data-offset-y="0" data-expected-width="50" data-expected-height="50"></div> |
| 89 <div class="sizedToGridArea" style="grid-column: 'c-start'; grid-row: 'f-end
'" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-he
ight="50"></div> |
| 90 <div class="sizedToGridArea" style="grid-column: 'b-end'; grid-row: 'h-start
'" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-he
ight="50"></div> |
| 91 </div> |
| 92 </div> |
| 93 |
| 94 <!-- Check that gridArea's implicit names are well defined --> |
| 95 <div style="position: relative"> |
| 96 <div class="grid gridAreas gridNoLineNames"> |
| 97 <div class="sizedToGridArea" style="grid-column: 'a-start'; grid-row: 'd-sta
rt';" data-offset-x="50" data-offset-y="150" data-expected-width="100" data-expe
cted-height="200"></div> |
| 98 <div class="sizedToGridArea" style="grid-column: 'a-start'; grid-row: d;" da
ta-offset-x="50" data-offset-y="150" data-expected-width="100" data-expected-hei
ght="200"></div> |
| 99 <div class="sizedToGridArea" style="grid-column: 'd-start'; grid-row: 'c-sta
rt';" data-offset-x="150" data-offset-y="50" data-expected-width="200" data-expe
cted-height="100"></div> |
| 100 </div> |
| 101 </div> |
| 102 |
| 103 <!-- Check positioning using grid areas --> |
| 104 <div style="position: relative"> |
| 105 <div class="grid gridAreas gridNoLineNames"> |
| 106 <div class="sizedToGridArea" style="grid-column: d;" data-offset-x="150" dat
a-offset-y="0" data-expected-width="200" data-expected-height="50"></div> |
| 107 <div class="sizedToGridArea" style="grid-row: d;" data-offset-x="0" data-off
set-y="150" data-expected-width="50" data-expected-height="200"></div> |
| 108 <div class="sizedToGridArea" style="grid-column: c;" data-offset-x="0" data-
offset-y="0" data-expected-width="50" data-expected-height="50"></div> |
| 109 <div class="sizedToGridArea" style="grid-row: c;" data-offset-x="0" data-off
set-y="50" data-expected-width="50" data-expected-height="100"></div> |
| 110 </div> |
| 111 </div> |
| 112 |
| 113 <div style="position: relative"> |
| 114 <div class="grid gridAreas gridNoLineNames"> |
| 115 <div class="sizedToGridArea" style="grid-column: a;" data-offset-x="50" data
-offset-y="0" data-expected-width="300" data-expected-height="50"></div> |
| 116 <div class="sizedToGridArea" style="grid-row: a;" data-offset-x="0" data-off
set-y="0" data-expected-width="50" data-expected-height="150"></div> |
| 117 <div class="sizedToGridArea" style="grid-column: a; grid-row: a;" data-offse
t-x="50" data-offset-y="0" data-expected-width="300" data-expected-height="150">
</div> |
| 118 </div> |
| 119 </div> |
| 120 |
| 121 <!-- Use grid area's implicit line names if defined before explicitly named grid
lines --> |
| 122 <div style="position: relative"> |
| 123 <div class="grid gridAreas gridWithNamedLineAfterGridArea"> |
| 124 <div class="sizedToGridArea" style="grid-column: d;" data-offset-x="150" dat
a-offset-y="0" data-expected-width="200" data-expected-height="50"></div> |
| 125 <div class="sizedToGridArea" style="grid-row: d;" data-offset-x="0" data-off
set-y="150" data-expected-width="50" data-expected-height="200"></div> |
| 126 <div class="sizedToGridArea" style="grid-column: c;" data-offset-x="0" data-
offset-y="0" data-expected-width="50" data-expected-height="50"></div> |
| 127 <div class="sizedToGridArea" style="grid-row: c;" data-offset-x="0" data-off
set-y="50" data-expected-width="50" data-expected-height="100"></div> |
| 128 </div> |
| 129 </div> |
| 130 |
| 131 <div style="position: relative"> |
| 132 <div class="grid gridAreas gridWithNamedLineAfterGridArea"> |
| 133 <div class="sizedToGridArea" style="grid-column-start: 'a-start';" data-offs
et-x="50" data-offset-y="0" data-expected-width="100" data-expected-height="50">
</div> |
| 134 <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"></d
iv> |
| 135 </div> |
| 136 </div> |
| 137 |
| 138 <div style="position: relative"> |
| 139 <div class="grid gridAreas gridWithNamedLineAfterGridArea"> |
| 140 <div class="sizedToGridArea" style="grid-column: a;" data-offset-x="50" data
-offset-y="0" data-expected-width="300" data-expected-height="50"></div> |
| 141 <div class="sizedToGridArea" style="grid-row: d;" data-offset-x="0" data-off
set-y="150" data-expected-width="50" data-expected-height="200"></div> |
| 142 <div class="sizedToGridArea" style="grid-column: a; grid-row: d;" data-offse
t-x="50" data-offset-y="150" data-expected-width="300" data-expected-height="200
"></div> |
| 143 </div> |
| 144 </div> |
| 145 |
| 146 <!-- Use explicitly named grid lines if they're defined before the grid area --> |
| 147 <div style="position: relative"> |
| 148 <div class="grid gridAreas gridWithNamedLineBeforeGridArea"> |
| 149 <div class="sizedToGridArea" style="grid-column: d;" data-offset-x="50" data
-offset-y="0" data-expected-width="300" data-expected-height="50"></div> |
| 150 <div class="sizedToGridArea" style="grid-row: d;" data-offset-x="0" data-off
set-y="50" data-expected-width="50" data-expected-height="300"></div> |
| 151 <div class="sizedToGridArea" style="grid-column: c;" data-offset-x="0" data-
offset-y="0" data-expected-width="50" data-expected-height="50"></div> |
| 152 <div class="sizedToGridArea" style="grid-row: c;" data-offset-x="0" data-off
set-y="0" data-expected-width="50" data-expected-height="150"></div> |
| 153 </div> |
| 154 </div> |
| 155 |
| 156 <div style="position: relative"> |
| 157 <div class="grid gridAreas gridWithNamedLineBeforeGridArea"> |
| 158 <div class="sizedToGridArea" style="grid-column-start: 'd-start';" data-offs
et-x="50" data-offset-y="0" data-expected-width="100" data-expected-height="50">
</div> |
| 159 <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"></d
iv> |
| 160 </div> |
| 161 </div> |
| 162 |
| 163 <div style="position: relative"> |
| 164 <div class="grid gridAreas gridWithNamedLineBeforeGridArea"> |
| 165 <div class="sizedToGridArea" style="grid-column: a;" data-offset-x="0" data-
offset-y="0" data-expected-width="350" data-expected-height="50"></div> |
| 166 <div class="sizedToGridArea" style="grid-row: d;" data-offset-x="0" data-off
set-y="50" data-expected-width="50" data-expected-height="300"></div> |
| 167 <div class="sizedToGridArea" style="grid-column: a; grid-row: d;" data-offse
t-x="0" data-offset-y="50" data-expected-width="350" data-expected-height="300">
</div> |
| 168 </div> |
| 169 </div> |
| 170 |
| 171 <!-- Check that a "-start" ident in a end column or a "-end" ident in a start co
lumn is not treated as a implicit grid line of a grid area --> |
| 172 <div style="position: relative"> |
| 173 <div class="grid gridAreas gridNoLineNames"> |
| 174 <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> |
| 175 <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> |
| 176 <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-hei
ght="50"></div> |
| 177 <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> |
| 178 </div> |
| 179 </div> |
| 180 |
| 181 <!-- Check that we propertly resolve explicit "-end" lines inside grid areas --> |
| 182 <div style="position: relative"> |
| 183 <div class="grid gridAreas gridWithEndLines"> |
| 184 <div class="sizedToGridArea" style="grid-column: a" data-offset-x="50" data-
offset-y="0" data-expected-width="100" data-expected-height="50"></div> |
| 185 <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> |
| 186 <div class="sizedToGridArea" style="grid-row: d;" data-offset-x="0" data-off
set-y="150" data-expected-width="50" data-expected-height="200"></div> |
| 187 <div class="sizedToGridArea" style="grid-column: a; grid-row: d;" data-offse
t-x="50" data-offset-y="150" data-expected-width="100" data-expected-height="200
"></div> |
| 188 </div> |
| 189 </div> |
| 190 |
| 191 <!-- Check that we always pick the first definition when multiple grid lines hav
e the same name --> |
| 192 <div style="position: relative"> |
| 193 <div class="grid gridAreas gridRepeatedNames"> |
| 194 <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> |
| 195 <div class="sizedToGridArea" style="grid-column: 'd-start' / 'd-end'; grid-r
ow: 'c-start' / 'c-end'" data-offset-x="0" data-offset-y="50" data-expected-widt
h="350" data-expected-height="100"></div> |
| 196 <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> |
| 197 </div> |
| 198 </div> |
| 199 |
| 200 <!-- Check behavior with areas named *-start or *-end --> |
| 201 <div style="position: relative"> |
| 202 <div class="grid gridAreasSpecial gridNoLineNames"> |
| 203 <div class="sizedToGridArea" style="grid-column: a;" data-offset-x="0" data-
offset-y="0" data-expected-width="50" data-expected-height="50"></div> |
| 204 <div class="sizedToGridArea" style="grid-row: a;" data-offset-x="0" data-off
set-y="0" data-expected-width="50" data-expected-height="50"></div> |
| 205 <div class="sizedToGridArea" style="grid-column: a; grid-row: a;" data-offse
t-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="50"></d
iv> |
| 206 </div> |
| 207 </div> |
| 208 |
| 209 <div style="position: relative"> |
| 210 <div class="grid gridAreasSpecial gridNoLineNames"> |
| 211 <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> |
| 212 <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> |
| 213 <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-he
ight="100"></div> |
| 214 </div> |
| 215 </div> |
| 216 |
| 217 <div style="position: relative"> |
| 218 <div class="grid gridAreasSpecial gridWithNamedLineBeforeGridArea"> |
| 219 <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> |
| 220 <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> |
| 221 <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-he
ight="100"></div> |
| 222 </div> |
| 223 </div> |
| 224 |
| 225 <div style="position: relative"> |
| 226 <div class="grid gridAreasSpecial gridWithNamedLineAfterGridArea"> |
| 227 <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> |
| 228 <div class="sizedToGridArea" style="grid-row: d;" data-offset-x="0" data-off
set-y="150" data-expected-width="50" data-expected-height="200"></div> |
| 229 <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-heigh
t="200"></div> |
| 230 </div> |
| 231 </div> |
| 232 |
| 233 <!-- Check behavior with lines named *-start or *-end --> |
| 234 <div style="position: relative"> |
| 235 <div class="grid gridAreasSpecial gridUniqueNames"> |
| 236 <div class="sizedToGridArea" style="grid-column: '-start';" data-offset-x="1
50" data-offset-y="0" data-expected-width="200" data-expected-height="50"></div> |
| 237 <div class="sizedToGridArea" style="grid-row: '-end';" data-offset-x="0" dat
a-offset-y="50" data-expected-width="50" data-expected-height="100"></div> |
| 238 <div class="sizedToGridArea" style="grid-column-end: '-start'; grid-row-star
t: '-end';" data-offset-x="50" data-offset-y="50" data-expected-width="100" data
-expected-height="100"></div> |
| 239 </div> |
| 240 </div> |
| 241 |
| 242 </body> |
| 243 </html> |
OLD | NEW |