Title: [104211] branches/safari-534.54-branch

Diff

Modified: branches/safari-534.54-branch/LayoutTests/ChangeLog (104210 => 104211)


--- branches/safari-534.54-branch/LayoutTests/ChangeLog	2012-01-05 21:48:50 UTC (rev 104210)
+++ branches/safari-534.54-branch/LayoutTests/ChangeLog	2012-01-05 21:56:24 UTC (rev 104211)
@@ -1,5 +1,34 @@
 2011-1-5  Lucas Forschler  <[email protected]>
 
+    Merge 98033
+
+    2011-10-20  Julien Chaffraix  <[email protected]>
+
+            RenderDeprecatedFlexibleBox does not call its children's layout method
+            https://bugs.webkit.org/show_bug.cgi?id=64842
+
+            Reviewed by David Hyatt.
+
+            Added a test covering the vertical change as the horizontal one is covered
+            by 021.html. The test is failing currently as we don't properly support this
+            case.
+
+            * fast/flexbox/021-vertical-expected.png: Added.
+            * fast/flexbox/021-vertical-expected.txt: Added.
+            * fast/flexbox/021-vertical.html: Added.
+            * fast/flexbox/crash-flexbox-no-layout-child-expected.txt: Added.
+            * fast/flexbox/crash-flexbox-no-layout-child.html: Added.
+
+            * platform/chromium-win/fast/flexbox/021-expected.txt:
+            * platform/efl/fast/flexbox/021-expected.txt:
+            * platform/gtk/fast/flexbox/021-expected.txt:
+            * platform/mac/fast/flexbox/021-expected.txt:
+            * platform/qt/fast/flexbox/021-expected.txt:
+            Updated as we now layout out this flex-box. The image result should not
+            change as it doesn't contribute to the visible flexbox layout.
+
+2011-1-5  Lucas Forschler  <[email protected]>
+
     Merge 98010
 
     2011-10-20  Ken Buchanan <[email protected]>

Copied: branches/safari-534.54-branch/LayoutTests/fast/flexbox/021-vertical-expected.png (from rev 98033, trunk/LayoutTests/fast/flexbox/021-vertical-expected.png) (0 => 104211)


--- branches/safari-534.54-branch/LayoutTests/fast/flexbox/021-vertical-expected.png	                        (rev 0)
+++ branches/safari-534.54-branch/LayoutTests/fast/flexbox/021-vertical-expected.png	2012-01-05 21:56:24 UTC (rev 104211)
@@ -0,0 +1,5 @@
+\x89PNG
+
+
+IHDR X')tEXtchecksumc0fee90186c7c7a1304dce56aa9b46bc\xDB]`\x93
+\xC6IDATx\x9C\xED\xDC1\xC20EA\x8C88\x9C|\xD3R$\xC5\x96\xA2\x99\xD6\xCD/\x9F\xB6\xF0\x9A\x99\x9D\xE7\xEEw#\xB0b &\xB0b &\xB0b \xF6\xBAzX\x9F\xF5\xCF?\x9A\xF7\xEE\xA7\xFC%|q\xC1\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88\xAD\x99ٽ\xE0V\\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0bgL\xAB\xA1r\xFBrIEND\xAEB`\x82
\ No newline at end of file

Copied: branches/safari-534.54-branch/LayoutTests/fast/flexbox/021-vertical-expected.txt (from rev 98033, trunk/LayoutTests/fast/flexbox/021-vertical-expected.txt) (0 => 104211)


