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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 51 } |
52 #placeSelfNone { | 52 #placeSelfNone { |
53 place-self: none; | 53 place-self: none; |
54 } | 54 } |
55 #placeSelfSafe { | 55 #placeSelfSafe { |
56 place-self: safe; | 56 place-self: safe; |
57 } | 57 } |
58 #placeSelfStartSafe { | 58 #placeSelfStartSafe { |
59 place-self: start safe; | 59 place-self: start safe; |
60 } | 60 } |
61 #placeSelfBaselineSafe { | |
62 place-self: baseline safe; | |
63 } | |
64 #placeSelfStartEndLeft { | 61 #placeSelfStartEndLeft { |
65 place-self: start end left; | 62 place-self: start end left; |
66 } | 63 } |
67 </style> | 64 </style> |
68 <script src="../../resources/testharness.js"></script> | 65 <script src="../../resources/testharness.js"></script> |
69 <script src="../../resources/testharnessreport.js"></script> | 66 <script src="../../resources/testharnessreport.js"></script> |
70 <script src="resources/alignment-parsing-utils-th.js"></script> | 67 <script src="resources/alignment-parsing-utils-th.js"></script> |
71 </head> | 68 </head> |
72 <body> | 69 <body> |
73 <p>Test to verify that the new place-self alignment shorthand is parsed as exp
ected and correctly sets the longhand values.</p> | 70 <p>Test to verify that the new place-self alignment shorthand is parsed as exp
ected and correctly sets the longhand values.</p> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 document.body.appendChild(element); | 106 document.body.appendChild(element); |
110 element.style.placeSelf = value; | 107 element.style.placeSelf = value; |
111 checkValues(element, "placeSelf", "place-self", value, alignValue + ' ' + just
ifyValue) | 108 checkValues(element, "placeSelf", "place-self", value, alignValue + ' ' + just
ifyValue) |
112 checkPlaceSelfValues(element, value, alignValue, justifyValue) | 109 checkPlaceSelfValues(element, value, alignValue, justifyValue) |
113 } | 110 } |
114 | 111 |
115 function checkPlaceSelfValuesBadJS(value) | 112 function checkPlaceSelfValuesBadJS(value) |
116 { | 113 { |
117 element.style.placeSelf = ""; | 114 element.style.placeSelf = ""; |
118 element.style.placeSelf = value; | 115 element.style.placeSelf = value; |
119 checkPlaceSelfValues(element, "", "auto", "auto") | 116 checkPlaceSelfValues(element, "", "normal", "normal") |
120 } | 117 } |
121 | 118 |
122 test(function() { | 119 test(function() { |
123 checkValues(placeSelfNormal, "placeSelf", "place-self", "", "normal normal"); | 120 checkValues(placeSelfNormal, "placeSelf", "place-self", "", "normal normal"); |
124 checkPlaceSelfValues(placeSelfNormal, "", "normal", "normal"); | 121 checkPlaceSelfValues(placeSelfNormal, "", "normal", "normal"); |
125 }, "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."); |
126 | 123 |
127 test(function() { | 124 test(function() { |
128 checkValues(placeSelfCenterAuto, "placeSelf", "place-self", "", "center auto")
; | 125 checkValues(placeSelfCenterAuto, "placeSelf", "place-self", "", "center normal
"); |
129 checkPlaceSelfValues(placeSelfCenterAuto, "", "center", "auto"); | 126 checkPlaceSelfValues(placeSelfCenterAuto, "", "center", "normal"); |
130 }, "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."); |
131 | 128 |
132 test(function() { | 129 test(function() { |
133 checkValues(placeSelfBaseline, "placeSelf", "place-self", "", "baseline baseli
ne"); | 130 checkValues(placeSelfBaseline, "placeSelf", "place-self", "", "baseline baseli
ne"); |
134 checkPlaceSelfValues(placeSelfBaseline, "", "baseline", "baseline"); | 131 checkPlaceSelfValues(placeSelfBaseline, "", "baseline", "baseline"); |
135 }, "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."); |
136 | 133 |
137 test(function() { | 134 test(function() { |
138 checkValues(placeSelfFirstBaseline, "placeSelf", "place-self", "", "baseline b
aseline"); | 135 checkValues(placeSelfFirstBaseline, "placeSelf", "place-self", "", "baseline b
aseline"); |
139 checkPlaceSelfValues(placeSelfFirstBaseline, "", "baseline", "baseline"); | 136 checkPlaceSelfValues(placeSelfFirstBaseline, "", "baseline", "baseline"); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 checkValues(placeSelfStartSelfEnd, "placeSelf", "place-self", "", "start self-
end"); | 175 checkValues(placeSelfStartSelfEnd, "placeSelf", "place-self", "", "start self-
end"); |
179 checkPlaceSelfValues(placeSelfStartSelfEnd, "", "start", "self-end"); | 176 checkPlaceSelfValues(placeSelfStartSelfEnd, "", "start", "self-end"); |
180 }, "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."); |
181 | 178 |
182 test(function() { | 179 test(function() { |
183 checkValues(placeSelfStartBaseline, "placeSelf", "place-self", "", "start base
line"); | 180 checkValues(placeSelfStartBaseline, "placeSelf", "place-self", "", "start base
line"); |
184 checkPlaceSelfValues(placeSelfStartBaseline, "", "start", "baseline"); | 181 checkPlaceSelfValues(placeSelfStartBaseline, "", "start", "baseline"); |
185 }, "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."); |
186 | 183 |
187 test(function() { | 184 test(function() { |
188 checkValues(placeSelfEmpty, "placeSelf", "place-self", "", "auto auto"); | 185 checkValues(placeSelfAuto, "placeSelf", "place-self", "", "normal normal"); |
189 checkPlaceSelfValues(placeSelfEmpty, "", "auto", "auto"); | 186 checkPlaceSelfValues(placeSelfAuto, "", "normal", "normal"); |
190 }, "Test setting '' as incorrect value through CSS."); | 187 }, "Test setting '' as incorrect value through CSS."); |
191 | 188 |
192 test(function() { | 189 test(function() { |
193 checkValues(placeSelfAuto, "placeSelf", "place-self", "", "auto auto"); | 190 checkValues(placeSelfAuto, "placeSelf", "place-self", "", "normal normal"); |
194 checkPlaceSelfValues(placeSelfAuto, "", "auto", "auto"); | 191 checkPlaceSelfValues(placeSelfAuto, "", "normal", "normal"); |
195 }, "Test setting 'auto' as incorrect value through CSS."); | 192 }, "Test setting 'auto' as incorrect value through CSS."); |
196 | 193 |
197 test(function() { | 194 test(function() { |
198 checkValues(placeSelfNone, "placeSelf", "place-self", "", "auto auto"); | 195 checkValues(placeSelfNone, "placeSelf", "place-self", "", "normal normal"); |
199 checkPlaceSelfValues(placeSelfNone, "", "auto", "auto"); | 196 checkPlaceSelfValues(placeSelfNone, "", "normal", "normal"); |
200 }, "Test setting 'none' as incorrect value through CSS."); | 197 }, "Test setting 'none' as incorrect value through CSS."); |
201 | 198 |
202 test(function() { | 199 test(function() { |
203 checkValues(placeSelfSafe, "placeSelf", "place-self", "", "auto auto"); | 200 checkValues(placeSelfSafe, "placeSelf", "place-self", "", "normal normal"); |
204 checkPlaceSelfValues(placeSelfSafe, "", "auto", "auto"); | 201 checkPlaceSelfValues(placeSelfSafe, "", "normal", "normal"); |
205 }, "Test setting 'safe' as incorrect value through CSS."); | 202 }, "Test setting 'safe' as incorrect value through CSS."); |
206 | 203 |
207 test(function() { | 204 test(function() { |
208 checkValues(placeSelfStartSafe, "placeSelf", "place-self", "", "auto auto"); | 205 checkValues(placeSelfStartSafe, "placeSelf", "place-self", "", "normal normal"
); |
209 checkPlaceSelfValues(placeSelfStartSafe, "", "auto", "auto"); | 206 checkPlaceSelfValues(placeSelfStartSafe, "", "normal", "normal"); |
210 }, "Test setting 'start safe' as incorrect value through CSS."); | 207 }, "Test setting 'start safe' as incorrect value through CSS."); |
211 | 208 |
212 test(function() { | 209 test(function() { |
213 checkValues(placeSelfBaselineSafe, "placeSelf", "place-self", "", "auto auto")
; | 210 checkValues(placeSelfStartSafe, "placeSelf", "place-self", "", "normal normal"
); |
214 checkPlaceSelfValues(placeSelfBaselineSafe, "", "auto", "auto"); | 211 checkPlaceSelfValues(placeSelfStartSafe, "", "normal", "normal"); |
215 }, "Test setting 'baseline safe' as incorrect value through CSS."); | 212 }, "Test setting 'baseline safe' as incorrect value through CSS."); |
216 | 213 |
217 test(function() { | 214 test(function() { |
218 checkValues(placeSelfStartEndLeft, "placeSelf", "place-self", "", "auto auto")
; | 215 checkValues(placeSelfStartEndLeft, "placeSelf", "place-self", "", "normal norm
al"); |
219 checkPlaceSelfValues(placeSelfStartEndLeft, "", "auto", "auto"); | 216 checkPlaceSelfValues(placeSelfStartEndLeft, "", "normal", "normal"); |
220 }, "Test setting 'start end left' as incorrect value through CSS."); | 217 }, "Test setting 'start end left' as incorrect value through CSS."); |
221 | 218 |
222 test(function() { | 219 test(function() { |
223 checkPlaceSelfValuesJS("center", "center", "center"); | 220 checkPlaceSelfValuesJS("center", "center", "center"); |
224 checkPlaceSelfValuesJS("center start", "center", "start"); | 221 checkPlaceSelfValuesJS("center start", "center", "start"); |
225 checkPlaceSelfValuesJS("self-start end", "self-start", "end"); | 222 checkPlaceSelfValuesJS("self-start end", "self-start", "end"); |
226 checkPlaceSelfValuesJS("normal end", "normal", "end"); | 223 checkPlaceSelfValuesJS("normal end", "normal", "end"); |
227 checkPlaceSelfValuesJS("auto right", "auto", "right"); | |
228 }, "Test setting values through JS."); | 224 }, "Test setting values through JS."); |
229 | 225 |
230 test(function() { | 226 test(function() { |
231 checkPlaceSelfValuesBadJS("space-between"); | 227 checkPlaceSelfValuesBadJS("space-between", "normal", "normal"); |
232 checkPlaceSelfValuesBadJS("center safe"); | 228 checkPlaceSelfValuesBadJS("center safe", "normal", "normal"); |
233 checkPlaceSelfValuesBadJS("center self-start center"); | 229 checkPlaceSelfValuesBadJS("center self-start center", "normal", "normal"); |
234 checkPlaceSelfValuesBadJS("asrt"); | 230 checkPlaceSelfValuesBadJS("asrt", "normal", "normal"); |
235 checkPlaceSelfValuesBadJS("10px"); | 231 checkPlaceSelfValuesBadJS("10px", "normal", "normal"); |
236 checkPlaceSelfValuesBadJS("stretch safe"); | 232 checkPlaceSelfValuesBadJS("stretch safe", "normal", "normal"); |
237 checkPlaceSelfValuesBadJS("self-start start end"); | 233 checkPlaceSelfValuesBadJS("self-start start end", "normal", "normal"); |
238 checkPlaceSelfValuesBadJS(""); | 234 checkPlaceSelfValuesBadJS("", "normal", "normal"); |
239 }, "Test setting incorrect values through JS."); | 235 }, "Test setting incorrect values through JS."); |
240 | 236 |
241 test(function() { | 237 test(function() { |
242 element = document.createElement("div"); | 238 element = document.createElement("div"); |
243 document.body.appendChild(element); | 239 document.body.appendChild(element); |
244 checkValues(element, "placeSelf", "place-self", "", "auto auto"); | 240 checkValues(element, "placeSelf", "place-self", "", "normal normal"); |
245 element.style.placeSelf = "center"; | 241 element.style.placeSelf = "center"; |
246 checkPlaceSelfValues(element, "center", "center", "center"); | 242 checkPlaceSelfValues(element, "center", "center", "center"); |
247 element.style.placeSelf = "initial"; | 243 element.style.placeSelf = "initial"; |
248 checkValues(element, "placeSelf", "place-self", "initial", "auto auto"); | 244 checkValues(element, "placeSelf", "place-self", "initial", "normal normal"); |
249 checkPlaceSelfValues(element, "initial", "auto", "auto"); | 245 checkPlaceSelfValues(element, "initial", "normal", "normal"); |
250 }, "Test the 'initial' value of the place-self shorthand and its longhand proper
ties' Computed value"); | 246 }, "Test the 'initial' value of the place-self shorthand and its longhand proper
ties' Computed value"); |
251 | 247 |
252 test(function() { | 248 test(function() { |
253 document.body.style.placeSelf = "start"; | 249 document.body.style.placeSelf = "start"; |
254 var anotherElement = document.createElement("div"); | 250 var anotherElement = document.createElement("div"); |
255 document.body.appendChild(anotherElement); | 251 document.body.appendChild(anotherElement); |
256 checkPlaceSelfValues(anotherElement, "", "auto", "auto"); | 252 checkPlaceSelfValues(anotherElement, "", "normal", "normal"); |
257 anotherElement.style.placeSelf = "inherit"; | 253 anotherElement.style.placeSelf = "inherit"; |
258 checkPlaceSelfValues(anotherElement, "inherit", "start", "start"); | 254 checkPlaceSelfValues(anotherElement, "inherit", "start", "start"); |
259 }, "Test the 'inherit' value of the place-self shorthand and its longhand proper
ties' Computed value"); | 255 }, "Test the 'inherit' value of the place-self shorthand and its longhand proper
ties' Computed value"); |
260 </script> | 256 </script> |
261 </body> | 257 </body> |
262 </html> | 258 </html> |
OLD | NEW |