Title: [129414] trunk
Revision
129414
Author
[email protected]
Date
2012-09-24 14:35:13 -0700 (Mon, 24 Sep 2012)

Log Message

flex-grow should be 1 when omitted from flex shorthand
https://bugs.webkit.org/show_bug.cgi?id=97480

Reviewed by Ojan Vafai.

Source/WebCore:

We were using 0, based on an outdated version of the spec.

Tests: css3/flexbox/flex-property-parsing.html
       css3/flexbox/flex-algorithm.html: New test case.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseFlex):

LayoutTests:

Update tests due to default CSS value changes.

* css3/flexbox/flex-algorithm-expected.txt:
* css3/flexbox/flex-algorithm.html: Add test case using -webkit-flex: auto.
* css3/flexbox/flex-property-parsing-expected.txt:
* css3/flexbox/flex-property-parsing.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (129413 => 129414)


--- trunk/LayoutTests/ChangeLog	2012-09-24 21:32:45 UTC (rev 129413)
+++ trunk/LayoutTests/ChangeLog	2012-09-24 21:35:13 UTC (rev 129414)
@@ -1,3 +1,17 @@
+2012-09-24  Tony Chang  <[email protected]>
+
+        flex-grow should be 1 when omitted from flex shorthand
+        https://bugs.webkit.org/show_bug.cgi?id=97480
+
+        Reviewed by Ojan Vafai.
+
+        Update tests due to default CSS value changes.
+
+        * css3/flexbox/flex-algorithm-expected.txt:
+        * css3/flexbox/flex-algorithm.html: Add test case using -webkit-flex: auto.
+        * css3/flexbox/flex-property-parsing-expected.txt:
+        * css3/flexbox/flex-property-parsing.html:
+
 2012-09-24  Hans Muller  <[email protected]>
 
         [CSS Exclusions] ExclusionShape API should use logical coordinates for input/output

Modified: trunk/LayoutTests/css3/flexbox/flex-algorithm-expected.txt (129413 => 129414)


--- trunk/LayoutTests/css3/flexbox/flex-algorithm-expected.txt	2012-09-24 21:32:45 UTC (rev 129413)
+++ trunk/LayoutTests/css3/flexbox/flex-algorithm-expected.txt	2012-09-24 21:35:13 UTC (rev 129414)
@@ -22,4 +22,5 @@
 PASS
 PASS
 PASS
+PASS
 

Modified: trunk/LayoutTests/css3/flexbox/flex-algorithm.html (129413 => 129414)


--- trunk/LayoutTests/css3/flexbox/flex-algorithm.html	2012-09-24 21:32:45 UTC (rev 129413)
+++ trunk/LayoutTests/css3/flexbox/flex-algorithm.html	2012-09-24 21:35:13 UTC (rev 129414)
@@ -175,6 +175,16 @@
   <div data-expected-width="200" style="-webkit-flex: 1"></div>
 </div>
 
+<div class="flexbox">
+  <div data-expected-width="200" style="-webkit-flex: auto">
+      <div style="width: 100px;"></div>
+  </div>
+  <div data-expected-width="100" style="-webkit-flex: auto"></div>
+  <div data-expected-width="300" style="-webkit-flex: auto">
+      <div style="width: 200px;"></div>
+  </div>
+</div>
+
 <!-- Test border/padding/margin on the flexbox itself. -->
 <div data-expected-width="830" style="border: 10px solid; display: inline-block;">
     <div data-expected-width="700" style="display: -webkit-flex; padding-left: 10px; padding-right: 20px; border-left: 30px solid; border-right: 40px solid; margin-left: 50px; margin-right:60px;" class="flexbox ">

Modified: trunk/LayoutTests/css3/flexbox/flex-property-parsing-expected.txt (129413 => 129414)


--- trunk/LayoutTests/css3/flexbox/flex-property-parsing-expected.txt	2012-09-24 21:32:45 UTC (rev 129413)
+++ trunk/LayoutTests/css3/flexbox/flex-property-parsing-expected.txt	2012-09-24 21:35:13 UTC (rev 129414)
@@ -15,14 +15,14 @@
 PASS getComputedStyle(flexitem).webkitFlex is "0 1 0px"
 PASS flexitem.style.webkitFlex is "1.5 1 0px"
 PASS getComputedStyle(flexitem).webkitFlex is "1.5 1 0px"
