Title: [122508] trunk
Revision
122508
Author
[email protected]
Date
2012-07-12 14:38:33 -0700 (Thu, 12 Jul 2012)

Log Message

Implied minimum size of flex items is min-content
https://bugs.webkit.org/show_bug.cgi?id=87546

Reviewed by Tony Chang.

Source/WebCore:

http://dev.w3.org/csswg/css3-flexbox/#min-size-auto
In the main axis direction, min-size of auto means min-content.

Test: css3/flexbox/flex-item-min-size.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalWidthInRegionUsing):
(WebCore::RenderBox::computeContentLogicalHeightUsing):
(WebCore::RenderBox::computeReplacedLogicalWidthUsing):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
(WebCore::RenderBox::computePositionedLogicalWidthUsing):
(WebCore::RenderBox::computePositionedLogicalHeightUsing):
It turned out that these FIXMEs are all unnecessary with the changes to RenderFlexibleBox.

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes):
(WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):

LayoutTests:

Mostly just set min-height/min-width:0 as appropriate to keep the tests testing
what the used to be testing. I made sure that each rendering was correct before
making the changes. In a couple cases, I changed expectations where I thought
the test was still testing was it was intending to test.

* css3/flexbox/child-overflow.html:
* css3/flexbox/columns-auto-size.html:
* css3/flexbox/cross-axis-scrollbar.html:
* css3/flexbox/flex-item-min-size-expected.txt: Added.
* css3/flexbox/flex-item-min-size.html: Added.
* css3/flexbox/flexitem.html:
* css3/flexbox/line-wrapping.html:
* css3/flexbox/perpendicular-writing-modes-inside-flex-item.html:
* css3/flexbox/repaint-rtl-column.html:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (122507 => 122508)


--- trunk/LayoutTests/ChangeLog	2012-07-12 21:37:30 UTC (rev 122507)
+++ trunk/LayoutTests/ChangeLog	2012-07-12 21:38:33 UTC (rev 122508)
@@ -1,3 +1,25 @@
+2012-07-12  Ojan Vafai  <[email protected]>
+
+        Implied minimum size of flex items is min-content
+        https://bugs.webkit.org/show_bug.cgi?id=87546
+
+        Reviewed by Tony Chang.
+
+        Mostly just set min-height/min-width:0 as appropriate to keep the tests testing
+        what the used to be testing. I made sure that each rendering was correct before
+        making the changes. In a couple cases, I changed expectations where I thought
+        the test was still testing was it was intending to test.
+
+        * css3/flexbox/child-overflow.html:
+        * css3/flexbox/columns-auto-size.html:
+        * css3/flexbox/cross-axis-scrollbar.html:
+        * css3/flexbox/flex-item-min-size-expected.txt: Added.
+        * css3/flexbox/flex-item-min-size.html: Added.
+        * css3/flexbox/flexitem.html:
+        * css3/flexbox/line-wrapping.html:
+        * css3/flexbox/perpendicular-writing-modes-inside-flex-item.html:
+        * css3/flexbox/repaint-rtl-column.html:
+
 2012-07-12  Dirk Pranke  <[email protected]>
 
         nrwt crashes saving the output for a platform-specific expected test reference

Modified: trunk/LayoutTests/css3/flexbox/child-overflow.html (122507 => 122508)


