1 This test checks that the 'grid-template' shorthand is properly parsed and the longhand properties correctly assigned.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 Test getting grid-template-areas set through CSS.
7 PASS window.getComputedStyle(gridTemplateWithNone, '').getPropertyValue('grid-template-columns') is "none"
8 PASS window.getComputedStyle(gridTemplateWithNone, '').getPropertyValue('grid-template-rows') is "none"
9 PASS window.getComputedStyle(gridTemplateWithNone, '').getPropertyValue('grid-template-areas') is "none"
10 PASS window.getComputedStyle(gridTemplateSimpleForm, '').getPropertyValue('grid-template-columns') is "10px"
11 PASS window.getComputedStyle(gridTemplateSimpleForm, '').getPropertyValue('grid-template-rows') is "15px"
12 PASS window.getComputedStyle(gridTemplateSimpleForm, '').getPropertyValue('grid-template-areas') is "none"
13 PASS window.getComputedStyle(gridTemplateSimpleFormWithNoneColumns, '').getPropertyValue('grid-template-columns') is "none"
14 PASS window.getComputedStyle(gridTemplateSimpleFormWithNoneColumns, '').getPropertyValue('grid-template-rows') is "15px"
15 PASS window.getComputedStyle(gridTemplateSimpleFormWithNoneColumns, '').getPropertyValue('grid-template-areas') is "none"
16 PASS window.getComputedStyle(gridTemplateSimpleFormWithNoneRows, '').getPropertyValue('grid-template-columns') is "10px"
17 PASS window.getComputedStyle(gridTemplateSimpleFormWithNoneRows, '').getPropertyValue('grid-template-rows') is "none"
18 PASS window.getComputedStyle(gridTemplateSimpleFormWithNoneRows, '').getPropertyValue('grid-template-areas') is "none"
19 PASS window.getComputedStyle(gridTemplateSimpleFormWithNone, '').getPropertyValue('grid-template-columns') is "none"
20 PASS window.getComputedStyle(gridTemplateSimpleFormWithNone, '').getPropertyValue('grid-template-rows') is "none"
21 PASS window.getComputedStyle(gridTemplateSimpleFormWithNone, '').getPropertyValue('grid-template-areas') is "none"
22 PASS window.getComputedStyle(gridTemplateComplexForm, '').getPropertyValue('grid-template-columns') is "10px"
23 PASS window.getComputedStyle(gridTemplateComplexForm, '').getPropertyValue('grid-template-rows') is "15px"
24 PASS window.getComputedStyle(gridTemplateComplexForm, '').getPropertyValue('grid-template-areas') is "\"a\""
25 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNames, '').getPropertyValue('grid-template-columns') is "10px"
26 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNames, '').getPropertyValue('grid-template-rows') is "[head] 15px [tail]"
27 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNames, '').getPropertyValue('grid-template-areas') is "\"a\""
28 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumns, '').getPropertyValue('grid-template-columns') is "10px"
29 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumns, '').getPropertyValue('grid-template-rows') is "[head] 15px [tail]"
30 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumns, '').getPropertyValue('grid-template-areas') is "\"a b\""
31 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRows, '').getPropertyValue('grid-template-columns') is "10px"
32 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRows, '').getPropertyValue('grid-template-rows') is "[head1] 15px [tail1 head2] 20px [tail2]"
33 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRows, '').getPropertyValue('grid-template-areas') is "\"a\" \"b\""
34 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns, '').getPropertyValue('grid-template-columns') is "[first] 10px [nav nav2] 15px [nav nav2] 15px"
35 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns, '').getPropertyValue('grid-template-rows') is "100px [nav nav2] 25px [nav nav2] 25px [last]"
36 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns, '').getPropertyValue('grid-template-areas') is "\"a b c\" \"d e f\" \"g h i\""
37 PASS window.getComputedStyle(gridTemplateComplexFormWithAuto, '').getPropertyValue('grid-template-columns') is "10px"
38 PASS window.getComputedStyle(gridTemplateComplexFormWithAuto, '').getPropertyValue('grid-template-rows') is "0px"
39 PASS window.getComputedStyle(gridTemplateComplexFormWithAuto, '').getPropertyValue('grid-template-areas') is "\"a\""
40 PASS window.getComputedStyle(gridTemplateComplexFormOnlyAreas, '').getPropertyValue('grid-template-columns') is "none"
41 PASS window.getComputedStyle(gridTemplateComplexFormOnlyAreas, '').getPropertyValue('grid-template-rows') is "0px"
42 PASS window.getComputedStyle(gridTemplateComplexFormOnlyAreas, '').getPropertyValue('grid-template-areas') is "\"a\""
43 PASS window.getComputedStyle(gridTemplateNoColumnsRowWithEmptyTrailingLineNames, '').getPropertyValue('grid-template-columns') is "none"
44 PASS window.getComputedStyle(gridTemplateNoColumnsRowWithEmptyTrailingLineNames, '').getPropertyValue('grid-template-rows') is "[first] 0px"
45 PASS window.getComputedStyle(gridTemplateNoColumnsRowWithEmptyTrailingLineNames, '').getPropertyValue('grid-template-areas') is "\"a\""
46 PASS window.getComputedStyle(gridTemplateConsecutiveAreas, '').getPropertyValue('grid-template-columns') is "10px"
47 PASS window.getComputedStyle(gridTemplateConsecutiveAreas, '').getPropertyValue('grid-template-rows') is "0px 0px"
48 PASS window.getComputedStyle(gridTemplateConsecutiveAreas, '').getPropertyValue('grid-template-areas') is "\"a\" \"a\""
50 Test getting wrong values for grid-template shorthand through CSS (they should resolve to the default: 'none')
51 PASS window.getComputedStyle(gridTemplateMultipleSlash, '').getPropertyValue('grid-template-columns') is "none"
52 PASS window.getComputedStyle(gridTemplateMultipleSlash, '').getPropertyValue('grid-template-rows') is "none"
53 PASS window.getComputedStyle(gridTemplateMultipleSlash, '').getPropertyValue('grid-template-areas') is "none"
54 PASS window.getComputedStyle(gridTemplateSimpleFormJustColumns, '').getPropertyValue('grid-template-columns') is "none"
55 PASS window.getComputedStyle(gridTemplateSimpleFormJustColumns, '').getPropertyValue('grid-template-rows') is "none"
56 PASS window.getComputedStyle(gridTemplateSimpleFormJustColumns, '').getPropertyValue('grid-template-areas') is "none"
57 PASS window.getComputedStyle(gridTemplateSimpleFormNoRows, '').getPropertyValue('grid-template-columns') is "none"
58 PASS window.getComputedStyle(gridTemplateSimpleFormNoRows, '').getPropertyValue('grid-template-rows') is "none"
59 PASS window.getComputedStyle(gridTemplateSimpleFormNoRows, '').getPropertyValue('grid-template-areas') is "none"
60 PASS window.getComputedStyle(gridTemplateSimpleFormNoColumns, '').getPropertyValue('grid-template-columns') is "none"
61 PASS window.getComputedStyle(gridTemplateSimpleFormNoColumns, '').getPropertyValue('grid-template-rows') is "none"
62 PASS window.getComputedStyle(gridTemplateSimpleFormNoColumns, '').getPropertyValue('grid-template-areas') is "none"
63 PASS window.getComputedStyle(gridTemplateSimpleFormNoColumnSize, '').getPropertyValue('grid-template-columns') is "none"
64 PASS window.getComputedStyle(gridTemplateSimpleFormNoColumnSize, '').getPropertyValue('grid-template-rows') is "none"
65 PASS window.getComputedStyle(gridTemplateSimpleFormNoColumnSize, '').getPropertyValue('grid-template-areas') is "none"
66 PASS window.getComputedStyle(gridTemplateSimpleFormWithFitContent, '').getPropertyValue('grid-template-columns') is "none"
67 PASS window.getComputedStyle(gridTemplateSimpleFormWithFitContent, '').getPropertyValue('grid-template-rows') is "none"
68 PASS window.getComputedStyle(gridTemplateSimpleFormWithFitContent, '').getPropertyValue('grid-template-areas') is "none"
69 PASS window.getComputedStyle(gridTemplateSimpleFormWithWrongRepeat, '').getPropertyValue('grid-template-columns') is "none"
70 PASS window.getComputedStyle(gridTemplateSimpleFormWithWrongRepeat, '').getPropertyValue('grid-template-rows') is "none"
71 PASS window.getComputedStyle(gridTemplateSimpleFormWithWrongRepeat, '').getPropertyValue('grid-template-areas') is "none"
72 PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone1, '').getPropertyValue('grid-template-columns') is "none"
73 PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone1, '').getPropertyValue('grid-template-rows') is "none"
74 PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone1, '').getPropertyValue('grid-template-areas') is "none"
75 PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone2, '').getPropertyValue('grid-template-columns') is "none"
76 PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone2, '').getPropertyValue('grid-template-rows') is "none"
77 PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone2, '').getPropertyValue('grid-template-areas') is "none"
78 PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone3, '').getPropertyValue('grid-template-columns') is "none"
79 PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone3, '').getPropertyValue('grid-template-rows') is "none"
80 PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone3, '').getPropertyValue('grid-template-areas') is "none"
81 PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone4, '').getPropertyValue('grid-template-columns') is "none"
82 PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone4, '').getPropertyValue('grid-template-rows') is "none"
83 PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone4, '').getPropertyValue('grid-template-areas') is "none"
84 PASS window.getComputedStyle(gridTemplateComplexFormWithRepeat, '').getPropertyValue('grid-template-columns') is "none"
85 PASS window.getComputedStyle(gridTemplateComplexFormWithRepeat, '').getPropertyValue('grid-template-rows') is "none"
86 PASS window.getComputedStyle(gridTemplateComplexFormWithRepeat, '').getPropertyValue('grid-template-areas') is "none"
87 PASS window.getComputedStyle(gridTemplateComplexFormWithWrongRepeat, '').getPropertyValue('grid-template-columns') is "none"
88 PASS window.getComputedStyle(gridTemplateComplexFormWithWrongRepeat, '').getPropertyValue('grid-template-rows') is "none"
89 PASS window.getComputedStyle(gridTemplateComplexFormWithWrongRepeat, '').getPropertyValue('grid-template-areas') is "none"
90 PASS window.getComputedStyle(griTemplateComplexFormdWithFitAvailable, '').getPropertyValue('grid-template-columns') is "none"
91 PASS window.getComputedStyle(griTemplateComplexFormdWithFitAvailable, '').getPropertyValue('grid-template-rows') is "none"
92 PASS window.getComputedStyle(griTemplateComplexFormdWithFitAvailable, '').getPropertyValue('grid-template-areas') is "none"
93 PASS window.getComputedStyle(gridTemplateComplexFormNoColumnSize, '').getPropertyValue('grid-template-columns') is "none"
94 PASS window.getComputedStyle(gridTemplateComplexFormNoColumnSize, '').getPropertyValue('grid-template-rows') is "none"
95 PASS window.getComputedStyle(gridTemplateComplexFormNoColumnSize, '').getPropertyValue('grid-template-areas') is "none"
96 PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize1, '').getPropertyValue('grid-template-columns') is "none"
97 PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize1, '').getPropertyValue('grid-template-rows') is "none"
98 PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize1, '').getPropertyValue('grid-template-areas') is "none"
99 PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize2, '').getPropertyValue('grid-template-columns') is "none"
100 PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize2, '').getPropertyValue('grid-template-rows') is "none"
101 PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize2, '').getPropertyValue('grid-template-areas') is "none"
102 PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing1, '').getPropertyValue('grid-template-columns') is "none"
103 PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing1, '').getPropertyValue('grid-template-rows') is "none"
104 PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing1, '').getPropertyValue('grid-template-areas') is "none"
105 PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing2, '').getPropertyValue('grid-template-columns') is "none"
106 PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing2, '').getPropertyValue('grid-template-rows') is "none"
107 PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing2, '').getPropertyValue('grid-template-areas') is "none"
108 PASS window.getComputedStyle(gridTemplateComplexFormWithNoneColumns, '').getPropertyValue('grid-template-columns') is "none"
109 PASS window.getComputedStyle(gridTemplateComplexFormWithNoneColumns, '').getPropertyValue('grid-template-rows') is "none"
110 PASS window.getComputedStyle(gridTemplateComplexFormWithNoneColumns, '').getPropertyValue('grid-template-areas') is "none"
111 PASS window.getComputedStyle(gridTemplateNoColumnsRowWithTwoEmptyTrailingLineNames, '').getPropertyValue('grid-template-columns') is "none"
112 PASS window.getComputedStyle(gridTemplateNoColumnsRowWithTwoEmptyTrailingLineNames, '').getPropertyValue('grid-template-rows') is "none"
113 PASS window.getComputedStyle(gridTemplateNoColumnsRowWithTwoEmptyTrailingLineNames, '').getPropertyValue('grid-template-areas') is "none"
114 PASS window.getComputedStyle(gridTemplateNoColumnsRowWithEmptyTrailingLineNamesAndNonEmptyLeadingLineNames, '').getPropertyValue('grid-template-columns') is "none"
115 PASS window.getComputedStyle(gridTemplateNoColumnsRowWithEmptyTrailingLineNamesAndNonEmptyLeadingLineNames, '').getPropertyValue('grid-template-rows') is "none"
116 PASS window.getComputedStyle(gridTemplateNoColumnsRowWithEmptyTrailingLineNamesAndNonEmptyLeadingLineNames, '').getPropertyValue('grid-template-areas') is "none"
118 Test the initial value
119 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
120 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "none"
121 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "none"
122 PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is 'none'
123 PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is 'none'
124 PASS getComputedStyle(element, '').getPropertyValue('grid-template-areas') is 'none'
126 Test setting grid-template-columns and grid-template-rows back to 'none' through JS
127 PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "10px"
128 PASS element.style.gridTemplateColumns is "10px"
129 PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "[line] 20px"
130 PASS element.style.gridTemplateRows is "[line] 20px"
131 PASS getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "\"a\""
132 PASS element.style.gridTemplateAreas is "\"a\""
133 PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
134 PASS element.style.gridTemplateColumns is "none"
135 PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "none"
136 PASS element.style.gridTemplateRows is "none"
137 PASS getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "none"
138 PASS element.style.gridTemplateAreas is "none"
140 Test getting and setting grid-template shorthand through JS
141 PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "18px"
142 PASS element.style.gridTemplateColumns is "18px"
143 PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "66px"
144 PASS element.style.gridTemplateRows is "66px"
145 PASS getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "none"
146 PASS element.style.gridTemplateAreas is "none"
147 PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "10px"
148 PASS element.style.gridTemplateColumns is "10px"
149 PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "[head] 15px [tail]"
150 PASS element.style.gridTemplateRows is "[head] 15px [tail]"
151 PASS getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "\"a\""
152 PASS element.style.gridTemplateAreas is "\"a\""
153 PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
154 PASS element.style.gridTemplateColumns is "none"
155 PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "0px"
156 PASS element.style.gridTemplateRows is "auto"
157 PASS getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "\"a\""
158 PASS element.style.gridTemplateAreas is "\"a\""
160 Test setting grid-template shorthand to bad values through JS
161 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
162 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "none"
163 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "none"
164 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
165 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "none"
166 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "none"
167 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
168 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "none"
169 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "none"
170 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
171 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "none"
172 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "none"
173 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
174 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "none"
175 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "none"
176 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
177 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "none"
178 PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "none"
179 PASS successfullyParsed is true