summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-07 11:21:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-07 11:21:11 +0200
commit2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch)
tree988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
parentdd91e772430dc294e3bf478c119ef8d43c0a3358 (diff)
downloadqtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp')
-rw-r--r--Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp45
1 files changed, 21 insertions, 24 deletions
diff --git a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
index add01a0c2..b956d3946 100644
--- a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
+++ b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
@@ -218,7 +218,7 @@ void RenderDeprecatedFlexibleBox::computePreferredLogicalWidths()
setPreferredLogicalWidthsDirty(false);
}
-void RenderDeprecatedFlexibleBox::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight, BlockLayoutPass layoutPass)
+void RenderDeprecatedFlexibleBox::layoutBlock(bool relayoutChildren, LayoutUnit)
{
ASSERT(needsLayout());
@@ -272,7 +272,7 @@ void RenderDeprecatedFlexibleBox::layoutBlock(bool relayoutChildren, LayoutUnit
if (previousSize.height() != height())
relayoutChildren = true;
- bool needAnotherLayoutPass = layoutPositionedObjects(relayoutChildren || isRoot());
+ layoutPositionedObjects(relayoutChildren || isRoot());
computeRegionRangeForBlock();
@@ -305,16 +305,13 @@ void RenderDeprecatedFlexibleBox::layoutBlock(bool relayoutChildren, LayoutUnit
// Update our scrollbars if we're overflow:auto/scroll/hidden now that we know if
// we overflow or not.
- updateScrollInfoAfterLayout();
+ if (hasOverflowClip())
+ layer()->updateScrollInfoAfterLayout();
// Repaint with our new bounds if they are different from our old bounds.
repainter.repaintAfterLayout();
- if (needAnotherLayoutPass && layoutPass == NormalLayoutPass) {
- setChildNeedsLayout(true, false);
- layoutBlock(false, pageLogicalHeight);
- } else
- setNeedsLayout(false);
+ setNeedsLayout(false);
}
// The first walk over our kids is to find out if we have any flexible children.
@@ -327,7 +324,7 @@ static void gatherFlexChildrenInfo(FlexBoxIterator& iterator, bool relayoutChild
// may have changed, and we need to reallocate space.
child->clearOverrideSize();
if (!relayoutChildren)
- child->setChildNeedsLayout(true, false);
+ child->setChildNeedsLayout(true, MarkOnlyThis);
haveFlex = true;
unsigned int flexGroup = child->style()->boxFlexGroup();
if (lowestFlexGroup == 0)
@@ -374,7 +371,7 @@ void RenderDeprecatedFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
// make sure we relayout children if we need it.
if (relayoutChildren || (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent())))
- child->setChildNeedsLayout(true, false);
+ child->setChildNeedsLayout(true, MarkOnlyThis);
if (child->isPositioned())
continue;
@@ -431,7 +428,7 @@ void RenderDeprecatedFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
if (childLayer->staticBlockPosition() != yPos) {
childLayer->setStaticBlockPosition(yPos);
if (child->style()->hasStaticBlockPosition(style()->isHorizontalWritingMode()))
- child->setChildNeedsLayout(true, false);
+ child->setChildNeedsLayout(true, MarkOnlyThis);
}
continue;
} else if (child->style()->visibility() == COLLAPSE) {
@@ -448,7 +445,7 @@ void RenderDeprecatedFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
LayoutUnit oldChildHeight = child->height();
child->computeLogicalHeight();
if (oldChildHeight != child->height())
- child->setChildNeedsLayout(true, false);
+ child->setChildNeedsLayout(true, MarkOnlyThis);
if (!child->needsLayout())
child->markForPaginationRelayoutIfNeeded();
@@ -517,7 +514,7 @@ void RenderDeprecatedFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
LayoutUnit allowedFlex = allowedChildFlex(child, expanding, i);
if (allowedFlex) {
- LayoutUnit projectedFlex = (allowedFlex == numeric_limits<LayoutUnit>::max()) ? allowedFlex : LayoutUnit(allowedFlex * (totalFlex / child->style()->boxFlex()));
+ LayoutUnit projectedFlex = (allowedFlex == MAX_LAYOUT_UNIT) ? allowedFlex : LayoutUnit(allowedFlex * (totalFlex / child->style()->boxFlex()));
spaceAvailableThisPass = expanding ? min(spaceAvailableThisPass, projectedFlex) : max(spaceAvailableThisPass, projectedFlex);
}
}
@@ -562,7 +559,7 @@ void RenderDeprecatedFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
}
}
}
- } while (groupRemainingSpace);
+ } while (absoluteValue(groupRemainingSpace) >= 1);
}
// We didn't find any children that could grow.
@@ -663,7 +660,7 @@ void RenderDeprecatedFlexibleBox::layoutVerticalBox(bool relayoutChildren)
for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
// Make sure we relayout children if we need it.
if (!haveLineClamp && (relayoutChildren || (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent()))))
- child->setChildNeedsLayout(true, false);
+ child->setChildNeedsLayout(true, MarkOnlyThis);
if (child->isPositioned()) {
child->containingBlock()->insertPositionedObject(child);
@@ -672,7 +669,7 @@ void RenderDeprecatedFlexibleBox::layoutVerticalBox(bool relayoutChildren)
if (childLayer->staticBlockPosition() != height()) {
childLayer->setStaticBlockPosition(height());
if (child->style()->hasStaticBlockPosition(style()->isHorizontalWritingMode()))
- child->setChildNeedsLayout(true, false);
+ child->setChildNeedsLayout(true, MarkOnlyThis);
}
continue;
} else if (child->style()->visibility() == COLLAPSE) {
@@ -771,7 +768,7 @@ void RenderDeprecatedFlexibleBox::layoutVerticalBox(bool relayoutChildren)
for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
LayoutUnit allowedFlex = allowedChildFlex(child, expanding, i);
if (allowedFlex) {
- LayoutUnit projectedFlex = (allowedFlex == numeric_limits<LayoutUnit>::max()) ? allowedFlex : static_cast<LayoutUnit>(allowedFlex * (totalFlex / child->style()->boxFlex()));
+ LayoutUnit projectedFlex = (allowedFlex == MAX_LAYOUT_UNIT) ? allowedFlex : static_cast<LayoutUnit>(allowedFlex * (totalFlex / child->style()->boxFlex()));
spaceAvailableThisPass = expanding ? min(spaceAvailableThisPass, projectedFlex) : max(spaceAvailableThisPass, projectedFlex);
}
}
@@ -813,7 +810,7 @@ void RenderDeprecatedFlexibleBox::layoutVerticalBox(bool relayoutChildren)
}
}
}
- } while (groupRemainingSpace);
+ } while (absoluteValue(groupRemainingSpace) >= 1);
}
// We didn't find any children that could grow.
@@ -885,7 +882,7 @@ void RenderDeprecatedFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool
if (relayoutChildren || (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent()))
|| (child->style()->height().isAuto() && child->isBlockFlow())) {
- child->setChildNeedsLayout(true, false);
+ child->setChildNeedsLayout(true, MarkOnlyThis);
// Dirty all the positioned objects.
if (child->isRenderBlock()) {
@@ -918,7 +915,7 @@ void RenderDeprecatedFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool
if (newHeight == child->height())
continue;
- child->setChildNeedsLayout(true, false);
+ child->setChildNeedsLayout(true, MarkOnlyThis);
child->setOverrideHeight(newHeight);
m_flexingChildren = true;
child->layoutIfNeeded();
@@ -1000,7 +997,7 @@ LayoutUnit RenderDeprecatedFlexibleBox::allowedChildFlex(RenderBox* child, bool
if (expanding) {
if (isHorizontal()) {
// FIXME: For now just handle fixed values.
- LayoutUnit maxWidth = numeric_limits<LayoutUnit>::max();
+ LayoutUnit maxWidth = MAX_LAYOUT_UNIT;
LayoutUnit width = child->overrideWidth() - child->borderAndPaddingWidth();
if (!child->style()->maxWidth().isUndefined() && child->style()->maxWidth().isFixed())
maxWidth = child->style()->maxWidth().value();
@@ -1008,16 +1005,16 @@ LayoutUnit RenderDeprecatedFlexibleBox::allowedChildFlex(RenderBox* child, bool
maxWidth = child->maxPreferredLogicalWidth();
else if (child->style()->maxWidth().type() == MinIntrinsic)
maxWidth = child->minPreferredLogicalWidth();
- if (maxWidth == numeric_limits<LayoutUnit>::max())
+ if (maxWidth == MAX_LAYOUT_UNIT)
return maxWidth;
return max<LayoutUnit>(0, maxWidth - width);
} else {
// FIXME: For now just handle fixed values.
- LayoutUnit maxHeight = numeric_limits<LayoutUnit>::max();
+ LayoutUnit maxHeight = MAX_LAYOUT_UNIT;
LayoutUnit height = child->overrideHeight() - child->borderAndPaddingHeight();
if (!child->style()->maxHeight().isUndefined() && child->style()->maxHeight().isFixed())
maxHeight = child->style()->maxHeight().value();
- if (maxHeight == numeric_limits<LayoutUnit>::max())
+ if (maxHeight == MAX_LAYOUT_UNIT)
return maxHeight;
return max<LayoutUnit>(0, maxHeight - height);
}