--- trunk/LayoutTests/css3/flexbox/child-overflow.html	2012-07-12 21:37:30 UTC (rev 122507)
+++ trunk/LayoutTests/css3/flexbox/child-overflow.html	2012-07-12 21:38:33 UTC (rev 122508)
@@ -48,6 +48,8 @@
 
 .flexbox > div {
     overflow: auto;
+    min-width: 0;
+    min-height: 0;
 }
 
 .flexbox > div > div {

Modified: trunk/LayoutTests/css3/flexbox/columns-auto-size.html (122507 => 122508)


--- trunk/LayoutTests/css3/flexbox/columns-auto-size.html	2012-07-12 21:37:30 UTC (rev 122507)
+++ trunk/LayoutTests/css3/flexbox/columns-auto-size.html	2012-07-12 21:38:33 UTC (rev 122508)
@@ -59,7 +59,7 @@
   <div data-expected-height="0" data-offset-y="0" style="-webkit-flex: 1"></div>
   <div data-expected-height="10" data-offset-y="0" style="height: 10px;"></div>
   <div data-expected-height="10" data-offset-y="10" style="-webkit-flex: 1 auto"><div style="height: 10px"></div></div>
-  <div data-expected-height="0" data-offset-y="20" style="-webkit-flex: 1"><div data-expected-height="10" data-offset-y="20" class="child-div" style="height: 10px"></div></div>
+  <div data-expected-height="0" data-offset-y="20" style="min-height: 0; -webkit-flex: 1"><div data-expected-height="10" data-offset-y="20" class="child-div" style="height: 10px"></div></div>
 </div>
 
 <div class="flexbox horizontal">
@@ -87,13 +87,13 @@
 </div>
 
 <div class="flexbox horizontal" style="min-height: 5px; max-height: 17px;" data-expected-height="17">
-  <div data-expected-height="9" data-offset-y="0" style="-webkit-flex: 0 1 auto"><div style="height: 10px"></div></div>
-  <div data-expected-height="8" data-offset-y="9" style="-webkit-flex: 0 2 auto"><div style="height: 10px"></div></div>
+  <div data-expected-height="9" data-offset-y="0" style="min-height: 0; -webkit-flex: 0 1 auto"><div style="height: 10px"></div></div>
+  <div data-expected-height="8" data-offset-y="9" style="min-height: 0; -webkit-flex: 0 2 auto"><div style="height: 10px"></div></div>
 </div>
 
 <div class="flexbox horizontal" style="min-height: 5px; max-height: 30px; padding-top: 1px; padding-bottom: 2px;" data-expected-height="33">
-  <div data-expected-height="15" data-offset-y="1" style="-webkit-flex: 0 1 auto"><div style="height: 20px"></div></div>
-  <div data-expected-height="15" data-offset-y="16" style="-webkit-flex: 0 1 auto"><div style="height: 20px"></div></div>
+  <div data-expected-height="15" data-offset-y="1" style="min-height: 0; -webkit-flex: 0 1 auto"><div style="height: 20px"></div></div>
+  <div data-expected-height="15" data-offset-y="16" style="min-height: 0; -webkit-flex: 0 1 auto"><div style="height: 20px"></div></div>
 </div>
 
 <div class="flexbox horizontal">
@@ -108,7 +108,7 @@
 
 <!-- The first div overflows to the left, so give it a margin-left so we can see box it paints. -->
 <div class="flexbox vertical" style="margin-left: 100px;">
-  <div data-expected-width="0" data-offset-x="20" style="-webkit-flex: 1"><div data-expected-width="50" data-offset-x="-30" class="child-div" style="width: 50px"></div></div>
+  <div data-expected-width="0" data-offset-x="20" style="min-width: 0; -webkit-flex: 1"><div data-expected-width="50" data-offset-x="-30" class="child-div" style="width: 50px"></div></div>
   <div data-expected-width="0" data-offset-x="20" style="-webkit-flex: 1"></div>
   <div data-expected-width="10" data-offset-x="10" style="width: 10px;"></div>
   <div data-expected-width="10" data-offset-x="0" style="-webkit-flex: 1 auto"><div style="width: 10px"></div></div>

Modified: trunk/LayoutTests/css3/flexbox/cross-axis-scrollbar.html (122507 => 122508)


--- trunk/LayoutTests/css3/flexbox/cross-axis-scrollbar.html	2012-07-12 21:37:30 UTC (rev 122507)
+++ trunk/LayoutTests/css3/flexbox/cross-axis-scrollbar.html	2012-07-12 21:38:33 UTC (rev 122508)
@@ -33,6 +33,7 @@
     background-color: green;
     -webkit-flex: 1;
     height: 50px;
+    min-height: 0;
 }
 
 .vertical-lr > .column > div {

Added: trunk/LayoutTests/css3/flexbox/flex-item-min-size-expected.txt (0 => 122508)


--- trunk/LayoutTests/css3/flexbox/flex-item-min-size-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/css3/flexbox/flex-item-min-size-expected.txt	2012-07-12 21:38:33 UTC (rev 122508)
@@ -0,0 +1,16 @@
+Tests that flex items have default min-size to min-content in the main axis direction.
+ PASS
+ PASS
+ PASS
+ PASS
+ PASS
+ PASS
+ PASS
+ PASS
+ PASS
+ 
+ 
+PASS
+ 
+ 
+PASS
Property changes on: trunk/LayoutTests/css3/flexbox/flex-item-min-size-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/css3/flexbox/flex-item-min-size.html (0 => 122508)


--- trunk/LayoutTests/css3/flexbox/flex-item-min-size.html	                        (rev 0)
+++ trunk/LayoutTests/css3/flexbox/flex-item-min-size.html	2012-07-12 21:38:33 UTC (rev 122508)
@@ -0,0 +1,179 @@
+<!DOCTYPE html>
+<style>
+.flexbox {
+    display: -webkit-flex;
+    height: 0;
+    width: 0;
+    border: 4px solid blue
+}
+.column {
+    -webkit-flex-direction: column;
+}
+.flexitem {
+    -webkit-flex: 0;
+    background-color: orange;
+    line-height: 0;
+}
+.inlineContent {
+    display: inline-block;
+    height: 20px;
+    width: 20px;
+}
+.inlineContent:first-child {
+    background-color: salmon;
+}
+.inlineContent:last-child {
+    background-color: orange;
+}
+iframe {
+    border: 0;
+    outline: 2px solid blue;
+}
+.vertical-lr {
+    -webkit-writing-mode: vertical-lr;
+}
+.vertical-rl {
+    -webkit-writing-mode: vertical-rl;
+}
+.horizontal-bt {
+    -webkit-writing-mode: horizontal-bt;
+}
+</style>
+
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+<script src=""
+
+<body _onload_="checkFlexBoxen()">
+    <div>Tests that flex items have default min-size to min-content in the main axis direction.</div>
+    <div class="flexbox">
+        <div class="flexitem" data-expected-width=20 data-expected-height=0>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+        <div class="flexitem" data-expected-width=20 data-expected-height=0 data-expected-x=20>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+    </div>
+
+    <div class="flexbox column">
+        <div class="flexitem" data-expected-width=0 data-expected-height=40>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+        <div class="flexitem" data-expected-width=0 data-expected-height=40 data-expected-y=40>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+    </div>
+
+    <div class="flexbox vertical-lr">
+        <div class="flexitem" data-expected-width=0 data-expected-height=20>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+        <div class="flexitem" data-expected-width=0 data-expected-height=20 data-expected-y=20>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+    </div>
+
+    <div class="flexbox column vertical-lr">
+        <div class="flexitem" data-expected-width=40 data-expected-height=0>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+        <div class="flexitem" data-expected-width=40 data-expected-height=0 data-expected-x=40>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+    </div>
+
+    <div class="flexbox vertical-rl">
+        <div class="flexitem" data-expected-width=0 data-expected-height=20>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+        <div class="flexitem" data-expected-width=0 data-expected-height=20 data-expected-y=20>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+    </div>
+
+    <div class="flexbox column vertical-rl">
+        <div class="flexitem" data-expected-width=40 data-expected-height=0>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+        <div class="flexitem" data-expected-width=40 data-expected-height=0 data-expected-x=40>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+    </div>
+
+    <div class="flexbox horizontal-bt">
+        <div class="flexitem" data-expected-width=20 data-expected-height=0>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+        <div class="flexitem" data-expected-width=20 data-expected-height=0 data-expected-x=20>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+    </div>
+
+    <div class="flexbox column horizontal-bt">
+        <div class="flexitem" data-expected-width=0 data-expected-height=40>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+        <div class="flexitem" data-expected-width=0 data-expected-height=40 data-expected-y=40>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+    </div>
+
+    <div class="flexbox">
+        <div class="flexitem" data-expected-width=20 data-expected-height=0>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+        <div class="flexitem vertical-lr" data-expected-width=40 data-expected-height=20>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+        <div class="flexitem vertical-rl" data-expected-width=40 data-expected-height=20>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+        <div class="flexitem horizontal-bt" data-expected-width=20 data-expected-height=0>
+            <div class="inlineContent"></div>
+            <div class="inlineContent"></div>
+        </div>
+    </div>
+
+    <div class="flexbox">
+        <div class="flexitem" data-expected-width=300 data-expected-height=0>
+            <iframe></iframe>
+            <iframe></iframe>
+        </div>
+        <div class="flexitem" data-expected-width=300 data-expected-height=0 data-expected-x=300>
+            <iframe></iframe>
+            <iframe></iframe>
+        </div>
+    </div>
+
+    <div class="flexbox column">
+        <div class="flexitem" data-expected-width=0 data-expected-height=300>
+            <iframe></iframe>
+            <iframe></iframe>
+        </div>
+        <div class="flexitem" data-expected-width=0 data-expected-height=300 data-expected-y=300>
+            <iframe></iframe>
+            <iframe></iframe>
+        </div>
+    </div>
+</body>
Property changes on: trunk/LayoutTests/css3/flexbox/flex-item-min-size.html
___________________________________________________________________

Added: svn:mime-type

Added: svn:eol-style

Modified: trunk/LayoutTests/css3/flexbox/flexitem.html (122507 => 122508)


--- trunk/LayoutTests/css3/flexbox/flexitem.html	2012-07-12 21:37:30 UTC (rev 122507)
+++ trunk/LayoutTests/css3/flexbox/flexitem.html	2012-07-12 21:38:33 UTC (rev 122508)
@@ -14,6 +14,7 @@
     border: 0;
     padding: 0;
     font-size: 12px;
+    min-width: 0;
 }
 </style>
 <script>

