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

Side by Side Diff: LayoutTests/css3/flexbox/flex-property-parsing.html

Issue 478233004: Flexbox flex: 1 incorrectly sets flex-basis to 0px (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <div id="flexbox"> 7 <div id="flexbox">
8 <div id="flexitem"></div> 8 <div id="flexitem"></div>
9 </div> 9 </div>
10 <script> 10 <script>
(...skipping 10 matching lines...) Expand all
21 flexbox.style.webkitFlex = '1 2 3px'; 21 flexbox.style.webkitFlex = '1 2 3px';
22 shouldBeEqualToString('flexitem.style.webkitFlex', ''); 22 shouldBeEqualToString('flexitem.style.webkitFlex', '');
23 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 1 auto'); 23 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 1 auto');
24 24
25 // Invalid value. 25 // Invalid value.
26 flexitem.style.webkitFlex = 'junk'; 26 flexitem.style.webkitFlex = 'junk';
27 shouldBeEqualToString('flexitem.style.webkitFlex', ''); 27 shouldBeEqualToString('flexitem.style.webkitFlex', '');
28 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 1 auto'); 28 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 1 auto');
29 29
30 flexitem.style.webkitFlex = '2'; 30 flexitem.style.webkitFlex = '2';
31 shouldBeEqualToString('flexitem.style.webkitFlex', '2 1 0px'); 31 shouldBeEqualToString('flexitem.style.webkitFlex', '2 1 0%');
32 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '2 1 0px'); 32 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '2 1 0%');
33 33
34 flexitem.style.webkitFlex = '0'; 34 flexitem.style.webkitFlex = '0';
35 shouldBeEqualToString('flexitem.style.webkitFlex', '0 1 0px'); 35 shouldBeEqualToString('flexitem.style.webkitFlex', '0 1 0%');
36 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 1 0px'); 36 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 1 0%');
37 37
38 flexitem.style.webkitFlex = '1.5'; 38 flexitem.style.webkitFlex = '1.5';
39 shouldBeEqualToString('flexitem.style.webkitFlex', '1.5 1 0px'); 39 shouldBeEqualToString('flexitem.style.webkitFlex', '1.5 1 0%');
40 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1.5 1 0px'); 40 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1.5 1 0%');
41 41
42 flexitem.style.webkitFlex = 'auto'; 42 flexitem.style.webkitFlex = 'auto';
43 shouldBeEqualToString('flexitem.style.webkitFlex', '1 1 auto'); 43 shouldBeEqualToString('flexitem.style.webkitFlex', '1 1 auto');
44 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1 1 auto'); 44 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1 1 auto');
45 45
46 flexitem.style.webkitFlex = '1px'; 46 flexitem.style.webkitFlex = '1px';
47 shouldBeEqualToString('flexitem.style.webkitFlex', '1 1 1px'); 47 shouldBeEqualToString('flexitem.style.webkitFlex', '1 1 1px');
48 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1 1 1px'); 48 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1 1 1px');
49 49
50 flexitem.style.webkitFlex = '2em'; 50 flexitem.style.webkitFlex = '2em';
51 shouldBeEqualToString('flexitem.style.webkitFlex', '1 1 2em'); 51 shouldBeEqualToString('flexitem.style.webkitFlex', '1 1 2em');
52 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1 1 32px'); 52 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1 1 32px');
53 53
54 flexitem.style.webkitFlex = '0px'; 54 flexitem.style.webkitFlex = '0px';
55 shouldBeEqualToString('flexitem.style.webkitFlex', '1 1 0px'); 55 shouldBeEqualToString('flexitem.style.webkitFlex', '1 1 0px');
56 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1 1 0px'); 56 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1 1 0px');
57 57
58 flexitem.style.webkitFlex = 'none'; 58 flexitem.style.webkitFlex = 'none';
59 flexitem.style.webkitFlex = '-2'; // Invalid, return previous value. 59 flexitem.style.webkitFlex = '-2'; // Invalid, return previous value.
60 shouldBeEqualToString('flexitem.style.webkitFlex', '0 0 auto'); 60 shouldBeEqualToString('flexitem.style.webkitFlex', '0 0 auto');
61 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 0 auto'); 61 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 0 auto');
62 62
63 flexitem.style.webkitFlex = '0 0'; 63 flexitem.style.webkitFlex = '0 0';
64 shouldBeEqualToString('flexitem.style.webkitFlex', '0 0 0px'); 64 shouldBeEqualToString('flexitem.style.webkitFlex', '0 0 0%');
65 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 0 0px'); 65 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 0 0%');
66 66
67 flexitem.style.webkitFlex = '0 1'; 67 flexitem.style.webkitFlex = '0 1';
68 shouldBeEqualToString('flexitem.style.webkitFlex', '0 1 0px'); 68 shouldBeEqualToString('flexitem.style.webkitFlex', '0 1 0%');
69 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 1 0px'); 69 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 1 0%');
70 70
71 flexitem.style.webkitFlex = '1 0'; 71 flexitem.style.webkitFlex = '1 0';
72 shouldBeEqualToString('flexitem.style.webkitFlex', '1 0 0px'); 72 shouldBeEqualToString('flexitem.style.webkitFlex', '1 0 0%');
73 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1 0 0px'); 73 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1 0 0%');
74 74
75 flexitem.style.webkitFlex = '2 auto'; 75 flexitem.style.webkitFlex = '2 auto';
76 shouldBeEqualToString('flexitem.style.webkitFlex', '2 1 auto'); 76 shouldBeEqualToString('flexitem.style.webkitFlex', '2 1 auto');
77 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '2 1 auto'); 77 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '2 1 auto');
78 78
79 flexitem.style.webkitFlex = '3 4px'; 79 flexitem.style.webkitFlex = '3 4px';
80 shouldBeEqualToString('flexitem.style.webkitFlex', '3 1 4px'); 80 shouldBeEqualToString('flexitem.style.webkitFlex', '3 1 4px');
81 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '3 1 4px'); 81 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '3 1 4px');
82 82
83 flexitem.style.webkitFlex = 'auto 5.25'; 83 flexitem.style.webkitFlex = 'auto 5.25';
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 shouldBeEqualToString('flexitem.style.webkitFlex', 'initial'); 230 shouldBeEqualToString('flexitem.style.webkitFlex', 'initial');
231 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 1 auto'); 231 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 1 auto');
232 232
233 flexitem.style.webkitFlex = 'none'; 233 flexitem.style.webkitFlex = 'none';
234 // FIXME: This test case is failing. https://bugs.webkit.org/show_bug.cgi?id=900 20 234 // FIXME: This test case is failing. https://bugs.webkit.org/show_bug.cgi?id=900 20
235 shouldBeEqualToString('flexitem.style.webkitFlex', '0 0 auto'); 235 shouldBeEqualToString('flexitem.style.webkitFlex', '0 0 auto');
236 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 0 auto'); 236 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 0 auto');
237 </script> 237 </script>
238 </body> 238 </body>
239 </html> 239 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698