diff options
author | Steve Block <steveblock@google.com> | 2009-10-08 17:19:54 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-10-20 00:41:58 +0100 |
commit | 231d4e3152a9c27a73b6ac7badbe6be673aa3ddf (patch) | |
tree | a6c7e2d6cd7bfa7011cc39abbb436142d7a4a7c8 /WebCore/rendering/RenderFlexibleBox.cpp | |
parent | e196732677050bd463301566a68a643b6d14b907 (diff) | |
download | external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.zip external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.gz external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.bz2 |
Merge webkit.org at R49305 : Automatic merge by git.
Change-Id: I8968561bc1bfd72b8923b7118d3728579c6dbcc7
Diffstat (limited to 'WebCore/rendering/RenderFlexibleBox.cpp')
-rw-r--r-- | WebCore/rendering/RenderFlexibleBox.cpp | 109 |
1 files changed, 18 insertions, 91 deletions
diff --git a/WebCore/rendering/RenderFlexibleBox.cpp b/WebCore/rendering/RenderFlexibleBox.cpp index 84c94e4..531477e 100644 --- a/WebCore/rendering/RenderFlexibleBox.cpp +++ b/WebCore/rendering/RenderFlexibleBox.cpp @@ -225,7 +225,8 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren) calcWidth(); calcHeight(); - m_overflowWidth = width(); + + m_overflow.clear(); if (previousWidth != width() || previousHeight != height() || (parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL && @@ -241,7 +242,10 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren) #endif setHeight(0); +<<<<<<< HEAD:WebCore/rendering/RenderFlexibleBox.cpp m_overflowHeight = 0; +======= +>>>>>>> webkit.org at 49305:WebCore/rendering/RenderFlexibleBox.cpp m_flexingChildren = m_stretchingChildren = false; initMaxMarginValues(); @@ -259,15 +263,8 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren) else layoutVerticalBox(relayoutChildren); - int oldHeight = height(); calcHeight(); - if (oldHeight != height()) { - // If the block got expanded in size, then increase our overflowheight to match. - if (m_overflowHeight > height()) - m_overflowHeight -= (borderBottom() + paddingBottom() + horizontalScrollbarHeight()); - if (m_overflowHeight < height()) - m_overflowHeight = height(); - } + if (previousHeight != height()) relayoutChildren = true; @@ -290,31 +287,14 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren) setMaxTopMargins(pos, neg); setMaxBottomMargins(0, 0); } + + // Add in the overflow from children. + FlexBoxIterator iterator(this); + for (RenderBox* child = iterator.first(); child; child = iterator.next()) + addOverflowFromChild(child); - // Always ensure our overflow width is at least as large as our width. - if (m_overflowWidth < width()) - m_overflowWidth = width(); - - if (!hasOverflowClip()) { - int shadowLeft; - int shadowRight; - int shadowTop; - int shadowBottom; - style()->getBoxShadowExtent(shadowTop, shadowRight, shadowBottom, shadowLeft); - - m_overflowLeft = min(m_overflowLeft, shadowLeft); - m_overflowWidth = max(m_overflowWidth, width() + shadowRight); - m_overflowTop = min(m_overflowTop, shadowTop); - m_overflowHeight = max(m_overflowHeight, height() + shadowBottom); - - if (hasReflection()) { - IntRect reflection(reflectionBox()); - m_overflowTop = min(m_overflowTop, reflection.y()); - m_overflowHeight = max(m_overflowHeight, reflection.bottom()); - m_overflowLeft = min(m_overflowLeft, reflection.x()); - m_overflowHeight = max(m_overflowWidth, reflection.right()); - } - } + // Add visual overflow from box-shadow and reflections. + addShadowOverflow(); statePusher.pop(); @@ -363,7 +343,7 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren) int oldHeight = 0; int remainingSpace = 0; - m_overflowHeight = height(); + FlexBoxIterator iterator(this); unsigned int highestFlexGroup = 0; @@ -380,7 +360,7 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren) do { // Reset our height. setHeight(yPos); - m_overflowHeight = height(); + xPos = borderLeft() + paddingLeft(); // Our first pass is done without flexing. We simply lay the children @@ -431,10 +411,6 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren) setHeight(height() + lineHeight(true, true)); setHeight(height() + toAdd); - - // Always make sure our overflowheight is at least our height. - if (m_overflowHeight < height()) - m_overflowHeight = height(); oldHeight = height(); calcHeight(); @@ -493,12 +469,6 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren) } placeChild(child, xPos, childY); - - if (child->isRenderBlock()) - toRenderBlock(child)->addVisualOverflow(toRenderBlock(child)->floatRect()); - - m_overflowHeight = max(m_overflowHeight, childY + child->overflowHeight(false)); - m_overflowTop = min(m_overflowTop, child->y() + child->overflowTop(false)); xPos += child->width() + child->marginRight(); @@ -662,22 +632,6 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren) } } - child = iterator.first(); - while (child && child->isPositioned()) { - child = iterator.next(); - } - - if (child) { - m_overflowLeft = min(child->x() + child->overflowLeft(false), m_overflowLeft); - - RenderBox* lastChild = child; - while ((child = iterator.next())) { - if (!child->isPositioned()) - lastChild = child; - } - m_overflowWidth = max(lastChild->x() + lastChild->overflowWidth(false), m_overflowWidth); - } - // So that the calcHeight in layoutBlock() knows to relayout positioned objects because of // a height change, we revert our height back to the intrinsic height before returning. if (heightSpecified) @@ -820,7 +774,6 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren) do { setHeight(borderTop() + paddingTop()); int minHeight = height() + toAdd; - m_overflowHeight = height(); child = iterator.first(); while (child) { @@ -828,8 +781,7 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren) if (!haveLineClamp && (relayoutChildren || (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent())))) child->setChildNeedsLayout(true, false); - if (child->isPositioned()) - { + if (child->isPositioned()) { child->containingBlock()->insertPositionedObject(child); if (child->style()->hasStaticX()) { if (style()->direction() == LTR) @@ -876,14 +828,7 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren) // Place the child. placeChild(child, childX, height()); setHeight(height() + child->height() + child->marginBottom()); - - if (child->isRenderBlock()) - toRenderBlock(child)->addVisualOverflow(toRenderBlock(child)->floatRect()); - // See if this child has made our overflow need to grow. - m_overflowWidth = max(child->x() + child->overflowWidth(false), m_overflowWidth); - m_overflowLeft = min(child->x() + child->overflowLeft(false), m_overflowLeft); - child = iterator.next(); } @@ -899,10 +844,6 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren) if (height() < minHeight) setHeight(minHeight); - // Always make sure our overflowheight is at least our height. - if (m_overflowHeight < height()) - m_overflowHeight = height(); - // Now we have to calc our height, so we know how much space we have remaining. oldHeight = height(); calcHeight(); @@ -1060,22 +1001,6 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren) } } } - - child = iterator.first(); - while (child && child->isPositioned()) { - child = iterator.next(); - } - - if (child) { - m_overflowTop = min(child->y() + child->overflowTop(false), m_overflowTop); - - RenderBox* lastChild = child; - while ((child = iterator.next())) { - if (!child->isPositioned()) - lastChild = child; - } - m_overflowHeight = max(lastChild->y() + lastChild->overflowHeight(false), m_overflowHeight); - } // So that the calcHeight in layoutBlock() knows to relayout positioned objects because of // a height change, we revert our height back to the intrinsic height before returning. @@ -1161,6 +1086,8 @@ const char *RenderFlexibleBox::renderName() const return "RenderFlexibleBox (floating)"; if (isPositioned()) return "RenderFlexibleBox (positioned)"; + if (isAnonymous()) + return "RenderFlexibleBox (generated)"; if (isRelPositioned()) return "RenderFlexibleBox (relative positioned)"; return "RenderFlexibleBox"; |