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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/alignment/parse-place-items.html

Issue 2915773002: Reland of [css-align] Don't resolve 'auto' values for computed style. (Closed)
Patch Set: Applied suggested changes Created 3 years, 6 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 #placeItemsNormal { 5 #placeItemsNormal {
6 place-items: normal; 6 place-items: normal;
7 } 7 }
8 #placeItemsCenterAuto { 8 #placeItemsCenterAuto {
9 place-items: center auto; 9 place-items: center auto;
10 } 10 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 #placeItemsNone { 52 #placeItemsNone {
53 place-items: none; 53 place-items: none;
54 } 54 }
55 #placeItemsSafe { 55 #placeItemsSafe {
56 place-items: safe; 56 place-items: safe;
57 } 57 }
58 #placeItemsStartSafe { 58 #placeItemsStartSafe {
59 place-items: start safe; 59 place-items: start safe;
60 } 60 }
61 #placeItemsBaselineSafe {
62 place-items: baseline safe;
63 }
61 #placeItemsStartEndLeft { 64 #placeItemsStartEndLeft {
62 place-items: start end left; 65 place-items: start end left;
63 } 66 }
64 </style> 67 </style>
65 <script src="../../resources/testharness.js"></script> 68 <script src="../../resources/testharness.js"></script>
66 <script src="../../resources/testharnessreport.js"></script> 69 <script src="../../resources/testharnessreport.js"></script>
67 <script src="resources/alignment-parsing-utils-th.js"></script> 70 <script src="resources/alignment-parsing-utils-th.js"></script>
68 </head> 71 </head>
69 <body> 72 <body>
70 <p>Test to verify that the new place-items alignment shorthand is parsed as ex pected and correctly sets the longhand values.</p> 73 <p>Test to verify that the new place-items alignment shorthand is parsed as ex pected and correctly sets the longhand values.</p>
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 checkValues(placeItemsSafe, "placeItems", "place-items", "", "normal normal"); 203 checkValues(placeItemsSafe, "placeItems", "place-items", "", "normal normal");
201 checkPlaceItemsValues(placeItemsSafe, "", "normal", "normal"); 204 checkPlaceItemsValues(placeItemsSafe, "", "normal", "normal");
202 }, "Test setting 'safe' as incorrect value through CSS."); 205 }, "Test setting 'safe' as incorrect value through CSS.");
203 206
204 test(function() { 207 test(function() {
205 checkValues(placeItemsStartSafe, "placeItems", "place-items", "", "normal norm al"); 208 checkValues(placeItemsStartSafe, "placeItems", "place-items", "", "normal norm al");
206 checkPlaceItemsValues(placeItemsStartSafe, "", "normal", "normal"); 209 checkPlaceItemsValues(placeItemsStartSafe, "", "normal", "normal");
207 }, "Test setting 'start safe' as incorrect value through CSS."); 210 }, "Test setting 'start safe' as incorrect value through CSS.");
208 211
209 test(function() { 212 test(function() {
210 checkValues(placeItemsStartSafe, "placeItems", "place-items", "", "normal norm al"); 213 checkValues(placeItemsBaselineSafe, "placeItems", "place-items", "", "normal n ormal");
211 checkPlaceItemsValues(placeItemsStartSafe, "", "normal", "normal"); 214 checkPlaceItemsValues(placeItemsBaselineSafe, "", "normal", "normal");
212 }, "Test setting 'baseline safe' as incorrect value through CSS."); 215 }, "Test setting 'baseline safe' as incorrect value through CSS.");
213 216
214 test(function() { 217 test(function() {
215 checkValues(placeItemsStartEndLeft, "placeItems", "place-items", "", "normal n ormal"); 218 checkValues(placeItemsStartEndLeft, "placeItems", "place-items", "", "normal n ormal");
216 checkPlaceItemsValues(placeItemsStartEndLeft, "", "normal", "normal"); 219 checkPlaceItemsValues(placeItemsStartEndLeft, "", "normal", "normal");
217 }, "Test setting 'start end left' as incorrect value through CSS."); 220 }, "Test setting 'start end left' as incorrect value through CSS.");
218 221
219 test(function() { 222 test(function() {
220 checkPlaceItemsValuesJS("center", "center", "center"); 223 checkPlaceItemsValuesJS("center", "center", "center");
221 checkPlaceItemsValuesJS("center start", "center", "start"); 224 checkPlaceItemsValuesJS("center start", "center", "start");
222 checkPlaceItemsValuesJS("self-start end", "self-start", "end"); 225 checkPlaceItemsValuesJS("self-start end", "self-start", "end");
223 checkPlaceItemsValuesJS("normal end", "normal", "end"); 226 checkPlaceItemsValuesJS("normal end", "normal", "end");
224 }, "Test setting values through JS."); 227 }, "Test setting values through JS.");
225 228
226 test(function() { 229 test(function() {
227 checkPlaceItemsValuesBadJS("auto normal", "normal", "normal"); 230 checkPlaceItemsValuesBadJS("auto normal");
228 checkPlaceItemsValuesBadJS("space-between", "normal", "normal"); 231 checkPlaceItemsValuesBadJS("space-between");
229 checkPlaceItemsValuesBadJS("center safe", "normal", "normal"); 232 checkPlaceItemsValuesBadJS("center safe");
230 checkPlaceItemsValuesBadJS("center self-start center", "normal", "normal"); 233 checkPlaceItemsValuesBadJS("center self-start center");
231 checkPlaceItemsValuesBadJS("asrt", "normal", "normal"); 234 checkPlaceItemsValuesBadJS("asrt", "normal");
232 checkPlaceItemsValuesBadJS("auto", "normal", "normal"); 235 checkPlaceItemsValuesBadJS("auto", "normal");
233 checkPlaceItemsValuesBadJS("10px", "normal", "normal"); 236 checkPlaceItemsValuesBadJS("10px", "normal");
234 checkPlaceItemsValuesBadJS("stretch safe", "normal", "normal"); 237 checkPlaceItemsValuesBadJS("stretch safe");
235 checkPlaceItemsValuesBadJS("self-start start end", "normal", "normal"); 238 checkPlaceItemsValuesBadJS("self-start start end");
236 checkPlaceItemsValuesBadJS("", "normal", "normal"); 239 checkPlaceItemsValuesBadJS("");
237 }, "Test setting incorrect values through JS."); 240 }, "Test setting incorrect values through JS.");
238 241
239 test(function() { 242 test(function() {
240 element = document.createElement("div"); 243 element = document.createElement("div");
241 document.body.appendChild(element); 244 document.body.appendChild(element);
242 checkValues(element, "placeItems", "place-items", "", "normal normal"); 245 checkValues(element, "placeItems", "place-items", "", "normal normal");
243 element.style.placeItems = "center"; 246 element.style.placeItems = "center";
244 checkPlaceItemsValues(element, "center", "center", "center"); 247 checkPlaceItemsValues(element, "center", "center", "center");
245 element.style.placeItems = "initial"; 248 element.style.placeItems = "initial";
246 checkValues(element, "placeItems", "place-items", "initial", "normal normal"); 249 checkValues(element, "placeItems", "place-items", "initial", "normal normal");
247 checkPlaceItemsValues(element, "initial", "normal", "normal"); 250 checkPlaceItemsValues(element, "initial", "normal", "normal");
248 }, "Test the 'initial' value of the place-items shorthand and its longhand prope rties' Computed value"); 251 }, "Test the 'initial' value of the place-items shorthand and its longhand prope rties' Computed value");
249 252
250 test(function() { 253 test(function() {
251 document.body.style.placeItems = "start"; 254 document.body.style.placeItems = "start";
252 var anotherElement = document.createElement("div"); 255 var anotherElement = document.createElement("div");
253 document.body.appendChild(anotherElement); 256 document.body.appendChild(anotherElement);
254 checkPlaceItemsValues(anotherElement, "", "normal", "normal"); 257 checkPlaceItemsValues(anotherElement, "", "normal", "normal");
255 anotherElement.style.placeItems = "inherit"; 258 anotherElement.style.placeItems = "inherit";
256 checkPlaceItemsValues(anotherElement, "inherit", "start", "start"); 259 checkPlaceItemsValues(anotherElement, "inherit", "start", "start");
257 }, "Test the 'inherit' value of the place-items shorthand and its longhand prope rties' Computed value"); 260 }, "Test the 'inherit' value of the place-items shorthand and its longhand prope rties' Computed value");
258 </script> 261 </script>
259 </body> 262 </body>
260 </html> 263 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698