--- branches/safari-534.54-branch/LayoutTests/fast/flexbox/021-vertical-expected.txt	                        (rev 0)
+++ branches/safari-534.54-branch/LayoutTests/fast/flexbox/021-vertical-expected.txt	2012-01-05 21:56:24 UTC (rev 104211)
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderDeprecatedFlexibleBox {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
+        RenderDeprecatedFlexibleBox {DIV} at (0,0) size 50x100
+        RenderDeprecatedFlexibleBox {DIV} at (0,0) size 50x100 [bgcolor=#008000]

Copied: branches/safari-534.54-branch/LayoutTests/fast/flexbox/021-vertical.html (from rev 98033, trunk/LayoutTests/fast/flexbox/021-vertical.html) (0 => 104211)


--- branches/safari-534.54-branch/LayoutTests/fast/flexbox/021-vertical.html	                        (rev 0)
+++ branches/safari-534.54-branch/LayoutTests/fast/flexbox/021-vertical.html	2012-01-05 21:56:24 UTC (rev 104211)
@@ -0,0 +1,44 @@
+<html>
+<head>
+<style>
+div {
+  box-orient: vertical;
+  -moz-box-orient: vertical;
+  -webkit-box-orient: vertical;
+  display: -moz-box;
+  display: -webkit-box;
+  display: box;
+  background-color: red;
+  width: 100px;
+  height: 100px;
+}
+
+.first {
+  visibility: collapse;
+  -moz-box-flex: 1;
+  -webkit-box-flex: 1;
+  box-flex: 1;
+  width: 50px;
+  height: 100px;
+}
+
+.second {
+  background-color: green;
+  -moz-box-flex: 1;
+  -webkit-box-flex: 1;
+  box-flex: 1;
+  width: 50px;
+  height: 100px;
+}
+
+</style>
+</head>
+<body>
+<!-- You should see a 100x100 green square below.  If you see any red, the test has failed.  This test is checking
+for visibility:collapse support with vertical orientation. This test is expected to fail but not crash! -->
+<div>
+  <div class="first"></div>
+  <div class="second"></div>
+</div>
+</body>
+</html>

Copied: branches/safari-534.54-branch/LayoutTests/fast/flexbox/crash-flexbox-no-layout-child-expected.txt (from rev 98033, trunk/LayoutTests/fast/flexbox/crash-flexbox-no-layout-child-expected.txt) (0 => 104211)


--- branches/safari-534.54-branch/LayoutTests/fast/flexbox/crash-flexbox-no-layout-child-expected.txt	                        (rev 0)
+++ branches/safari-534.54-branch/LayoutTests/fast/flexbox/crash-flexbox-no-layout-child-expected.txt	2012-01-05 21:56:24 UTC (rev 104211)
@@ -0,0 +1,3 @@
+ 
+Bug 64842: RenderDeprecatedFlexibleBox does not call its children's layout method
+This test passes if it does not CRASH.

Copied: branches/safari-534.54-branch/LayoutTests/fast/flexbox/crash-flexbox-no-layout-child.html (from rev 98033, trunk/LayoutTests/fast/flexbox/crash-flexbox-no-layout-child.html) (0 => 104211)


--- branches/safari-534.54-branch/LayoutTests/fast/flexbox/crash-flexbox-no-layout-child.html	                        (rev 0)
+++ branches/safari-534.54-branch/LayoutTests/fast/flexbox/crash-flexbox-no-layout-child.html	2012-01-05 21:56:24 UTC (rev 104211)
@@ -0,0 +1,20 @@
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+function boom() {
+  setTimeout('document.querySelector("progress").setAttribute("style", "overflow: scroll; border-style: dotted;");', 10);
+}
+window._onload_ = boom;
+</script>
+<body>
+  <span style="display: -webkit-inline-box;">
+    <span style="position: fixed; visibility: collapse;">
+      <span style="visibility: visible;">
+        <progress></progress>
+      </span>
+    </span>
+  </span>
+  <div>Bug <a href="" RenderDeprecatedFlexibleBox does not call its children's layout method</div>
+  <div>This test passes if it does not CRASH.</div>
+</body>

Modified: branches/safari-534.54-branch/LayoutTests/platform/chromium-win/fast/flexbox/021-expected.txt (104210 => 104211)


--- branches/safari-534.54-branch/LayoutTests/platform/chromium-win/fast/flexbox/021-expected.txt	2012-01-05 21:48:50 UTC (rev 104210)
+++ branches/safari-534.54-branch/LayoutTests/platform/chromium-win/fast/flexbox/021-expected.txt	2012-01-05 21:56:24 UTC (rev 104211)
@@ -9,6 +9,6 @@
           text run at (293,0) width 227: "If you see any red, the test has failed. "
           text run at (520,0) width 244: "This test is checking for visibility:collapse"
           text run at (0,20) width 50: "support."
-      RenderFlexibleBox {DIV} at (0,56) size 100x100 [bgcolor=#FF0000]
-        RenderFlexibleBox {DIV} at (0,0) size 0x0
-        RenderFlexibleBox {DIV} at (0,0) size 100x100 [bgcolor=#008000]
+      RenderDeprecatedFlexibleBox {DIV} at (0,56) size 100x100 [bgcolor=#FF0000]
+        RenderDeprecatedFlexibleBox {DIV} at (0,0) size 50x100
+        RenderDeprecatedFlexibleBox {DIV} at (0,0) size 100x100 [bgcolor=#008000]

Modified: branches/safari-534.54-branch/LayoutTests/platform/gtk/fast/flexbox/021-expected.txt (104210 => 104211)


--- branches/safari-534.54-branch/LayoutTests/platform/gtk/fast/flexbox/021-expected.txt	2012-01-05 21:48:50 UTC (rev 104210)
+++ branches/safari-534.54-branch/LayoutTests/platform/gtk/fast/flexbox/021-expected.txt	2012-01-05 21:56:24 UTC (rev 104211)
@@ -9,6 +9,6 @@
           text run at (304,0) width 237: "If you see any red, the test has failed. "
           text run at (541,0) width 150: "This test is checking for"
           text run at (0,19) width 164: "visibility:collapse support."
-      RenderFlexibleBox {DIV} at (0,54) size 100x100 [bgcolor=#FF0000]
-        RenderFlexibleBox {DIV} at (0,0) size 0x0
-        RenderFlexibleBox {DIV} at (0,0) size 100x100 [bgcolor=#008000]
+      RenderDeprecatedFlexibleBox {DIV} at (0,54) size 100x100 [bgcolor=#FF0000]
+        RenderDeprecatedFlexibleBox {DIV} at (0,0) size 50x100
+        RenderDeprecatedFlexibleBox {DIV} at (0,0) size 100x100 [bgcolor=#008000]

Modified: branches/safari-534.54-branch/LayoutTests/platform/mac/fast/flexbox/021-expected.txt (104210 => 104211)


--- branches/safari-534.54-branch/LayoutTests/platform/mac/fast/flexbox/021-expected.txt	2012-01-05 21:48:50 UTC (rev 104210)
+++ branches/safari-534.54-branch/LayoutTests/platform/mac/fast/flexbox/021-expected.txt	2012-01-05 21:56:24 UTC (rev 104211)
@@ -9,6 +9,6 @@
           text run at (304,0) width 237: "If you see any red, the test has failed. "
           text run at (541,0) width 150: "This test is checking for"
           text run at (0,18) width 164: "visibility:collapse support."
-      RenderFlexibleBox {DIV} at (0,52) size 100x100 [bgcolor=#FF0000]
-        RenderFlexibleBox {DIV} at (0,0) size 0x0
-        RenderFlexibleBox {DIV} at (0,0) size 100x100 [bgcolor=#008000]
+      RenderDeprecatedFlexibleBox {DIV} at (0,52) size 100x100 [bgcolor=#FF0000]
+        RenderDeprecatedFlexibleBox {DIV} at (0,0) size 50x100
+        RenderDeprecatedFlexibleBox {DIV} at (0,0) size 100x100 [bgcolor=#008000]

Modified: branches/safari-534.54-branch/LayoutTests/platform/qt/fast/flexbox/021-expected.txt (104210 => 104211)


--- branches/safari-534.54-branch/LayoutTests/platform/qt/fast/flexbox/021-expected.txt	2012-01-05 21:48:50 UTC (rev 104210)
+++ branches/safari-534.54-branch/LayoutTests/platform/qt/fast/flexbox/021-expected.txt	2012-01-05 21:56:24 UTC (rev 104211)
@@ -3,12 +3,12 @@
 layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock {P} at (0,0) size 784x44
-        RenderText {#text} at (0,0) size 729x44
-          text run at (0,0) width 318: "You should see a 100x100 green square below. "
-          text run at (318,0) width 252: "If you see any red, the test has failed. "
-          text run at (570,0) width 159: "This test is checking for"
-          text run at (0,22) width 175: "visibility:collapse support."
-      RenderFlexibleBox {DIV} at (0,60) size 100x100 [bgcolor=#FF0000]
-        RenderFlexibleBox {DIV} at (0,0) size 0x0
-        RenderFlexibleBox {DIV} at (0,0) size 100x100 [bgcolor=#008000]
+      RenderBlock {P} at (0,0) size 784x42
+        RenderText {#text} at (0,0) size 774x42
+          text run at (0,0) width 343: "You should see a 100x100 green square below. "
+          text run at (343,0) width 265: "If you see any red, the test has failed. "
+          text run at (608,0) width 166: "This test is checking for"
+          text run at (0,21) width 182: "visibility:collapse support."
+      RenderDeprecatedFlexibleBox {DIV} at (0,58) size 100x100 [bgcolor=#FF0000]
+        RenderDeprecatedFlexibleBox {DIV} at (0,0) size 50x100
+        RenderDeprecatedFlexibleBox {DIV} at (0,0) size 100x100 [bgcolor=#008000]

Modified: branches/safari-534.54-branch/Source/WebCore/ChangeLog (104210 => 104211)


--- branches/safari-534.54-branch/Source/WebCore/ChangeLog	2012-01-05 21:48:50 UTC (rev 104210)
+++ branches/safari-534.54-branch/Source/WebCore/ChangeLog	2012-01-05 21:56:24 UTC (rev 104211)
@@ -1,5 +1,40 @@
 2011-1-5  Lucas Forschler  <[email protected]>
 
+    Merge 98033
+
+    2011-10-20  Julien Chaffraix  <[email protected]>
+
+            RenderDeprecatedFlexibleBox does not call its children's layout method
+            https://bugs.webkit.org/show_bug.cgi?id=64842
+
+            Reviewed by David Hyatt.
+
+            Tests: fast/flexbox/021-vertical.html
+                   fast/flexbox/crash-flexbox-no-layout-child.html
+
+            The FlexBoxIterator would skip any child with visibility: collapsed. However those child
+            would need layout but their layout() function would never be called.
+
+            This change refactors the way flexible box handles visibility: collapsed child and mark sure
+            their layout() function is called but makes sure that they don't participate in the flex box
+            dimensions.
+
+            * rendering/RenderDeprecatedFlexibleBox.cpp:
+            (WebCore::FlexBoxIterator::next): Do not skip visibility: collapsed child.
+            (WebCore::childDoesNotAffectWidthOrFlexing): Helper function.
+
+            (WebCore::RenderDeprecatedFlexibleBox::calcHorizontalPrefWidths):
+            (WebCore::RenderDeprecatedFlexibleBox::calcVerticalPrefWidths):
+            (WebCore::gatherFlexChildrenInfo):
+            (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
+            (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
+            (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
+            (WebCore::RenderDeprecatedFlexibleBox::allowedChildFlex):
+            Updated to skip the now seen visibility: collapsed child during the
+            iteration.
+
+2011-1-5  Lucas Forschler  <[email protected]>
+
     Merge 98010
 
     2011-10-20  Ken Buchanan <[email protected]>

Modified: branches/safari-534.54-branch/Source/WebCore/rendering/RenderFlexibleBox.cpp (104210 => 104211)


--- branches/safari-534.54-branch/Source/WebCore/rendering/RenderFlexibleBox.cpp	2012-01-05 21:48:50 UTC (rev 104210)
+++ branches/safari-534.54-branch/Source/WebCore/rendering/RenderFlexibleBox.cpp	2012-01-05 21:56:24 UTC (rev 104211)
@@ -91,7 +91,7 @@
             if (m_currentChild && m_currentChild->style()->boxOrdinalGroup() > m_lastOrdinal)
                 m_lastOrdinal = m_currentChild->style()->boxOrdinalGroup();
         } while (!m_currentChild || (!m_currentChild->isAnonymous()
-                 && (m_currentChild->style()->boxOrdinalGroup() != m_currentOrdinal || m_currentChild->style()->visibility() == COLLAPSE)));
+                 && m_currentChild->style()->boxOrdinalGroup() != m_currentOrdinal));
         return m_currentChild;
     }
 
@@ -128,12 +128,15 @@
         margin += marginRight.value();
     return margin;
 }
-
+static bool childDoesNotAffectWidthOrFlexing(RenderObject* child)
+{
+    // Positioned children and collapsed children don't affect the min/max width.
+    return child->isPositioned() || child->style()->visibility() == COLLAPSE;
+}
 void RenderFlexibleBox::calcHorizontalPrefWidths()
 {
     for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
-        // Positioned children and collapsed children don't affect the min/max width.
-        if (child->isPositioned() || child->style()->visibility() == COLLAPSE)
+        if (childDoesNotAffectWidthOrFlexing(child))
             continue;
 
         int margin = marginWidthForChild(child);
@@ -145,8 +148,7 @@
 void RenderFlexibleBox::calcVerticalPrefWidths()
 {
     for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
-        // Positioned children and collapsed children don't affect the min/max width.
-        if (child->isPositioned() || child->style()->visibility() == COLLAPSE)
+        if (childDoesNotAffectWidthOrFlexing(child))
             continue;
 
         int margin = marginWidthForChild(child);
@@ -291,7 +293,7 @@
 {
     for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
         // Check to see if this child flexes.
-        if (!child->isPositioned() && child->style()->boxFlex() > 0.0f) {
+        if (!childDoesNotAffectWidthOrFlexing(child) && child->style()->boxFlex() > 0.0f) {
             // We always have to lay out flexible objects again, since the flex distribution
             // may have changed, and we need to reallocate space.
             child->setOverrideSize(-1);
@@ -403,6 +405,11 @@
                         child->setChildNeedsLayout(true, false);
                 }
                 continue;
+            } else if (child->style()->visibility() == COLLAPSE) {
+                // visibility: collapsed children do not participate in our positioning.
+                // But we need to lay them down. 
+                child->layoutIfNeeded(); 
+                continue;
             }
 
             // We need to see if this child's height has changed, since we make block elements
@@ -494,6 +501,10 @@
 
                     // Now distribute the space to objects.
                     for (RenderBox* child = iterator.first(); child && spaceAvailableThisPass && totalFlex; child = iterator.next()) {
+                        
+                        if (child->style()->visibility() == COLLAPSE)
+                            continue;
+                        
                         if (allowedChildFlex(child, expanding, i)) {
                             int spaceAdd = (int)(spaceAvailableThisPass * (child->style()->boxFlex()/totalFlex));
                             if (spaceAdd) {
@@ -543,7 +554,7 @@
             // Determine the total number of children.
             int totalChildren = 0;
             for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
-                if (child->isPositioned())
+                if (childDoesNotAffectWidthOrFlexing(child))
                     continue;
                 ++totalChildren;
             }
@@ -554,7 +565,7 @@
                 --totalChildren;
                 bool firstChild = true;
                 for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
-                    if (child->isPositioned())
+                    if (childDoesNotAffectWidthOrFlexing(child))
                         continue;
 
                     if (firstChild) {
@@ -575,7 +586,7 @@
             else // END for LTR, START for RTL
                 offset += remainingSpace;
             for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
-                if (child->isPositioned())
+                if (childDoesNotAffectWidthOrFlexing(child))
                     continue;
 
                 placeChild(child, child->location() + IntSize(offset, 0));
@@ -635,6 +646,11 @@
                         child->setChildNeedsLayout(true, false);
                 }
                 continue;
+                } else if (child->style()->visibility() == COLLAPSE) { 
+                    // visibility: collapsed children do not participate in our positioning.
+                    // But we need to lay them down.
+                     child->layoutIfNeeded(); 
+                     continue;
             }
 
             // Compute the child's vertical margins.
@@ -786,7 +802,7 @@
             // Determine the total number of children.
             int totalChildren = 0;
             for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
-                if (child->isPositioned())
+                if (childDoesNotAffectWidthOrFlexing(child))
                     continue;
 
                 ++totalChildren;
@@ -798,7 +814,7 @@
                 --totalChildren;
                 bool firstChild = true;
                 for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
-                    if (child->isPositioned())
+                    if (childDoesNotAffectWidthOrFlexing(child))
                         continue;
 
                     if (firstChild) {
@@ -818,7 +834,7 @@
             else // END
                 offset += remainingSpace;
             for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
-                if (child->isPositioned())
+                if (childDoesNotAffectWidthOrFlexing(child))
                     continue;
                 placeChild(child, child->location() + IntSize(0, offset));
             }
@@ -835,7 +851,7 @@
 {
     int maxLineCount = 0;
     for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
-        if (child->isPositioned())
+        if (childDoesNotAffectWidthOrFlexing(child))
             continue;
 
         if (relayoutChildren || (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent()))
@@ -861,7 +877,7 @@
         return;
 
     for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
-        if (child->isPositioned() || !child->style()->height().isAuto() || !child->isBlockFlow())
+        if (childDoesNotAffectWidthOrFlexing(child) || !child->style()->height().isAuto() || !child->isBlockFlow())
             continue;
 
         RenderBlock* blockChild = toRenderBlock(child);
@@ -949,7 +965,7 @@
 
 int RenderFlexibleBox::allowedChildFlex(RenderBox* child, bool expanding, unsigned int group)
 {
-    if (child->isPositioned() || child->style()->boxFlex() == 0.0f || child->style()->boxFlexGroup() != group)
+    if (childDoesNotAffectWidthOrFlexing(child) || child->style()->boxFlex() == 0.0f || child->style()->boxFlexGroup() != group)
         return 0;
 
     if (expanding) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to