Modified: trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp (150037 => 150038)
--- trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp 2013-05-13 20:43:11 UTC (rev 150037)
+++ trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp 2013-05-13 21:02:39 UTC (rev 150038)
@@ -388,19 +388,17 @@
}
// The first walk over our kids is to find out if we have any flexible children.
-static void gatherFlexChildrenInfo(FlexBoxIterator& iterator, unsigned& highestFlexGroup, unsigned& lowestFlexGroup, bool& flexibleChildrenNeedLayout, unsigned& flexibleChildCount)
+static void gatherFlexChildrenInfo(FlexBoxIterator& iterator, bool relayoutChildren, unsigned int& highestFlexGroup, unsigned int& lowestFlexGroup, bool& haveFlex)
{
for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
// Check to see if this child flexes.
- if (childDoesNotAffectWidthOrFlexing(child))
- continue;
-
- if (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.
- flexibleChildCount++;
- if (child->needsLayout())
- flexibleChildrenNeedLayout = true;
+ child->clearOverrideSize();
+ if (!relayoutChildren)
+ child->setChildNeedsLayout(true, MarkOnlyThis);
+ haveFlex = true;
unsigned int flexGroup = child->style()->boxFlexGroup();
if (lowestFlexGroup == 0)
lowestFlexGroup = flexGroup;
@@ -435,14 +433,8 @@
FlexBoxIterator iterator(this);
unsigned int highestFlexGroup = 0;
unsigned int lowestFlexGroup = 0;
- bool flexingChildren = false;
- bool flexibleChildrenNeedLayout = relayoutChildren;
- unsigned flexibleChildCount = 0;
- gatherFlexChildrenInfo(iterator, highestFlexGroup, lowestFlexGroup, flexibleChildrenNeedLayout, flexibleChildCount);
- bool haveFlex = flexibleChildCount > 0;
- bool inflexibleObjectsExtentChanged = false;
- bool doingInflexibleLayoutPass = true;
- bool clearingFlexibleItemsOverridePass = false;
+ bool haveFlex = false, flexingChildren = false;
+ gatherFlexChildrenInfo(iterator, relayoutChildren, highestFlexGroup, lowestFlexGroup, haveFlex);
RenderBlock::startDelayUpdateScrollInfo();
@@ -473,32 +465,18 @@
LayoutSize& childLayoutDelta = childLayoutDeltas[childIndex++];
- // Just skip the flexible items initially.
- if (child->style()->boxFlex() && doingInflexibleLayoutPass)
- continue;
-
// Compute the child's vertical margins.
child->computeAndSetBlockDirectionMargins(this);
if (!child->needsLayout())
child->markForPaginationRelayoutIfNeeded();
- if (clearingFlexibleItemsOverridePass && child->style()->boxFlex()) {
- child->clearOverrideSize();
- child->setNeedsLayout(true, MarkOnlyThis);
- }
-
- LayoutUnit oldChildWidth = child->width();
-
// Apply the child's current layout delta.
layoutChildIfNeededApplyingDelta(child, childLayoutDelta);
// Now do the layout.
layoutChildIfNeededApplyingDelta(child, childLayoutDelta);
- if (doingInflexibleLayoutPass && child->width() != oldChildWidth)
- inflexibleObjectsExtentChanged = true;
-
// Update our height and overflow height.
if (style()->boxAlign() == BBASELINE) {
LayoutUnit ascent = child->firstLineBoxBaseline();
@@ -551,10 +529,6 @@
LayoutSize& childLayoutDelta = childLayoutDeltas[childIndex++];
- // Just skip the flexible items initially.
- if (child->style()->boxFlex() && doingInflexibleLayoutPass)
- continue;
-
if (child->style()->visibility() == COLLAPSE) {
// visibility: collapsed children do not participate in our positioning.
// But we need to lay them out.
@@ -606,15 +580,6 @@
remainingSpace = borderLeft() + paddingLeft() + contentWidth() - xPos;
- clearingFlexibleItemsOverridePass = false;
-
- if (doingInflexibleLayoutPass) {
- doingInflexibleLayoutPass = false;
- if (inflexibleObjectsExtentChanged || (flexibleChildrenNeedLayout && flexibleChildCount > 1))
- clearingFlexibleItemsOverridePass = true;
- continue;
- }
-
m_stretchingChildren = false;
if (flexingChildren)
haveFlex = false; // We're done.
@@ -769,14 +734,8 @@
FlexBoxIterator iterator(this);
unsigned int highestFlexGroup = 0;
unsigned int lowestFlexGroup = 0;
- bool flexingChildren = false;
- bool flexibleChildrenNeedLayout = relayoutChildren;
- unsigned flexibleChildCount = 0;
- gatherFlexChildrenInfo(iterator, highestFlexGroup, lowestFlexGroup, flexibleChildrenNeedLayout, flexibleChildCount);
- bool haveFlex = flexibleChildCount > 0;
- bool inflexibleObjectsExtentChanged = false;
- bool doingInflexibleLayoutPass = true;
- bool clearingFlexibleItemsOverridePass = false;
+ bool haveFlex = false, flexingChildren = false;
+ gatherFlexChildrenInfo(iterator, relayoutChildren, highestFlexGroup, lowestFlexGroup, haveFlex);
// We confine the line clamp ugliness to vertical flexible boxes (thus keeping it out of
// mainstream block layout); this is not really part of the XUL box model.
@@ -816,9 +775,6 @@
}
LayoutSize& childLayoutDelta = childLayoutDeltas[childIndex++];
-
- if (child->style()->boxFlex() && doingInflexibleLayoutPass)
- continue;
if (child->style()->visibility() == COLLAPSE) {
// visibility: collapsed children do not participate in our positioning.
@@ -836,19 +792,9 @@
if (!child->needsLayout())
child->markForPaginationRelayoutIfNeeded();
- if (clearingFlexibleItemsOverridePass && child->style()->boxFlex()) {
- child->clearOverrideSize();
- child->setNeedsLayout(true, MarkOnlyThis);
- }
-
- LayoutUnit oldChildHeight = child->height();
-
// Now do a layout.
layoutChildIfNeededApplyingDelta(child, childLayoutDelta);
- if (doingInflexibleLayoutPass && child->height() != oldChildHeight)
- inflexibleObjectsExtentChanged = true;
-
// We can place the child now, using our value of box-align.
LayoutUnit childX = borderLeft() + paddingLeft();
switch (style()->boxAlign()) {
@@ -896,15 +842,6 @@
remainingSpace = borderTop() + paddingTop() + contentHeight() - yPos;
- clearingFlexibleItemsOverridePass = false;
-
- if (doingInflexibleLayoutPass) {
- doingInflexibleLayoutPass = false;
- if (inflexibleObjectsExtentChanged || (flexibleChildrenNeedLayout && flexibleChildCount > 1))
- clearingFlexibleItemsOverridePass = true;
- continue;
- }
-
if (flexingChildren)
haveFlex = false; // We're done.
else if (haveFlex) {