Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/alignment/parse-align-self.html

Issue 1709963002: [css-align] New CSS Value 'normal' for Self Alignment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unskipped some repaint tests and rebaselined. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <style> 4 <style>
5 #alignSelfBaseline { 5 #alignSelfBaseline {
6 align-self: baseline; 6 align-self: baseline;
7 } 7 }
8 8
9 #alignSelfLastBaseline { 9 #alignSelfLastBaseline {
10 align-self: last-baseline; 10 align-self: last-baseline;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 var alignSelfFlexStartUnsafe = document.getElementById("alignSelfFlexStartUnsafe "); 168 var alignSelfFlexStartUnsafe = document.getElementById("alignSelfFlexStartUnsafe ");
169 shouldBe("getComputedStyle(alignSelfFlexStartUnsafe, '').getPropertyValue('align -self')", "'flex-start unsafe'"); 169 shouldBe("getComputedStyle(alignSelfFlexStartUnsafe, '').getPropertyValue('align -self')", "'flex-start unsafe'");
170 170
171 var alignSelfFlexEndSafe = document.getElementById("alignSelfFlexEndSafe"); 171 var alignSelfFlexEndSafe = document.getElementById("alignSelfFlexEndSafe");
172 shouldBe("getComputedStyle(alignSelfFlexEndSafe, '').getPropertyValue('align-sel f')", "'flex-end safe'"); 172 shouldBe("getComputedStyle(alignSelfFlexEndSafe, '').getPropertyValue('align-sel f')", "'flex-end safe'");
173 173
174 debug(""); 174 debug("");
175 debug("Test initial value of align-self through JS"); 175 debug("Test initial value of align-self through JS");
176 element = document.createElement("div"); 176 element = document.createElement("div");
177 document.body.appendChild(element); 177 document.body.appendChild(element);
178 shouldBe("getComputedStyle(element, '').getPropertyValue('align-self')", "'start '"); 178 shouldBe("getComputedStyle(element, '').getPropertyValue('align-self')", "'norma l'");
179 179
180 debug(""); 180 debug("");
181 debug("Test getting and setting align-self through JS"); 181 debug("Test getting and setting align-self through JS");
182 container = document.createElement("div"); 182 container = document.createElement("div");
183 element = document.createElement("div"); 183 element = document.createElement("div");
184 container.appendChild(element); 184 container.appendChild(element);
185 document.body.appendChild(container); 185 document.body.appendChild(container);
186 element.style.alignSelf = "center"; 186 element.style.alignSelf = "center";
187 checkValues(element, "alignSelf", "align-self", "center", "center"); 187 checkValues(element, "alignSelf", "align-self", "center", "center");
188 188
189 element.style.alignSelf = "unsafe start"; 189 element.style.alignSelf = "unsafe start";
190 checkValues(element, "alignSelf", "align-self", "start unsafe", "start unsafe") ; 190 checkValues(element, "alignSelf", "align-self", "start unsafe", "start unsafe") ;
191 191
192 element.style.alignSelf = "flex-end safe"; 192 element.style.alignSelf = "flex-end safe";
193 checkValues(element, "alignSelf", "align-self", "flex-end safe", "flex-end safe "); 193 checkValues(element, "alignSelf", "align-self", "flex-end safe", "flex-end safe ");
194 194
195 element.style.alignSelf = "right"; 195 element.style.alignSelf = "right";
196 checkValues(element, "alignSelf", "align-self", "right", "right"); 196 checkValues(element, "alignSelf", "align-self", "right", "right");
197 197
198 element.style.alignSelf = "center"; 198 element.style.alignSelf = "center";
199 checkValues(element, "alignSelf", "align-self", "center", "center"); 199 checkValues(element, "alignSelf", "align-self", "center", "center");
200 200
201 element.style.alignSelf = "self-start"; 201 element.style.alignSelf = "self-start";
202 checkValues(element, "alignSelf", "align-self", "self-start", "self-start"); 202 checkValues(element, "alignSelf", "align-self", "self-start", "self-start");
203 203
204 element.style.alignSelf = "auto"; 204 element.style.alignSelf = "auto";
205 checkValues(element, "alignSelf", "align-self", "auto", "start"); 205 checkValues(element, "alignSelf", "align-self", "auto", "normal");
206 206
207 container.style.display = "flex"; 207 container.style.display = "flex";
208 element.style.alignSelf = "auto"; 208 element.style.alignSelf = "auto";
209 checkValues(element, "alignSelf", "align-self", "auto", "stretch"); 209 checkValues(element, "alignSelf", "align-self", "auto", "normal");
210 210
211 container.style.display = "grid"; 211 container.style.display = "grid";
212 element.style.alignSelf = "auto"; 212 element.style.alignSelf = "auto";
213 checkValues(element, "alignSelf", "align-self", "auto", "stretch"); 213 checkValues(element, "alignSelf", "align-self", "auto", "normal");
214 214
215 element.style.alignSelf = "self-end"; 215 element.style.alignSelf = "self-end";
216 checkValues(element, "alignSelf", "align-self", "self-end", "self-end"); 216 checkValues(element, "alignSelf", "align-self", "self-end", "self-end");
217 217
218 debug(""); 218 debug("");
219 debug("Test 'auto' value resolution for the root node");
220 document.documentElement.style.alignSelf = "auto";
221 checkValues(document.documentElement, "alignSelf", "align-self", "auto", "norma l");
222
223 debug("");
219 debug("Test bad combinations of align-self"); 224 debug("Test bad combinations of align-self");
220 container = document.createElement("div"); 225 container = document.createElement("div");
221 element = document.createElement("div"); 226 element = document.createElement("div");
222 container.appendChild(element); 227 container.appendChild(element);
223 document.body.appendChild(container); 228 document.body.appendChild(container);
224 229
225 checkBadValues(element, "alignSelf", "align-self", "unsafe auto"); 230 checkBadValues(element, "alignSelf", "align-self", "unsafe auto");
226 checkBadValues(element, "alignSelf", "align-self", "auto safe"); 231 checkBadValues(element, "alignSelf", "align-self", "auto safe");
227 checkBadValues(element, "alignSelf", "align-self", "auto left"); 232 checkBadValues(element, "alignSelf", "align-self", "auto left");
228 checkBadValues(element, "alignSelf", "align-self", "baseline safe"); 233 checkBadValues(element, "alignSelf", "align-self", "baseline safe");
(...skipping 14 matching lines...) Expand all
243 checkBadValues(element, "alignSelf", "align-self", "legacy end"); 248 checkBadValues(element, "alignSelf", "align-self", "legacy end");
244 checkBadValues(element, "alignSelf", "align-self", "legacy right unsafe"); 249 checkBadValues(element, "alignSelf", "align-self", "legacy right unsafe");
245 checkBadValues(element, "alignSelf", "align-self", "legacy auto"); 250 checkBadValues(element, "alignSelf", "align-self", "legacy auto");
246 checkBadValues(element, "alignSelf", "align-self", "legacy stretch"); 251 checkBadValues(element, "alignSelf", "align-self", "legacy stretch");
247 checkBadValues(element, "alignSelf", "align-self", "legacy"); 252 checkBadValues(element, "alignSelf", "align-self", "legacy");
248 checkBadValues(element, "alignSelf", "align-self", "legacy left right"); 253 checkBadValues(element, "alignSelf", "align-self", "legacy left right");
249 254
250 debug(""); 255 debug("");
251 debug("Test the value 'initial'"); 256 debug("Test the value 'initial'");
252 container.style.display = ""; 257 container.style.display = "";
253 checkInitialValues(element, "alignSelf", "align-self", "center", "start"); 258 checkInitialValues(element, "alignSelf", "align-self", "center", "normal");
254 259
255 debug(""); 260 debug("");
256 debug("Test the value 'initial' for grid containers"); 261 debug("Test the value 'initial' for grid containers");
257 container.style.display = "grid"; 262 container.style.display = "grid";
258 checkInitialValues(element, "alignSelf", "align-self", "left safe", "stretch"); 263 checkInitialValues(element, "alignSelf", "align-self", "left safe", "normal");
259 264
260 debug(""); 265 debug("");
261 debug("Test the value 'initial' for flex containers"); 266 debug("Test the value 'initial' for flex containers");
262 container.style.display = "flex"; 267 container.style.display = "flex";
263 checkInitialValues(element, "alignSelf", "align-self", "right unsafe", "stretch" ); 268 checkInitialValues(element, "alignSelf", "align-self", "right unsafe", "normal") ;
264 269
265 debug(""); 270 debug("");
266 debug("Test the value 'initial' for positioned elements"); 271 debug("Test the value 'initial' for positioned elements");
267 container.style.display = ""; 272 container.style.display = "";
268 element.style.position = "absolute"; 273 element.style.position = "absolute";
269 checkInitialValues(element, "alignSelf", "align-self", "left", "start"); 274 checkInitialValues(element, "alignSelf", "align-self", "left", "normal");
270 275
271 debug(""); 276 debug("");
272 debug("Test the value 'initial' for positioned elements in grid containers"); 277 debug("Test the value 'initial' for positioned elements in grid containers");
273 container.style.display = "grid"; 278 container.style.display = "grid";
274 element.style.position = "absolute"; 279 element.style.position = "absolute";
275 checkInitialValues(element, "alignSelf", "align-self", "right", "stretch"); 280 checkInitialValues(element, "alignSelf", "align-self", "right", "normal");
276 281
277 debug(""); 282 debug("");
278 debug("Test the value 'initial' for positioned elements in grid containers"); 283 debug("Test the value 'initial' for positioned elements in grid containers");
279 container.style.display = "flex"; 284 container.style.display = "flex";
280 element.style.position = "absolute"; 285 element.style.position = "absolute";
281 checkInitialValues(element, "alignSelf", "align-self", "end", "stretch"); 286 checkInitialValues(element, "alignSelf", "align-self", "end", "normal");
282 287
283 debug(""); 288 debug("");
284 debug("Test the value 'inherit'"); 289 debug("Test the value 'inherit'");
285 checkInheritValues("alignSelf", "align-self", "end"); 290 checkInheritValues("alignSelf", "align-self", "end");
286 checkInheritValues("alignSelf", "align-self", "left safe"); 291 checkInheritValues("alignSelf", "align-self", "left safe");
287 checkInheritValues("alignSelf", "align-self", "center unsafe"); 292 checkInheritValues("alignSelf", "align-self", "center unsafe");
288 293
289 </script> 294 </script>
290 </body> 295 </body>
291 </html> 296 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698