Index: Source/core/rendering/RenderBox.cpp |
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp |
index f8701312bfd61f38a443479ad7901352007b805a..a7c43665778a45f7fbb1e35fa5dbf0fa0c34c493 100644 |
--- a/Source/core/rendering/RenderBox.cpp |
+++ b/Source/core/rendering/RenderBox.cpp |
@@ -3084,6 +3084,8 @@ static void computeInlineStaticDistance(Length& logicalLeft, Length& logicalRigh |
for (RenderObject* curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) { |
if (curr->isBox()) { |
staticPosition += toRenderBox(curr)->logicalLeft(); |
+ if (toRenderBox(curr)->isRelPositioned()) |
+ staticPosition += toRenderBox(curr)->relativePositionOffset().width(); |
if (region && curr->isRenderBlock()) { |
const RenderBlock* cb = toRenderBlock(curr); |
region = cb->clampToStartAndEndRegions(region); |
@@ -3091,16 +3093,26 @@ static void computeInlineStaticDistance(Length& logicalLeft, Length& logicalRigh |
if (boxInfo) |
staticPosition += boxInfo->logicalLeft(); |
} |
+ } else if (curr->isInline()) { |
+ if (curr->isRelPositioned()) { |
+ if (!curr->style()->logicalLeft().isAuto()) |
+ staticPosition += curr->style()->logicalLeft().value(); |
+ else |
+ staticPosition -= curr->style()->logicalRight().value(); |
+ } |
} |
} |
logicalLeft.setValue(Fixed, staticPosition); |
} else { |
RenderBox* enclosingBox = child->parent()->enclosingBox(); |
LayoutUnit staticPosition = child->layer()->staticInlinePosition() + containerLogicalWidth + containerBlock->borderLogicalLeft(); |
- for (RenderObject* curr = enclosingBox; curr; curr = curr->container()) { |
+ for (RenderObject* curr = child->parent(); curr; curr = curr->container()) { |
if (curr->isBox()) { |
- if (curr != containerBlock) |
+ if (curr != containerBlock) { |
staticPosition -= toRenderBox(curr)->logicalLeft(); |
+ if (toRenderBox(curr)->isRelPositioned()) |
+ staticPosition -= toRenderBox(curr)->relativePositionOffset().width(); |
+ } |
if (curr == enclosingBox) |
staticPosition -= enclosingBox->logicalWidth(); |
if (region && curr->isRenderBlock()) { |
@@ -3114,6 +3126,13 @@ static void computeInlineStaticDistance(Length& logicalLeft, Length& logicalRigh |
staticPosition += enclosingBox->logicalWidth() - boxInfo->logicalWidth(); |
} |
} |
+ } else if (curr->isInline()) { |
+ if (curr->isRelPositioned()) { |
+ if (!curr->style()->logicalLeft().isAuto()) |
+ staticPosition -= curr->style()->logicalLeft().value(); |
+ else |
+ staticPosition += curr->style()->logicalRight().value(); |
+ } |
} |
if (curr == containerBlock) |
break; |