Chromium Code Reviews| Index: Source/core/rendering/RenderBox.cpp |
| diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp |
| index ba4d685f23f43ab7471990d6db56280949055e69..441db3f40985913fbfd635e50994689bd5808254 100644 |
| --- a/Source/core/rendering/RenderBox.cpp |
| +++ b/Source/core/rendering/RenderBox.cpp |
| @@ -3448,8 +3448,20 @@ static void computeLogicalLeftPositionedOffset(LayoutUnit& logicalLeftPos, const |
| if (containerBlock->isHorizontalWritingMode() != child->isHorizontalWritingMode() && containerBlock->style()->isFlippedBlocksWritingMode()) { |
| logicalLeftPos = containerLogicalWidth - logicalWidthValue - logicalLeftPos; |
| logicalLeftPos += (child->isHorizontalWritingMode() ? containerBlock->borderRight() : containerBlock->borderBottom()); |
| - } else |
| - logicalLeftPos += (child->isHorizontalWritingMode() ? containerBlock->borderLeft() : containerBlock->borderTop()); |
| + } else if (child->isHorizontalWritingMode()) { |
| + RenderStyle* blockStyle = containerBlock->style(); |
| + bool containerBlockIsLTR = isLeftToRightDirection(blockStyle->direction()); |
| + if (containerBlockIsLTR && containerBlock->simplifiedTextAlign(blockStyle->textAlign()) == RIGHT) { |
|
eae
2014/01/30 18:38:27
How about using a local variable to hold the conta
mario.prada
2014/02/04 14:30:13
Ok
|
| + logicalLeftPos = containerLogicalWidth - (logicalWidthValue + child->style()->logicalRight().value()); |
| + logicalLeftPos += containerBlock->borderLogicalRight(); |
|
eae
2014/01/30 18:38:27
Shouldn't this be borderAndPaddingLogicalRight?
mario.prada
2014/02/04 14:30:13
I've thought the same and actually tried it, but t
|
| + } else if (!containerBlockIsLTR && containerBlock->simplifiedTextAlign(blockStyle->textAlign()) == LEFT) { |
| + logicalLeftPos += containerBlock->borderAndPaddingLogicalLeft() + logicalWidthValue; |
| + } else { |
| + logicalLeftPos += containerBlock->borderLeft(); |
| + } |
| + } else { |
| + logicalLeftPos += containerBlock->borderTop(); |
| + } |
| } |
| void RenderBox::shrinkToFitWidth(const LayoutUnit availableSpace, const LayoutUnit logicalLeftValue, const LayoutUnit bordersPlusPadding, LogicalExtentComputedValues& computedValues) const |