Modified: trunk/LayoutTests/css3/flexbox/line-wrapping.html (122507 => 122508)


--- trunk/LayoutTests/css3/flexbox/line-wrapping.html	2012-07-12 21:37:30 UTC (rev 122507)
+++ trunk/LayoutTests/css3/flexbox/line-wrapping.html	2012-07-12 21:38:33 UTC (rev 122508)
@@ -149,12 +149,12 @@
     </div>
 </div>
 
-<div data-expected-width=500 data-expected-height=0 class="flexbox auto column horizontal-tb">
-    <div data-expected-width=500 data-expected-height=0>
+<div data-expected-width=500 data-expected-height=80 class="flexbox auto column horizontal-tb">
+    <div data-expected-width=500 data-expected-height=40>
         <div data-offset-y=0></div><div data-offset-y=0></div><div data-offset-y=0></div><div data-offset-y=0></div><div data-offset-y=0></div><div data-offset-y=20 data-offset-x=0></div>
     </div>
-    <div data-expected-width=500 data-expected-height=0 style="-webkit-align-self: flex-start;">
-        <div data-offset-y=0></div><div data-offset-y=0></div><div data-offset-y=0></div><div data-offset-y=0></div><div data-offset-y=0></div><div data-offset-y=20 data-offset-x=0></div>
+    <div data-expected-width=500 data-expected-height=40 style="-webkit-align-self: flex-start;">
+        <div data-offset-y=40></div><div data-offset-y=40></div><div data-offset-y=40></div><div data-offset-y=40></div><div data-offset-y=40></div><div data-offset-y=60 data-offset-x=0></div>
     </div>
 </div>
 
