summaryrefslogtreecommitdiff
path: root/src/3rdparty/webkit/WebCore/rendering/RenderFlexibleBox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/rendering/RenderFlexibleBox.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderFlexibleBox.cpp248
1 files changed, 117 insertions, 131 deletions
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderFlexibleBox.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderFlexibleBox.cpp
index 08bc567972..1dcef36f15 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderFlexibleBox.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderFlexibleBox.cpp
@@ -45,11 +45,11 @@ public:
lastOrdinal = 1;
if (!forward) {
// No choice, since we're going backwards, we have to find out the highest ordinal up front.
- RenderObject* child = box->firstChild();
+ RenderBox* child = box->firstChildBox();
while (child) {
if (child->style()->boxOrdinalGroup() > lastOrdinal)
lastOrdinal = child->style()->boxOrdinalGroup();
- child = child->nextSibling();
+ child = child->nextSiblingBox();
}
}
@@ -61,29 +61,28 @@ public:
currentOrdinal = forward ? 0 : lastOrdinal+1;
}
- RenderObject* first() {
+ RenderBox* first() {
reset();
return next();
}
- RenderObject* next() {
-
+ RenderBox* next() {
do {
if (!current) {
if (forward) {
currentOrdinal++;
if (currentOrdinal > lastOrdinal)
return 0;
- current = box->firstChild();
+ current = box->firstChildBox();
} else {
currentOrdinal--;
if (currentOrdinal == 0)
return 0;
- current = box->lastChild();
+ current = box->lastChildBox();
}
}
else
- current = forward ? current->nextSibling() : current->previousSibling();
+ current = forward ? current->nextSiblingBox() : current->previousSiblingBox();
if (current && current->style()->boxOrdinalGroup() > lastOrdinal)
lastOrdinal = current->style()->boxOrdinalGroup();
} while (!current || current->style()->boxOrdinalGroup() != currentOrdinal ||
@@ -93,7 +92,7 @@ public:
private:
RenderFlexibleBox* box;
- RenderObject* current;
+ RenderBox* current;
bool forward;
unsigned int currentOrdinal;
unsigned int lastOrdinal;
@@ -112,13 +111,10 @@ RenderFlexibleBox::~RenderFlexibleBox()
void RenderFlexibleBox::calcHorizontalPrefWidths()
{
- RenderObject *child = firstChild();
- while (child) {
+ for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
// positioned children don't affect the minmaxwidth
- if (child->isPositioned() || child->style()->visibility() == COLLAPSE) {
- child = child->nextSibling();
+ if (child->isPositioned() || child->style()->visibility() == COLLAPSE)
continue;
- }
// A margin basically has three types: fixed, percentage, and auto (variable).
// Auto and percentage margins simply become 0 when computing min/max width.
@@ -134,21 +130,15 @@ void RenderFlexibleBox::calcHorizontalPrefWidths()
m_minPrefWidth += child->minPrefWidth() + margin;
m_maxPrefWidth += child->maxPrefWidth() + margin;
-
- child = child->nextSibling();
}
}
void RenderFlexibleBox::calcVerticalPrefWidths()
{
- RenderObject *child = firstChild();
- while(child != 0)
- {
+ 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) {
- child = child->nextSibling();
+ if (child->isPositioned() || child->style()->visibility() == COLLAPSE)
continue;
- }
// A margin basically has three types: fixed, percentage, and auto (variable).
// Auto/percentage margins simply become 0 when computing min/max width.
@@ -166,8 +156,6 @@ void RenderFlexibleBox::calcVerticalPrefWidths()
w = child->maxPrefWidth() + margin;
m_maxPrefWidth = max(w, m_maxPrefWidth);
-
- child = child->nextSibling();
}
}
@@ -212,29 +200,22 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren)
if (!relayoutChildren && layoutOnlyPositionedObjects())
return;
- IntRect oldBounds;
- IntRect oldOutlineBox;
- bool checkForRepaint = checkForRepaintDuringLayout();
- if (checkForRepaint) {
- oldBounds = absoluteClippedOverflowRect();
- oldOutlineBox = absoluteOutlineBounds();
- }
-
- LayoutStateMaintainer statePusher(view(), this, IntSize(m_x, m_y), !hasReflection());
+ LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
+ LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), hasTransform() || hasReflection());
- int previousWidth = m_width;
- int previousHeight = m_height;
+ int previousWidth = width();
+ int previousHeight = height();
calcWidth();
calcHeight();
- m_overflowWidth = m_width;
+ m_overflowWidth = width();
- if (previousWidth != m_width || previousHeight != m_height ||
+ if (previousWidth != width() || previousHeight != height() ||
(parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL &&
parent()->style()->boxAlign() == BSTRETCH))
relayoutChildren = true;
- m_height = 0;
+ setHeight(0);
m_overflowHeight = 0;
m_flexingChildren = m_stretchingChildren = false;
@@ -243,9 +224,9 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren)
// For overflow:scroll blocks, ensure we have both scrollbars in place always.
if (scrollsOverflow()) {
if (style()->overflowX() == OSCROLL)
- m_layer->setHasHorizontalScrollbar(true);
+ layer()->setHasHorizontalScrollbar(true);
if (style()->overflowY() == OSCROLL)
- m_layer->setHasVerticalScrollbar(true);
+ layer()->setHasVerticalScrollbar(true);
}
if (isHorizontal())
@@ -253,21 +234,21 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren)
else
layoutVerticalBox(relayoutChildren);
- int oldHeight = m_height;
+ int oldHeight = height();
calcHeight();
- if (oldHeight != m_height) {
+ if (oldHeight != height()) {
// If the block got expanded in size, then increase our overflowheight to match.
- if (m_overflowHeight > m_height)
+ if (m_overflowHeight > height())
m_overflowHeight -= (borderBottom() + paddingBottom() + horizontalScrollbarHeight());
- if (m_overflowHeight < m_height)
- m_overflowHeight = m_height;
+ if (m_overflowHeight < height())
+ m_overflowHeight = height();
}
- if (previousHeight != m_height)
+ if (previousHeight != height())
relayoutChildren = true;
layoutPositionedObjects(relayoutChildren || isRoot());
- if (!isFloatingOrPositioned() && m_height == 0) {
+ if (!isFloatingOrPositioned() && height() == 0) {
// We are a block with no border and padding and a computed height
// of 0. The CSS spec states that zero-height blocks collapse their margins
// together.
@@ -286,15 +267,15 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren)
}
// Always ensure our overflow width is at least as large as our width.
- if (m_overflowWidth < m_width)
- m_overflowWidth = m_width;
+ if (m_overflowWidth < width())
+ m_overflowWidth = width();
if (!hasOverflowClip()) {
for (ShadowData* boxShadow = style()->boxShadow(); boxShadow; boxShadow = boxShadow->next) {
m_overflowLeft = min(m_overflowLeft, boxShadow->x - boxShadow->blur);
- m_overflowWidth = max(m_overflowWidth, m_width + boxShadow->x + boxShadow->blur);
+ m_overflowWidth = max(m_overflowWidth, width() + boxShadow->x + boxShadow->blur);
m_overflowTop = min(m_overflowTop, boxShadow->y - boxShadow->blur);
- m_overflowHeight = max(m_overflowHeight, m_height + boxShadow->y + boxShadow->blur);
+ m_overflowHeight = max(m_overflowHeight, height() + boxShadow->y + boxShadow->blur);
}
if (hasReflection()) {
@@ -311,11 +292,10 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren)
// Update our scrollbars if we're overflow:auto/scroll/hidden now that we know if
// we overflow or not.
if (hasOverflowClip())
- m_layer->updateScrollInfoAfterLayout();
+ layer()->updateScrollInfoAfterLayout();
// Repaint with our new bounds if they are different from our old bounds.
- if (checkForRepaint)
- repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox);
+ repainter.repaintAfterLayout();
setNeedsLayout(false);
}
@@ -332,11 +312,11 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
unsigned int lowestFlexGroup = 0;
bool haveFlex = false;
int remainingSpace = 0;
- m_overflowHeight = m_height;
+ m_overflowHeight = height();
// The first walk over our kids is to find out if we have any flexible children.
FlexBoxIterator iterator(this);
- RenderObject* child = iterator.next();
+ RenderBox* child = iterator.next();
while (child) {
// Check to see if this child flexes.
if (!child->isPositioned() && child->style()->boxFlex() > 0.0f) {
@@ -361,8 +341,8 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
// their preferred widths. The second pass handles flexing the children.
do {
// Reset our height.
- m_height = yPos;
- m_overflowHeight = m_height;
+ setHeight(yPos);
+ m_overflowHeight = height();
xPos = borderLeft() + paddingLeft();
// Our first pass is done without flexing. We simply lay the children
@@ -388,9 +368,10 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
// Update our height and overflow height.
if (style()->boxAlign() == BBASELINE) {
- int ascent = child->marginTop() + child->getBaselineOfFirstLineBox();
+ int ascent = child->firstLineBoxBaseline();
if (ascent == -1)
- ascent = child->marginTop() + child->height() + child->marginBottom();
+ ascent = child->height() + child->marginBottom();
+ ascent += child->marginTop();
int descent = (child->marginTop() + child->height() + child->marginBottom()) - ascent;
// Update our maximum ascent.
@@ -400,28 +381,28 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
maxDescent = max(maxDescent, descent);
// Now update our height.
- m_height = max(yPos + maxAscent + maxDescent, m_height);
+ setHeight(max(yPos + maxAscent + maxDescent, height()));
}
else
- m_height = max(m_height, yPos + child->marginTop() + child->height() + child->marginBottom());
+ setHeight(max(height(), yPos + child->marginTop() + child->height() + child->marginBottom()));
child = iterator.next();
}
if (!iterator.first() && hasLineIfEmpty())
- m_height += lineHeight(true, true);
+ setHeight(height() + lineHeight(true, true));
- m_height += toAdd;
+ setHeight(height() + toAdd);
// Always make sure our overflowheight is at least our height.
- if (m_overflowHeight < m_height)
- m_overflowHeight = m_height;
+ if (m_overflowHeight < height())
+ m_overflowHeight = height();
- oldHeight = m_height;
+ oldHeight = height();
calcHeight();
relayoutChildren = false;
- if (oldHeight != m_height)
+ if (oldHeight != height())
heightSpecified = true;
// Now that our height is actually known, we can place our boxes.
@@ -430,13 +411,13 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
while (child) {
if (child->isPositioned()) {
child->containingBlock()->insertPositionedObject(child);
- if (child->hasStaticX()) {
+ if (child->style()->hasStaticX()) {
if (style()->direction() == LTR)
- child->setStaticX(xPos);
- else child->setStaticX(width() - xPos);
+ child->layer()->setStaticX(xPos);
+ else child->layer()->setStaticX(width() - xPos);
}
- if (child->hasStaticY())
- child->setStaticY(yPos);
+ if (child->style()->hasStaticY())
+ child->layer()->setStaticY(yPos);
child = iterator.next();
continue;
}
@@ -445,7 +426,7 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
// fill the height of a containing box by default.
// Now do a layout.
int oldChildHeight = child->height();
- static_cast<RenderBox*>(child)->calcHeight();
+ child->calcHeight();
if (oldChildHeight != child->height())
child->setChildNeedsLayout(true, false);
child->layoutIfNeeded();
@@ -458,9 +439,10 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
childY += child->marginTop() + max(0, (contentHeight() - (child->height() + child->marginTop() + child->marginBottom()))/2);
break;
case BBASELINE: {
- int ascent = child->marginTop() + child->getBaselineOfFirstLineBox();
+ int ascent = child->firstLineBoxBaseline();
if (ascent == -1)
- ascent = child->marginTop() + child->height() + child->marginBottom();
+ ascent = child->height() + child->marginBottom();
+ ascent += child->marginTop();
childY += child->marginTop() + (maxAscent - ascent);
break;
}
@@ -475,10 +457,10 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
placeChild(child, xPos, childY);
if (child->isRenderBlock())
- static_cast<RenderBlock*>(child)->addVisualOverflow(static_cast<RenderBlock*>(child)->floatRect());
+ toRenderBlock(child)->addVisualOverflow(toRenderBlock(child)->floatRect());
m_overflowHeight = max(m_overflowHeight, childY + child->overflowHeight(false));
- m_overflowTop = min(m_overflowTop, child->yPos() + child->overflowTop(false));
+ m_overflowTop = min(m_overflowTop, child->y() + child->overflowTop(false));
xPos += child->width() + child->marginRight();
@@ -619,7 +601,7 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
remainingSpace -= (remainingSpace/totalChildren);
totalChildren--;
- placeChild(child, child->xPos()+offset, child->yPos());
+ placeChild(child, child->x()+offset, child->y());
child = iterator.next();
}
}
@@ -634,7 +616,7 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
child = iterator.next();
continue;
}
- placeChild(child, child->xPos()+offset, child->yPos());
+ placeChild(child, child->x()+offset, child->y());
child = iterator.next();
}
}
@@ -646,20 +628,20 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
}
if (child) {
- m_overflowLeft = min(child->xPos() + child->overflowLeft(false), m_overflowLeft);
+ m_overflowLeft = min(child->x() + child->overflowLeft(false), m_overflowLeft);
- RenderObject* lastChild = child;
+ RenderBox* lastChild = child;
while ((child = iterator.next())) {
if (!child->isPositioned())
lastChild = child;
}
- m_overflowWidth = max(lastChild->xPos() + lastChild->overflowWidth(false), m_overflowWidth);
+ 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)
- m_height = oldHeight;
+ setHeight(oldHeight);
}
void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
@@ -667,7 +649,7 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
int xPos = borderLeft() + paddingLeft();
int yPos = borderTop() + paddingTop();
if( style()->direction() == RTL )
- xPos = m_width - paddingRight() - borderRight();
+ xPos = width() - paddingRight() - borderRight();
int toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
bool heightSpecified = false;
int oldHeight = 0;
@@ -679,7 +661,7 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
// The first walk over our kids is to find out if we have any flexible children.
FlexBoxIterator iterator(this);
- RenderObject *child = iterator.next();
+ RenderBox* child = iterator.next();
while (child) {
// Check to see if this child flexes.
if (!child->isPositioned() && child->style()->boxFlex() > 0.0f) {
@@ -714,13 +696,13 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
// Dirty all the positioned objects.
if (child->isRenderBlock()) {
- static_cast<RenderBlock*>(child)->markPositionedObjectsForLayout();
- static_cast<RenderBlock*>(child)->clearTruncation();
+ toRenderBlock(child)->markPositionedObjectsForLayout();
+ toRenderBlock(child)->clearTruncation();
}
}
child->layoutIfNeeded();
if (child->style()->height().isAuto() && child->isBlockFlow())
- maxLineCount = max(maxLineCount, static_cast<RenderBlock*>(child)->lineCount());
+ maxLineCount = max(maxLineCount, toRenderBlock(child)->lineCount());
}
child = iterator.next();
}
@@ -733,7 +715,7 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
if (child->isPositioned() || !child->style()->height().isAuto() || !child->isBlockFlow())
continue;
- RenderBlock* blockChild = static_cast<RenderBlock*>(child);
+ RenderBlock* blockChild = toRenderBlock(child);
int lineCount = blockChild->lineCount();
if (lineCount <= numVisibleLines)
continue;
@@ -762,9 +744,9 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
InlineBox* anchorBox = lastLine->lastChild();
if (!anchorBox)
continue;
- if (!anchorBox->object()->element())
+ if (!anchorBox->renderer()->node())
continue;
- if (!anchorBox->object()->element()->isLink())
+ if (!anchorBox->renderer()->node()->isLink())
continue;
RootInlineBox* lastVisibleLine = blockChild->lineAtIndex(numVisibleLines-1);
@@ -781,23 +763,27 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
int totalWidth = ellipsisAndSpaceWidth + anchorBox->width();
// See if this width can be accommodated on the last visible line
- RenderBlock* destBlock = static_cast<RenderBlock*>(lastVisibleLine->object());
- RenderBlock* srcBlock = static_cast<RenderBlock*>(lastLine->object());
+ RenderBlock* destBlock = toRenderBlock(lastVisibleLine->renderer());
+ RenderBlock* srcBlock = toRenderBlock(lastLine->renderer());
// FIXME: Directions of src/destBlock could be different from our direction and from one another.
if (srcBlock->style()->direction() != LTR)
continue;
if (destBlock->style()->direction() != LTR)
continue;
+ int ltr = true;
+
+ int blockRightEdge = destBlock->rightOffset(lastVisibleLine->y(), false);
+ int blockLeftEdge = destBlock->leftOffset(lastVisibleLine->y(), false);
- int blockEdge = destBlock->rightOffset(lastVisibleLine->yPos());
- if (!lastVisibleLine->canAccommodateEllipsis(true, blockEdge,
- lastVisibleLine->xPos() + lastVisibleLine->width(),
+ int blockEdge = ltr ? blockRightEdge : blockLeftEdge;
+ if (!lastVisibleLine->canAccommodateEllipsis(ltr, blockEdge,
+ lastVisibleLine->x() + lastVisibleLine->width(),
totalWidth))
continue;
// Let the truncation code kick in.
- lastVisibleLine->placeEllipsis(ellipsisAndSpaceStr, true, blockEdge, totalWidth, anchorBox);
+ lastVisibleLine->placeEllipsis(ellipsisAndSpaceStr, ltr, blockLeftEdge, blockRightEdge, totalWidth, anchorBox);
destBlock->setHasMarkupTruncation(true);
}
}
@@ -808,9 +794,9 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
// Our first pass is done without flexing. We simply lay the children
// out within the box.
do {
- m_height = borderTop() + paddingTop();
- int minHeight = m_height + toAdd;
- m_overflowHeight = m_height;
+ setHeight(borderTop() + paddingTop());
+ int minHeight = height() + toAdd;
+ m_overflowHeight = height();
child = iterator.first();
while (child) {
@@ -821,14 +807,14 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
if (child->isPositioned())
{
child->containingBlock()->insertPositionedObject(child);
- if (child->hasStaticX()) {
+ if (child->style()->hasStaticX()) {
if (style()->direction() == LTR)
- child->setStaticX(borderLeft()+paddingLeft());
+ child->layer()->setStaticX(borderLeft()+paddingLeft());
else
- child->setStaticX(borderRight()+paddingRight());
+ child->layer()->setStaticX(borderRight()+paddingRight());
}
- if (child->hasStaticY())
- child->setStaticY(m_height);
+ if (child->style()->hasStaticY())
+ child->layer()->setStaticY(height());
child = iterator.next();
continue;
}
@@ -837,7 +823,7 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
child->calcVerticalMargins();
// Add in the child's marginTop to our height.
- m_height += child->marginTop();
+ setHeight(height() + child->marginTop());
// Now do a layout.
child->layoutIfNeeded();
@@ -864,39 +850,39 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
}
// Place the child.
- placeChild(child, childX, m_height);
- m_height += child->height() + child->marginBottom();
+ placeChild(child, childX, height());
+ setHeight(height() + child->height() + child->marginBottom());
if (child->isRenderBlock())
- static_cast<RenderBlock*>(child)->addVisualOverflow(static_cast<RenderBlock*>(child)->floatRect());
+ toRenderBlock(child)->addVisualOverflow(toRenderBlock(child)->floatRect());
// See if this child has made our overflow need to grow.
- m_overflowWidth = max(child->xPos() + child->overflowWidth(false), m_overflowWidth);
- m_overflowLeft = min(child->xPos() + child->overflowLeft(false), m_overflowLeft);
+ m_overflowWidth = max(child->x() + child->overflowWidth(false), m_overflowWidth);
+ m_overflowLeft = min(child->x() + child->overflowLeft(false), m_overflowLeft);
child = iterator.next();
}
- yPos = m_height;
+ yPos = height();
if (!iterator.first() && hasLineIfEmpty())
- m_height += lineHeight(true, true);
+ setHeight(height() + lineHeight(true, true));
- m_height += toAdd;
+ setHeight(height() + toAdd);
// Negative margins can cause our height to shrink below our minimal height (border/padding).
// If this happens, ensure that the computed height is increased to the minimal height.
- if (m_height < minHeight)
- m_height = minHeight;
+ if (height() < minHeight)
+ setHeight(minHeight);
// Always make sure our overflowheight is at least our height.
- if (m_overflowHeight < m_height)
- m_overflowHeight = m_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 = m_height;
+ oldHeight = height();
calcHeight();
- if (oldHeight != m_height)
+ if (oldHeight != height())
heightSpecified = true;
remainingSpace = borderTop() + paddingTop() + contentHeight() - yPos;
@@ -1028,7 +1014,7 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
offset += remainingSpace/totalChildren;
remainingSpace -= (remainingSpace/totalChildren);
totalChildren--;
- placeChild(child, child->xPos(), child->yPos()+offset);
+ placeChild(child, child->x(), child->y()+offset);
child = iterator.next();
}
}
@@ -1043,7 +1029,7 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
child = iterator.next();
continue;
}
- placeChild(child, child->xPos(), child->yPos()+offset);
+ placeChild(child, child->x(), child->y()+offset);
child = iterator.next();
}
}
@@ -1055,28 +1041,28 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
}
if (child) {
- m_overflowTop = min(child->yPos() + child->overflowTop(false), m_overflowTop);
+ m_overflowTop = min(child->y() + child->overflowTop(false), m_overflowTop);
- RenderObject* lastChild = child;
+ RenderBox* lastChild = child;
while ((child = iterator.next())) {
if (!child->isPositioned())
lastChild = child;
}
- m_overflowHeight = max(lastChild->yPos() + lastChild->overflowHeight(false), m_overflowHeight);
+ 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.
if (heightSpecified)
- m_height = oldHeight;
+ setHeight(oldHeight);
}
-void RenderFlexibleBox::placeChild(RenderObject* child, int x, int y)
+void RenderFlexibleBox::placeChild(RenderBox* child, int x, int y)
{
- IntRect oldRect(child->xPos(), child->yPos() , child->width(), child->height());
+ IntRect oldRect(child->x(), child->y() , child->width(), child->height());
// Place the child.
- child->setPos(x, y);
+ child->setLocation(x, y);
// If the child moved, we have to repaint it as well as any floating/positioned
// descendants. An exception is if we need a layout. In this case, we know we're going to
@@ -1085,7 +1071,7 @@ void RenderFlexibleBox::placeChild(RenderObject* child, int x, int y)
child->repaintDuringLayoutIfMoved(oldRect);
}
-int RenderFlexibleBox::allowedChildFlex(RenderObject* child, bool expanding, unsigned int group)
+int RenderFlexibleBox::allowedChildFlex(RenderBox* child, bool expanding, unsigned int group)
{
if (child->isPositioned() || child->style()->boxFlex() == 0.0f || child->style()->boxFlexGroup() != group)
return 0;