OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <style> | 4 <style> |
5 #placeSelfNormal { | 5 #placeSelfNormal { |
6 place-self: normal; | 6 place-self: normal; |
7 } | 7 } |
8 #placeSelfCenterAuto { | 8 #placeSelfCenterAuto { |
9 place-self: center auto; | 9 place-self: center auto; |
10 } | 10 } |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 document.body.appendChild(element); | 106 document.body.appendChild(element); |
107 element.style.placeSelf = value; | 107 element.style.placeSelf = value; |
108 checkValues(element, "placeSelf", "place-self", value, alignValue + ' ' + just ifyValue) | 108 checkValues(element, "placeSelf", "place-self", value, alignValue + ' ' + just ifyValue) |
109 checkPlaceSelfValues(element, value, alignValue, justifyValue) | 109 checkPlaceSelfValues(element, value, alignValue, justifyValue) |
110 } | 110 } |
111 | 111 |
112 function checkPlaceSelfValuesBadJS(value) | 112 function checkPlaceSelfValuesBadJS(value) |
113 { | 113 { |
114 element.style.placeSelf = ""; | 114 element.style.placeSelf = ""; |
115 element.style.placeSelf = value; | 115 element.style.placeSelf = value; |
116 checkPlaceSelfValues(element, "", "normal", "normal") | 116 checkPlaceSelfValues(element, "", "auto", "auto") |
117 } | 117 } |
118 | 118 |
119 test(function() { | 119 test(function() { |
120 checkValues(placeSelfNormal, "placeSelf", "place-self", "", "normal normal"); | 120 checkValues(placeSelfNormal, "placeSelf", "place-self", "", "normal normal"); |
121 checkPlaceSelfValues(placeSelfNormal, "", "normal", "normal"); | 121 checkPlaceSelfValues(placeSelfNormal, "", "normal", "normal"); |
122 }, "Test getting the Computed Value of place-self's longhand properties when set ting 'normal' value through CSS."); | 122 }, "Test getting the Computed Value of place-self's longhand properties when set ting 'normal' value through CSS."); |
123 | 123 |
124 test(function() { | 124 test(function() { |
125 checkValues(placeSelfCenterAuto, "placeSelf", "place-self", "", "center normal "); | 125 checkValues(placeSelfCenterAuto, "placeSelf", "place-self", "", "center auto") ; |
126 checkPlaceSelfValues(placeSelfCenterAuto, "", "center", "normal"); | 126 checkPlaceSelfValues(placeSelfCenterAuto, "", "center", "auto"); |
127 }, "Test getting the Computed Value of place-self's longhand properties when set ting 'center auto' value through CSS."); | 127 }, "Test getting the Computed Value of place-self's longhand properties when set ting 'center auto' value through CSS."); |
128 | 128 |
129 test(function() { | 129 test(function() { |
130 checkValues(placeSelfBaseline, "placeSelf", "place-self", "", "baseline baseli ne"); | 130 checkValues(placeSelfBaseline, "placeSelf", "place-self", "", "baseline baseli ne"); |
131 checkPlaceSelfValues(placeSelfBaseline, "", "baseline", "baseline"); | 131 checkPlaceSelfValues(placeSelfBaseline, "", "baseline", "baseline"); |
132 }, "Test getting the Computed Value of place-self's longhand properties when set ting 'baseline' value through CSS."); | 132 }, "Test getting the Computed Value of place-self's longhand properties when set ting 'baseline' value through CSS."); |
133 | 133 |
134 test(function() { | 134 test(function() { |
135 checkValues(placeSelfFirstBaseline, "placeSelf", "place-self", "", "baseline b aseline"); | 135 checkValues(placeSelfFirstBaseline, "placeSelf", "place-self", "", "baseline b aseline"); |
136 checkPlaceSelfValues(placeSelfFirstBaseline, "", "baseline", "baseline"); | 136 checkPlaceSelfValues(placeSelfFirstBaseline, "", "baseline", "baseline"); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 checkValues(placeSelfStartSelfEnd, "placeSelf", "place-self", "", "start self- end"); | 175 checkValues(placeSelfStartSelfEnd, "placeSelf", "place-self", "", "start self- end"); |
176 checkPlaceSelfValues(placeSelfStartSelfEnd, "", "start", "self-end"); | 176 checkPlaceSelfValues(placeSelfStartSelfEnd, "", "start", "self-end"); |
177 }, "Test getting the Computed Value of place-self's longhand properties when set ting 'start self-end' value through CSS."); | 177 }, "Test getting the Computed Value of place-self's longhand properties when set ting 'start self-end' value through CSS."); |
178 | 178 |
179 test(function() { | 179 test(function() { |
180 checkValues(placeSelfStartBaseline, "placeSelf", "place-self", "", "start base line"); | 180 checkValues(placeSelfStartBaseline, "placeSelf", "place-self", "", "start base line"); |
181 checkPlaceSelfValues(placeSelfStartBaseline, "", "start", "baseline"); | 181 checkPlaceSelfValues(placeSelfStartBaseline, "", "start", "baseline"); |
182 }, "Test getting the Computed Value of place-self's longhand properties when set ting 'start baseline' value through CSS."); | 182 }, "Test getting the Computed Value of place-self's longhand properties when set ting 'start baseline' value through CSS."); |
183 | 183 |
184 test(function() { | 184 test(function() { |
185 checkValues(placeSelfAuto, "placeSelf", "place-self", "", "normal normal"); | 185 checkValues(placeSelfEmpty, "placeSelf", "place-self", "", "auto auto"); |
186 checkPlaceSelfValues(placeSelfAuto, "", "normal", "normal"); | 186 checkPlaceSelfValues(placeSelfEmpty, "", "auto", "auto"); |
187 }, "Test setting '' as incorrect value through CSS."); | 187 }, "Test setting '' as incorrect value through CSS."); |
188 | 188 |
189 test(function() { | 189 test(function() { |
190 checkValues(placeSelfAuto, "placeSelf", "place-self", "", "normal normal"); | 190 checkValues(placeSelfAuto, "placeSelf", "place-self", "", "auto auto"); |
191 checkPlaceSelfValues(placeSelfAuto, "", "normal", "normal"); | 191 checkPlaceSelfValues(placeSelfAuto, "", "auto", "auto"); |
192 }, "Test setting 'auto' as incorrect value through CSS."); | 192 }, "Test setting 'auto' as incorrect value through CSS."); |
193 | 193 |
194 test(function() { | 194 test(function() { |
195 checkValues(placeSelfNone, "placeSelf", "place-self", "", "normal normal"); | 195 checkValues(placeSelfNone, "placeSelf", "place-self", "", "auto auto"); |
196 checkPlaceSelfValues(placeSelfNone, "", "normal", "normal"); | 196 checkPlaceSelfValues(placeSelfNone, "", "auto", "auto"); |
197 }, "Test setting 'none' as incorrect value through CSS."); | 197 }, "Test setting 'none' as incorrect value through CSS."); |
198 | 198 |
199 test(function() { | 199 test(function() { |
200 checkValues(placeSelfSafe, "placeSelf", "place-self", "", "normal normal"); | 200 checkValues(placeSelfSafe, "placeSelf", "place-self", "", "auto auto"); |
201 checkPlaceSelfValues(placeSelfSafe, "", "normal", "normal"); | 201 checkPlaceSelfValues(placeSelfSafe, "", "auto", "auto"); |
202 }, "Test setting 'safe' as incorrect value through CSS."); | 202 }, "Test setting 'safe' as incorrect value through CSS."); |
203 | 203 |
204 test(function() { | 204 test(function() { |
205 checkValues(placeSelfStartSafe, "placeSelf", "place-self", "", "normal normal" ); | 205 checkValues(placeSelfStartSafe, "placeSelf", "place-self", "", "auto auto"); |
206 checkPlaceSelfValues(placeSelfStartSafe, "", "normal", "normal"); | 206 checkPlaceSelfValues(placeSelfStartSafe, "", "auto", "auto"); |
207 }, "Test setting 'start safe' as incorrect value through CSS."); | 207 }, "Test setting 'start safe' as incorrect value through CSS."); |
208 | 208 |
209 test(function() { | 209 test(function() { |
210 checkValues(placeSelfStartSafe, "placeSelf", "place-self", "", "normal normal" ); | 210 checkValues(placeSelfStartSafe, "placeSelf", "place-self", "", "auto auto"); |
211 checkPlaceSelfValues(placeSelfStartSafe, "", "normal", "normal"); | 211 checkPlaceSelfValues(placeSelfStartSafe, "", "auto", "auto"); |
cbiesinger
2017/05/24 16:54:15
(unrelated, but placeSelfStartSafe does not look c
jfernandez
2017/05/24 22:46:58
Acknowledged.
| |
212 }, "Test setting 'baseline safe' as incorrect value through CSS."); | 212 }, "Test setting 'baseline safe' as incorrect value through CSS."); |
213 | 213 |
214 test(function() { | 214 test(function() { |
215 checkValues(placeSelfStartEndLeft, "placeSelf", "place-self", "", "normal norm al"); | 215 checkValues(placeSelfStartEndLeft, "placeSelf", "place-self", "", "auto auto") ; |
216 checkPlaceSelfValues(placeSelfStartEndLeft, "", "normal", "normal"); | 216 checkPlaceSelfValues(placeSelfStartEndLeft, "", "auto", "auto"); |
217 }, "Test setting 'start end left' as incorrect value through CSS."); | 217 }, "Test setting 'start end left' as incorrect value through CSS."); |
218 | 218 |
219 test(function() { | 219 test(function() { |
220 checkPlaceSelfValuesJS("center", "center", "center"); | 220 checkPlaceSelfValuesJS("center", "center", "center"); |
221 checkPlaceSelfValuesJS("center start", "center", "start"); | 221 checkPlaceSelfValuesJS("center start", "center", "start"); |
222 checkPlaceSelfValuesJS("self-start end", "self-start", "end"); | 222 checkPlaceSelfValuesJS("self-start end", "self-start", "end"); |
223 checkPlaceSelfValuesJS("normal end", "normal", "end"); | 223 checkPlaceSelfValuesJS("normal end", "normal", "end"); |
224 checkPlaceSelfValuesJS("auto right", "auto", "right"); | |
224 }, "Test setting values through JS."); | 225 }, "Test setting values through JS."); |
225 | 226 |
226 test(function() { | 227 test(function() { |
227 checkPlaceSelfValuesBadJS("space-between", "normal", "normal"); | 228 checkPlaceSelfValuesBadJS("space-between"); |
228 checkPlaceSelfValuesBadJS("center safe", "normal", "normal"); | 229 checkPlaceSelfValuesBadJS("center safe"); |
229 checkPlaceSelfValuesBadJS("center self-start center", "normal", "normal"); | 230 checkPlaceSelfValuesBadJS("center self-start center"); |
230 checkPlaceSelfValuesBadJS("asrt", "normal", "normal"); | 231 checkPlaceSelfValuesBadJS("asrt"); |
231 checkPlaceSelfValuesBadJS("10px", "normal", "normal"); | 232 checkPlaceSelfValuesBadJS("10px"); |
232 checkPlaceSelfValuesBadJS("stretch safe", "normal", "normal"); | 233 checkPlaceSelfValuesBadJS("stretch safe"); |
233 checkPlaceSelfValuesBadJS("self-start start end", "normal", "normal"); | 234 checkPlaceSelfValuesBadJS("self-start start end"); |
234 checkPlaceSelfValuesBadJS("", "normal", "normal"); | 235 checkPlaceSelfValuesBadJS(""); |
235 }, "Test setting incorrect values through JS."); | 236 }, "Test setting incorrect values through JS."); |
236 | 237 |
237 test(function() { | 238 test(function() { |
238 element = document.createElement("div"); | 239 element = document.createElement("div"); |
239 document.body.appendChild(element); | 240 document.body.appendChild(element); |
240 checkValues(element, "placeSelf", "place-self", "", "normal normal"); | 241 checkValues(element, "placeSelf", "place-self", "", "auto auto"); |
241 element.style.placeSelf = "center"; | 242 element.style.placeSelf = "center"; |
242 checkPlaceSelfValues(element, "center", "center", "center"); | 243 checkPlaceSelfValues(element, "center", "center", "center"); |
243 element.style.placeSelf = "initial"; | 244 element.style.placeSelf = "initial"; |
244 checkValues(element, "placeSelf", "place-self", "initial", "normal normal"); | 245 checkValues(element, "placeSelf", "place-self", "initial", "auto auto"); |
245 checkPlaceSelfValues(element, "initial", "normal", "normal"); | 246 checkPlaceSelfValues(element, "initial", "auto", "auto"); |
246 }, "Test the 'initial' value of the place-self shorthand and its longhand proper ties' Computed value"); | 247 }, "Test the 'initial' value of the place-self shorthand and its longhand proper ties' Computed value"); |
247 | 248 |
248 test(function() { | 249 test(function() { |
249 document.body.style.placeSelf = "start"; | 250 document.body.style.placeSelf = "start"; |
250 var anotherElement = document.createElement("div"); | 251 var anotherElement = document.createElement("div"); |
251 document.body.appendChild(anotherElement); | 252 document.body.appendChild(anotherElement); |
252 checkPlaceSelfValues(anotherElement, "", "normal", "normal"); | 253 checkPlaceSelfValues(anotherElement, "", "auto", "auto"); |
253 anotherElement.style.placeSelf = "inherit"; | 254 anotherElement.style.placeSelf = "inherit"; |
254 checkPlaceSelfValues(anotherElement, "inherit", "start", "start"); | 255 checkPlaceSelfValues(anotherElement, "inherit", "start", "start"); |
255 }, "Test the 'inherit' value of the place-self shorthand and its longhand proper ties' Computed value"); | 256 }, "Test the 'inherit' value of the place-self shorthand and its longhand proper ties' Computed value"); |
256 </script> | 257 </script> |
257 </body> | 258 </body> |
258 </html> | 259 </html> |
OLD | NEW |