r->layoutIfNeeded();
- // Adjust the static position of a center-aligned inline positioned object with a block child now that the child's width has been computed.
- if (!r->parent()->isRenderView() && r->parent()->isRenderBlock() && r->firstChild() && r->style()->position() == AbsolutePosition
- && r->style()->isOriginalDisplayInlineType() && (r->style()->textAlign() == CENTER || r->style()->textAlign() == WEBKIT_CENTER)) {
- RenderBlock* block = toRenderBlock(r->parent());
- LayoutUnit blockHeight = block->logicalHeight();
- block->setStaticInlinePositionForChild(r, blockHeight, block->startAlignedOffsetForLine(r, blockHeight, false));
- }
-
// Lay out again if our estimate was wrong.
if (needsBlockDirectionLocationSetBeforeLayout && logicalTopForChild(r) != oldLogicalTop) {
r->setChildNeedsLayout(true, MarkOnlyThis);
// A relative positioned inline encloses us. In this case, we also have to determine our
// position as though we were an inline. Set |staticInlinePosition| and |staticBlockPosition| on the relative positioned
// inline so that we can obtain the value later.
- toRenderInline(containerBlock)->layer()->setStaticInlinePosition(block->startAlignedOffsetForLine(child, blockHeight, false));
+ toRenderInline(containerBlock)->layer()->setStaticInlinePosition(block->startAlignedOffsetForLine(blockHeight, false));
toRenderInline(containerBlock)->layer()->setStaticBlockPosition(blockHeight);
}
if (child->style()->isOriginalDisplayInlineType())
- block->setStaticInlinePositionForChild(child, blockHeight, block->startAlignedOffsetForLine(child, blockHeight, false));
+ block->setStaticInlinePositionForChild(child, blockHeight, block->startAlignedOffsetForLine(blockHeight, false));
else
block->setStaticInlinePositionForChild(child, blockHeight, block->startOffsetForContent(blockHeight));
child->layer()->setStaticBlockPosition(blockHeight);
return true;
}
-LayoutUnit RenderBlock::startAlignedOffsetForLine(RenderBox* child, LayoutUnit position, bool firstLine)
+LayoutUnit RenderBlock::startAlignedOffsetForLine(LayoutUnit position, bool firstLine)
{
ETextAlign textAlign = style()->textAlign();
return startOffsetForLine(position, firstLine);
// updateLogicalWidthForAlignment() handles the direction of the block so no need to consider it here
- float logicalLeft;
- float availableLogicalWidth;
- logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false);
- availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), false) - logicalLeft;
- float totalLogicalWidth = logicalWidthForChild(child);
+ float totalLogicalWidth = 0;
+ float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false);
+ float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), false) - logicalLeft;
updateLogicalWidthForAlignment(textAlign, 0, logicalLeft, totalLogicalWidth, availableLogicalWidth, 0);
if (!style()->isLeftToRightDirection())
- return logicalWidth() - (logicalLeft + totalLogicalWidth);
+ return logicalWidth() - logicalLeft;
return logicalLeft;
}