3 <link href=
"resources/grid.css" rel=
"stylesheet">
6 grid-template-columns: [first]
50px [middle]
100px [last];
7 grid-template-rows: [first]
50px [middle]
100px [last];
8 /* To detect how much we extend the grid. */
9 grid-auto-columns:
200px;
10 grid-auto-rows:
200px;
12 /* Make the grid shrink-to-fit. */
16 .negativeStartPositionGrowGridInColumnDirection {
17 grid-column: -
1 / auto;
21 .negativeStartPositionGrowGridInRowDirection {
26 .lastNamedGridLineStartPositionGrowGridInRowDirection {
31 .lastNamedGridLineStartPositionGrowGridInColumnDirection {
32 grid-column: last / auto;
36 .negativeStartPositionGrowGridInRowDirection {
38 grid-row: last / auto;
41 .endSpanGrowGridInColumnDirection {
42 grid-column: -
2 / span
3;
46 .endSpanGrowGridInRowDirection {
48 grid-row: -
2 / span
3;
51 .namedEndSpanGrowGridInColumnDirection {
52 grid-column: -
1 middle / span
3;
56 .namedEndSpanGrowGridInRowDirection {
58 grid-row:
2 middle / span
3;
61 .negativeEndPositionStartSpanInColumnDirection {
62 grid-column: span / -
1;
66 .negativeEndPositionStartSpanInRowDirection {
68 grid-row: span
5 / -
1;
71 .negativeNamedGridLineEndPositionStartSpanInColumnDirection {
72 grid-column: span / last;
76 .negativeNamedGridLineEndPositionStartSpanInRowDirection {
78 grid-row: span
5 / last;
81 .negativeEndPositionStartNegativeInColumnDirection {
86 .negativeEndPositionStartNegativeInRowDirection {
91 .namedGridLineEndPositionStartNegativeInColumnDirection {
92 grid-column: -
3 /
10 last;
96 .namedGridLineEndPositionStartNegativeInRowDirection {
97 grid-column: -
5 / -
2 middle;
101 <script src=
"../../resources/check-layout.js"></script>
102 <body onload=
"checkLayout('.grid');">
104 <p>Test that negative grid positions are correctly resolved.
</p>
106 <div style=
"position: relative">
107 <div class=
"grid" data-expected-width=
"350" data-expected-height=
"150">
108 <div class=
"sizedToGridArea negativeStartPositionGrowGridInColumnDirection" data-offset-x=
"150" data-offset-y=
"0" data-expected-width=
"200" data-expected-height=
"50"></div>
112 <div style=
"position: relative">
113 <div class=
"grid" data-expected-width=
"150" data-expected-height=
"350">
114 <div class=
"sizedToGridArea lastNamedGridLineStartPositionGrowGridInRowDirection" data-offset-x=
"0" data-offset-y=
"150" data-expected-width=
"50" data-expected-height=
"200"></div>
118 <div style=
"position: relative">
119 <div class=
"grid" data-expected-width=
"350" data-expected-height=
"150">
120 <div class=
"sizedToGridArea lastNamedGridLineStartPositionGrowGridInColumnDirection" data-offset-x=
"150" data-offset-y=
"0" data-expected-width=
"200" data-expected-height=
"50"></div>
124 <div style=
"position: relative">
125 <div class=
"grid" data-expected-width=
"150" data-expected-height=
"350">
126 <div class=
"sizedToGridArea negativeStartPositionGrowGridInRowDirection" data-offset-x=
"0" data-offset-y=
"150" data-expected-width=
"50" data-expected-height=
"200"></div>
130 <div style=
"position: relative">
131 <div class=
"grid" data-expected-width=
"550" data-expected-height=
"150">
132 <div class=
"sizedToGridArea endSpanGrowGridInColumnDirection" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"500" data-expected-height=
"50"></div>
136 <div style=
"position: relative">
137 <div class=
"grid" data-expected-width=
"150" data-expected-height=
"550">
138 <div class=
"sizedToGridArea endSpanGrowGridInRowDirection" data-offset-x=
"0" data-offset-y=
"50" data-expected-width=
"50" data-expected-height=
"500"></div>
142 <div style=
"position: relative">
143 <div class=
"grid" data-expected-width=
"550" data-expected-height=
"150">
144 <div class=
"sizedToGridArea namedEndSpanGrowGridInColumnDirection" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"500" data-expected-height=
"50"></div>
148 <div style=
"position: relative">
149 <div class=
"grid" data-expected-width=
"150" data-expected-height=
"550">
150 <div class=
"sizedToGridArea namedEndSpanGrowGridInRowDirection" data-offset-x=
"0" data-offset-y=
"50" data-expected-width=
"50" data-expected-height=
"500"></div>
154 <div style=
"position: relative">
155 <div class=
"grid" data-expected-width=
"150" data-expected-height=
"150">
156 <div class=
"sizedToGridArea negativeEndPositionStartSpanInColumnDirection" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"50"></div>
160 <div style=
"position: relative">
161 <div class=
"grid" data-expected-width=
"150" data-expected-height=
"150">
162 <div class=
"sizedToGridArea negativeEndPositionStartSpanInRowDirection" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"50" data-expected-height=
"150"></div>
166 <div style=
"position: relative">
167 <div class=
"grid" data-expected-width=
"150" data-expected-height=
"150">
168 <div class=
"sizedToGridArea negativeNamedGridLineEndPositionStartSpanInColumnDirection" data-offset-x=
"50" data-offset-y=
"0" data-expected-width=
"100" data-expected-height=
"50"></div>
172 <div style=
"position: relative">
173 <div class=
"grid" data-expected-width=
"150" data-expected-height=
"150">
174 <div class=
"sizedToGridArea negativeNamedGridLineEndPositionStartSpanInRowDirection" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"50" data-expected-height=
"150"></div>
178 <div style=
"position: relative">
179 <div class=
"grid" data-expected-width=
"150" data-expected-height=
"150">
180 <div class=
"sizedToGridArea negativeEndPositionStartNegativeInColumnDirection" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"150" data-expected-height=
"50"></div>
184 <div style=
"position: relative">
185 <div class=
"grid" data-expected-width=
"150" data-expected-height=
"150">
186 <div class=
"sizedToGridArea negativeEndPositionStartNegativeInRowDirection" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"50" data-expected-height=
"50"></div>
190 <div style=
"position: relative">
191 <div class=
"grid" data-expected-width=
"150" data-expected-height=
"150">
192 <div class=
"sizedToGridArea namedGridLineEndPositionStartNegativeInColumnDirection" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"150" data-expected-height=
"50"></div>
196 <div style=
"position: relative">
197 <div class=
"grid" data-expected-width=
"150" data-expected-height=
"150">
198 <div class=
"sizedToGridArea namedGridLineEndPositionStartNegativeInRowDirection" data-offset-x=
"0" data-offset-y=
"0" data-expected-width=
"50" data-expected-height=
"50"></div>