Diff
Copied: branches/chromium/874/LayoutTests/fast/flexbox/021-vertical-expected.png (from rev 98033, trunk/LayoutTests/fast/flexbox/021-vertical-expected.png) (0 => 99345)
--- branches/chromium/874/LayoutTests/fast/flexbox/021-vertical-expected.png (rev 0)
+++ branches/chromium/874/LayoutTests/fast/flexbox/021-vertical-expected.png 2011-11-05 01:26:45 UTC (rev 99345)
@@ -0,0 +1,5 @@
+\x89PNG
+
+
+IHDR X ' )tEXtchecksum c0fee90186c7c7a1304dce56aa9b46bc\xDB]`\x93
+\xC6IDATx\x9C\xED\xDC1\xC20EA\x8C88\x9C|\xD3R$\xC5\x96\xA2\x99\xD6\xCD/\x9F\xB6\xF0\x9A\x99 \x9D\xE7\xEE w#\xB0 b &\xB0 b &\xB0 b \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\\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 bgL\xAB\xA1r\xFBr IEND\xAEB`\x82
\ No newline at end of file
Copied: branches/chromium/874/LayoutTests/fast/flexbox/021-vertical-expected.txt (from rev 98033, trunk/LayoutTests/fast/flexbox/021-vertical-expected.txt) (0 => 99345)
--- branches/chromium/874/LayoutTests/fast/flexbox/021-vertical-expected.txt (rev 0)
+++ branches/chromium/874/LayoutTests/fast/flexbox/021-vertical-expected.txt 2011-11-05 01:26:45 UTC (rev 99345)
@@ -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/chromium/874/LayoutTests/fast/flexbox/021-vertical.html (from rev 98033, trunk/LayoutTests/fast/flexbox/021-vertical.html) (0 => 99345)
--- branches/chromium/874/LayoutTests/fast/flexbox/021-vertical.html (rev 0)
+++ branches/chromium/874/LayoutTests/fast/flexbox/021-vertical.html 2011-11-05 01:26:45 UTC (rev 99345)
@@ -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/chromium/874/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 => 99345)
--- branches/chromium/874/LayoutTests/fast/flexbox/crash-flexbox-no-layout-child-expected.txt (rev 0)
+++ branches/chromium/874/LayoutTests/fast/flexbox/crash-flexbox-no-layout-child-expected.txt 2011-11-05 01:26:45 UTC (rev 99345)
@@ -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/chromium/874/LayoutTests/fast/flexbox/crash-flexbox-no-layout-child.html (from rev 98033, trunk/LayoutTests/fast/flexbox/crash-flexbox-no-layout-child.html) (0 => 99345)
--- branches/chromium/874/LayoutTests/fast/flexbox/crash-flexbox-no-layout-child.html (rev 0)
+++ branches/chromium/874/LayoutTests/fast/flexbox/crash-flexbox-no-layout-child.html 2011-11-05 01:26:45 UTC (rev 99345)
@@ -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/chromium/874/LayoutTests/platform/chromium-win/fast/flexbox/021-expected.txt (99344 => 99345)
--- branches/chromium/874/LayoutTests/platform/chromium-win/fast/flexbox/021-expected.txt 2011-11-05 01:26:31 UTC (rev 99344)
+++ branches/chromium/874/LayoutTests/platform/chromium-win/fast/flexbox/021-expected.txt 2011-11-05 01:26:45 UTC (rev 99345)
@@ -10,5 +10,5 @@
text run at (520,0) width 244: "This test is checking for visibility:collapse"
text run at (0,20) width 50: "support."
RenderDeprecatedFlexibleBox {DIV} at (0,56) size 100x100 [bgcolor=#FF0000]
- RenderDeprecatedFlexibleBox {DIV} at (0,0) size 0x0
+ RenderDeprecatedFlexibleBox {DIV} at (0,0) size 50x100
RenderDeprecatedFlexibleBox {DIV} at (0,0) size 100x100 [bgcolor=#008000]
Modified: branches/chromium/874/LayoutTests/platform/gtk/fast/flexbox/021-expected.txt (99344 => 99345)
--- branches/chromium/874/LayoutTests/platform/gtk/fast/flexbox/021-expected.txt 2011-11-05 01:26:31 UTC (rev 99344)
+++ branches/chromium/874/LayoutTests/platform/gtk/fast/flexbox/021-expected.txt 2011-11-05 01:26:45 UTC (rev 99345)
@@ -10,5 +10,5 @@
text run at (541,0) width 150: "This test is checking for"
text run at (0,19) width 164: "visibility:collapse support."
RenderDeprecatedFlexibleBox {DIV} at (0,54) size 100x100 [bgcolor=#FF0000]
- RenderDeprecatedFlexibleBox {DIV} at (0,0) size 0x0
+ RenderDeprecatedFlexibleBox {DIV} at (0,0) size 50x100
RenderDeprecatedFlexibleBox {DIV} at (0,0) size 100x100 [bgcolor=#008000]
Modified: branches/chromium/874/LayoutTests/platform/mac/fast/flexbox/021-expected.txt (99344 => 99345)
--- branches/chromium/874/LayoutTests/platform/mac/fast/flexbox/021-expected.txt 2011-11-05 01:26:31 UTC (rev 99344)
+++ branches/chromium/874/LayoutTests/platform/mac/fast/flexbox/021-expected.txt 2011-11-05 01:26:45 UTC (rev 99345)
@@ -10,5 +10,5 @@
text run at (541,0) width 150: "This test is checking for"
text run at (0,18) width 164: "visibility:collapse support."
RenderDeprecatedFlexibleBox {DIV} at (0,52) size 100x100 [bgcolor=#FF0000]
- RenderDeprecatedFlexibleBox {DIV} at (0,0) size 0x0
+ RenderDeprecatedFlexibleBox {DIV} at (0,0) size 50x100
RenderDeprecatedFlexibleBox {DIV} at (0,0) size 100x100 [bgcolor=#008000]
Modified: branches/chromium/874/LayoutTests/platform/qt/fast/flexbox/021-expected.txt (99344 => 99345)
--- branches/chromium/874/LayoutTests/platform/qt/fast/flexbox/021-expected.txt 2011-11-05 01:26:31 UTC (rev 99344)
+++ branches/chromium/874/LayoutTests/platform/qt/fast/flexbox/021-expected.txt 2011-11-05 01:26:45 UTC (rev 99345)
@@ -10,5 +10,5 @@
text run at (570,0) width 159: "This test is checking for"
text run at (0,22) width 175: "visibility:collapse support."
RenderDeprecatedFlexibleBox {DIV} at (0,60) size 100x100 [bgcolor=#FF0000]
- RenderDeprecatedFlexibleBox {DIV} at (0,0) size 0x0
+ RenderDeprecatedFlexibleBox {DIV} at (0,0) size 50x100
RenderDeprecatedFlexibleBox {DIV} at (0,0) size 100x100 [bgcolor=#008000]
Modified: branches/chromium/874/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp (99344 => 99345)
--- branches/chromium/874/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp 2011-11-05 01:26:31 UTC (rev 99344)
+++ branches/chromium/874/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp 2011-11-05 01:26:45 UTC (rev 99345)
@@ -97,7 +97,7 @@
if (m_currentChild && notFirstOrdinalValue())
m_ordinalValues.add(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;
}
@@ -144,11 +144,16 @@
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 RenderDeprecatedFlexibleBox::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;
LayoutUnit margin = marginWidthForChild(child);
@@ -160,8 +165,7 @@
void RenderDeprecatedFlexibleBox::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;
LayoutUnit margin = marginWidthForChild(child);
@@ -310,7 +314,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->clearOverrideSize();
@@ -422,8 +426,14 @@
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
// fill the height of a containing box by default.
// Now do a layout.
@@ -513,6 +523,9 @@
// 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)) {
LayoutUnit spaceAdd = static_cast<LayoutUnit>(spaceAvailableThisPass * (child->style()->boxFlex() / totalFlex));
if (spaceAdd) {
@@ -562,7 +575,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;
}
@@ -573,7 +586,7 @@
--totalChildren;
bool firstChild = true;
for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
- if (child->isPositioned())
+ if (childDoesNotAffectWidthOrFlexing(child))
continue;
if (firstChild) {
@@ -594,7 +607,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() + LayoutSize(offset, 0));
@@ -654,6 +667,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.
@@ -805,7 +823,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;
@@ -817,7 +835,7 @@
--totalChildren;
bool firstChild = true;
for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
- if (child->isPositioned())
+ if (childDoesNotAffectWidthOrFlexing(child))
continue;
if (firstChild) {
@@ -837,7 +855,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() + LayoutSize(0, offset));
}
@@ -854,7 +872,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()))
@@ -880,7 +898,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);
@@ -968,7 +986,7 @@
LayoutUnit RenderDeprecatedFlexibleBox::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) {