@@ -196,12 +196,12 @@
     </div>
 </div>
 
-<div data-expected-height=500 data-expected-width=0 class="flexbox auto column vertical-lr">
-    <div data-expected-height=500 data-expected-width=0>
+<div data-expected-height=500 data-expected-width=80 class="flexbox auto column vertical-lr">
+    <div data-expected-height=500 data-expected-width=40>
         <div data-offset-x=4></div><div data-offset-x=4></div><div data-offset-x=4></div><div data-offset-x=4></div><div data-offset-x=4></div><div data-offset-x=24 data-offset-y=0></div>
     </div>
-    <div data-expected-height=500 data-expected-width=0 style="-webkit-align-self: flex-start;">
-        <div data-offset-x=4></div><div data-offset-x=4></div><div data-offset-x=4></div><div data-offset-x=4></div><div data-offset-x=4></div><div data-offset-x=24 data-offset-y=0></div>
+    <div data-expected-height=500 data-expected-width=40 style="-webkit-align-self: flex-start;">
+        <div data-offset-x=44></div><div data-offset-x=44></div><div data-offset-x=44></div><div data-offset-x=44></div><div data-offset-x=44></div><div data-offset-x=64 data-offset-y=0></div>
     </div>
 </div>
 
@@ -242,15 +242,12 @@
     </div>
 </div>
 
-<!-- Not sure if these negative offsets are correct, but if there's a bug it's not a flexbox bug, e.g. the following html gets the same negative offsets:
-<div style="-webkit-writing-mode:vertical-rl;"><div style="width: 0"><div style="display: inline-block; height: 40px; width: 20px; background-color: blue;"></div></div></div>
--->
-<div data-expected-height=500 data-expected-width=0 class="flexbox auto column vertical-rl">
-    <div data-expected-height=500 data-expected-width=0>
-        <div data-offset-x=-20></div><div data-offset-x=-20></div><div data-offset-x=-20></div><div data-offset-x=-20></div><div data-offset-x=-20></div><div data-offset-x=-40 data-offset-y=0></div>
+<div data-expected-height=500 data-expected-width=80 class="flexbox auto column vertical-rl">
+    <div data-expected-height=500 data-expected-width=40>
+        <div data-offset-x=60></div><div data-offset-x=60></div><div data-offset-x=60></div><div data-offset-x=60></div><div data-offset-x=60></div><div data-offset-x=40 data-offset-y=0></div>
     </div>