-PASS flexitem.style.webkitFlex is "0 1 auto"
-PASS getComputedStyle(flexitem).webkitFlex is "0 1 auto"
-PASS flexitem.style.webkitFlex is "0 1 1px"
-PASS getComputedStyle(flexitem).webkitFlex is "0 1 1px"
-PASS flexitem.style.webkitFlex is "0 1 2em"
-PASS getComputedStyle(flexitem).webkitFlex is "0 1 32px"
-PASS flexitem.style.webkitFlex is "0 1 0px"
-PASS getComputedStyle(flexitem).webkitFlex is "0 1 0px"
+PASS flexitem.style.webkitFlex is "1 1 auto"
+PASS getComputedStyle(flexitem).webkitFlex is "1 1 auto"
+PASS flexitem.style.webkitFlex is "1 1 1px"
+PASS getComputedStyle(flexitem).webkitFlex is "1 1 1px"
+PASS flexitem.style.webkitFlex is "1 1 2em"
+PASS getComputedStyle(flexitem).webkitFlex is "1 1 32px"
+PASS flexitem.style.webkitFlex is "1 1 0px"
+PASS getComputedStyle(flexitem).webkitFlex is "1 1 0px"
 PASS flexitem.style.webkitFlex is "0 0 auto"
 PASS getComputedStyle(flexitem).webkitFlex is "0 0 auto"
 PASS flexitem.style.webkitFlex is "0 0 0px"

Modified: trunk/LayoutTests/css3/flexbox/flex-property-parsing.html (129413 => 129414)


--- trunk/LayoutTests/css3/flexbox/flex-property-parsing.html	2012-09-24 21:32:45 UTC (rev 129413)
+++ trunk/LayoutTests/css3/flexbox/flex-property-parsing.html	2012-09-24 21:35:13 UTC (rev 129414)
@@ -40,20 +40,20 @@
 shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1.5 1 0px');
 
 flexitem.style.webkitFlex = 'auto';
-shouldBeEqualToString('flexitem.style.webkitFlex', '0 1 auto');
-shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 1 auto');
+shouldBeEqualToString('flexitem.style.webkitFlex', '1 1 auto');
+shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1 1 auto');
 
 flexitem.style.webkitFlex = '1px';
-shouldBeEqualToString('flexitem.style.webkitFlex', '0 1 1px');
-shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 1 1px');
+shouldBeEqualToString('flexitem.style.webkitFlex', '1 1 1px');
+shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1 1 1px');
 
 flexitem.style.webkitFlex = '2em';
-shouldBeEqualToString('flexitem.style.webkitFlex', '0 1 2em');
-shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 1 32px');
+shouldBeEqualToString('flexitem.style.webkitFlex', '1 1 2em');
+shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1 1 32px');
 
 flexitem.style.webkitFlex = '0px';
-shouldBeEqualToString('flexitem.style.webkitFlex', '0 1 0px');
-shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 1 0px');
+shouldBeEqualToString('flexitem.style.webkitFlex', '1 1 0px');
+shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1 1 0px');
 
 flexitem.style.webkitFlex = 'none';
 flexitem.style.webkitFlex = '-2'; // Invalid, return previous value.

Modified: trunk/Source/WebCore/ChangeLog (129413 => 129414)


--- trunk/Source/WebCore/ChangeLog	2012-09-24 21:32:45 UTC (rev 129413)
+++ trunk/Source/WebCore/ChangeLog	2012-09-24 21:35:13 UTC (rev 129414)
@@ -1,3 +1,18 @@
+2012-09-24  Tony Chang  <[email protected]>
+
+        flex-grow should be 1 when omitted from flex shorthand
+        https://bugs.webkit.org/show_bug.cgi?id=97480
+
+        Reviewed by Ojan Vafai.
+
+        We were using 0, based on an outdated version of the spec.
+
+        Tests: css3/flexbox/flex-property-parsing.html
+               css3/flexbox/flex-algorithm.html: New test case.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseFlex):
+
 2012-09-24  Benjamin Poulain  <[email protected]>
 
         Add support for query encoding to WTFURL

Modified: trunk/Source/WebCore/css/CSSParser.cpp (129413 => 129414)


--- trunk/Source/WebCore/css/CSSParser.cpp	2012-09-24 21:32:45 UTC (rev 129413)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2012-09-24 21:35:13 UTC (rev 129414)
@@ -5994,7 +5994,7 @@
     }
 
     if (flexGrow == unsetValue)
-        flexGrow = 0;
+        flexGrow = 1;
     if (flexShrink == unsetValue)
         flexShrink = 1;
     if (!flexBasis)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to