-    <div data-expected-height=500 data-expected-width=0 style="-webkit-align-self: flex-start;">
-        <div data-offset-x=-20></div><div data-offset-x=-20></div><div data-offset-x=-20></div><div data-offset-x=-20></div><div data-offset-x=-20></div><div data-offset-x=-40 data-offset-y=0></div>
+    <div data-expected-height=500 data-expected-width=40 style="-webkit-align-self: flex-start;">
+        <div data-offset-x=20></div><div data-offset-x=20></div><div data-offset-x=20></div><div data-offset-x=20></div><div data-offset-x=20></div><div data-offset-x=0 data-offset-y=0></div>
     </div>
 </div>
 

Modified: trunk/LayoutTests/css3/flexbox/perpendicular-writing-modes-inside-flex-item.html (122507 => 122508)


--- trunk/LayoutTests/css3/flexbox/perpendicular-writing-modes-inside-flex-item.html	2012-07-12 21:37:30 UTC (rev 122507)
+++ trunk/LayoutTests/css3/flexbox/perpendicular-writing-modes-inside-flex-item.html	2012-07-12 21:38:33 UTC (rev 122508)
@@ -12,6 +12,7 @@
     -webkit-flex: 1;
     padding: 3px;
     border: 4px solid cyan;
+    min-height: 0;
 }
 .vertical {
     position: relative;

Modified: trunk/LayoutTests/css3/flexbox/repaint-rtl-column.html (122507 => 122508)


--- trunk/LayoutTests/css3/flexbox/repaint-rtl-column.html	2012-07-12 21:37:30 UTC (rev 122507)
+++ trunk/LayoutTests/css3/flexbox/repaint-rtl-column.html	2012-07-12 21:38:33 UTC (rev 122508)
@@ -9,10 +9,12 @@
 #left {
     -webkit-flex: 1;
     background-color: yellow;
+    min-height: 0;
 }
 #content {
     -webkit-flex: 1;
     border: 5px solid blue;
+    min-height: 0;
 }
 #content > div {
     height: 350px;

Modified: trunk/Source/WebCore/ChangeLog (122507 => 122508)


--- trunk/Source/WebCore/ChangeLog	2012-07-12 21:37:30 UTC (rev 122507)
+++ trunk/Source/WebCore/ChangeLog	2012-07-12 21:38:33 UTC (rev 122508)
@@ -1,3 +1,28 @@
+2012-07-12  Ojan Vafai  <[email protected]>
+
+        Implied minimum size of flex items is min-content
+        https://bugs.webkit.org/show_bug.cgi?id=87546
+
+        Reviewed by Tony Chang.
+
+        http://dev.w3.org/csswg/css3-flexbox/#min-size-auto
+        In the main axis direction, min-size of auto means min-content.
+
+        Test: css3/flexbox/flex-item-min-size.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
+        (WebCore::RenderBox::computeContentLogicalHeightUsing):
+        (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
+        (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
+        (WebCore::RenderBox::computePositionedLogicalWidthUsing):
+        (WebCore::RenderBox::computePositionedLogicalHeightUsing):
+        It turned out that these FIXMEs are all unnecessary with the changes to RenderFlexibleBox.
+
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes):
+        (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
+
 2012-07-12  Eric Penner  <[email protected]>
 
         [chromium] Use CCTexture/TextureAllocator and remove TextureManager

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (122507 => 122508)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2012-07-12 21:37:30 UTC (rev 122507)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2012-07-12 21:38:33 UTC (rev 122508)
@@ -1740,7 +1740,6 @@
 
     ASSERT(!logicalWidth.isUndefined());
 
-    // FIXME: minWidth:auto on a flex-item needs to go down the intrinsicOrAuto path below.
     if (widthType == MinSize && logicalWidth.isAuto())
         return computeBorderBoxLogicalWidth(0);
     
@@ -2076,10 +2075,8 @@
 
 LayoutUnit RenderBox::computeContentLogicalHeightUsing(SizeType heightType, const Length& height)
 {
-    // FIXME: For flexboxes, minHeight:auto should be min-content.
     if (height.isAuto())
         return heightType == MinSize ? 0 : -1;
- 
     if (height.isFixed())
         return height.value();
     if (height.isPercent())
@@ -2188,7 +2185,6 @@
 
 LayoutUnit RenderBox::computeReplacedLogicalWidthUsing(SizeType sizeType, Length logicalWidth) const
 {
-    // FIXME: For flexboxes, minWidth:auto should be min-content.
     if (sizeType == MinSize && logicalWidth.isAuto())
         return computeContentBoxLogicalWidth(0);
 
@@ -2231,7 +2227,6 @@
 
 LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(SizeType sizeType, Length logicalHeight) const
 {
-    // FIXME: For flexboxes, minWidth:auto should be min-content.
     if (sizeType == MinSize && logicalHeight.isAuto())
         return computeContentBoxLogicalHeight(0);
 
@@ -2669,7 +2664,6 @@
                                                    Length logicalLeft, Length logicalRight, Length marginLogicalLeft, Length marginLogicalRight,
                                                    LayoutUnit& logicalWidthValue, LayoutUnit& marginLogicalLeftValue, LayoutUnit& marginLogicalRightValue, LayoutUnit& logicalLeftPos)
 {
-    // FIXME: What should flex items do here since min-width:auto == min-width:min-content instead of min-width:auto == min-width:0.
     if (widthSizeType == MinSize && logicalWidth.isAuto())
         logicalWidth = Length(0, Fixed);
 
@@ -3003,7 +2997,6 @@
                                                     Length logicalTop, Length logicalBottom, Length marginBefore, Length marginAfter,
                                                     LayoutUnit& logicalHeightValue, LayoutUnit& marginBeforeValue, LayoutUnit& marginAfterValue, LayoutUnit& logicalTopPos)
 {
-    // FIXME: What should flex items do here since min-height:auto == min-height:min-content instead of min-height:auto == min-height:0.
     if (heightSizeType == MinSize && logicalHeightLength.isAuto())
         logicalHeightLength = Length(0, Fixed);
 
@@ -3015,7 +3008,6 @@
 
     LayoutUnit logicalTopValue = 0;
 
-    // FIXME: For non-flexboxes + min-height, this needs to treat non-flexboxes as 0.
     bool logicalHeightIsAuto = logicalHeightLength.isAuto();
     bool logicalTopIsAuto = logicalTop.isAuto();
     bool logicalBottomIsAuto = logicalBottom.isAuto();

Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (122507 => 122508)


--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2012-07-12 21:37:30 UTC (rev 122507)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2012-07-12 21:38:33 UTC (rev 122508)
@@ -751,7 +751,8 @@
 
         child->clearOverrideSize();
         // Only need to layout here if we will need to get the logicalHeight of the child in computeNextFlexLine.
-        if (hasOrthogonalFlow(child) && flexBasisForChild(child).isAuto()) {
+        Length childMainAxisMin = isHorizontalFlow() ? child->style()->minWidth() : child->style()->minHeight();
+        if (hasOrthogonalFlow(child) && (flexBasisForChild(child).isAuto() || childMainAxisMin.isAuto())) {
             if (!relayoutChildren)
                 child->setChildNeedsLayout(true);
             child->layoutIfNeeded();
@@ -792,9 +793,17 @@
     // https://bugs.webkit.org/show_bug.cgi?id=81809
     if (max.isSpecified() && childSize > valueForLength(max, flexboxAvailableContentExtent, renderView))
         childSize = valueForLength(max, flexboxAvailableContentExtent, renderView);
-    // FIXME: Treat auto min values as min-content.
+
     if (min.isSpecified() && childSize < valueForLength(min, flexboxAvailableContentExtent, renderView))
-        childSize = valueForLength(min, flexboxAvailableContentExtent, renderView);
+        return valueForLength(min, flexboxAvailableContentExtent, renderView);
+
+    // FIXME: Support min/max sizes of fit-content, max-content and fill-available.
+    if (min.isAuto()) {
+        LayoutUnit minContent = hasOrthogonalFlow(child) ? child->logicalHeight() : child->minPreferredLogicalWidth();
+        minContent -= mainAxisBorderAndPaddingExtentForChild(child);
+        return std::max(childSize, minContent);
+    }
+
     return childSize;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to