Index: Source/core/rendering/RenderBox.cpp |
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp |
index 39befae260204bc7a2b5b40e9d6460cfa6e6109a..e8621a4d77957dbd98e75615e14ab5e790b9e537 100644 |
--- a/Source/core/rendering/RenderBox.cpp |
+++ b/Source/core/rendering/RenderBox.cpp |
@@ -2669,6 +2669,9 @@ LayoutUnit RenderBox::containingBlockLogicalWidthForPositioned(const RenderBoxMo |
} |
} |
+ if (hasOverrideContainingBlockLogicalWidth()) |
+ return overrideContainingBlockContentLogicalWidth(); |
+ |
if (containingBlock->isBox()) |
return toRenderBox(containingBlock)->clientLogicalWidth(); |
@@ -2709,6 +2712,9 @@ LayoutUnit RenderBox::containingBlockLogicalHeightForPositioned(const RenderBoxM |
} |
} |
+ if (hasOverrideContainingBlockLogicalHeight()) |
+ return overrideContainingBlockContentLogicalHeight(); |
+ |
if (containingBlock->isBox()) { |
const RenderBlock* cb = containingBlock->isRenderBlock() ? |
toRenderBlock(containingBlock) : containingBlock->containingBlock(); |
@@ -2737,7 +2743,7 @@ LayoutUnit RenderBox::containingBlockLogicalHeightForPositioned(const RenderBoxM |
static void computeInlineStaticDistance(Length& logicalLeft, Length& logicalRight, const RenderBox* child, const RenderBoxModelObject* containerBlock, LayoutUnit containerLogicalWidth) |
{ |
- if (!logicalLeft.isAuto() || !logicalRight.isAuto()) |
+ if ((!logicalLeft.isAuto() || !logicalRight.isAuto()) && !child->parent()->isRenderGrid()) |
return; |
// FIXME: The static distance computation has not been patched for mixed writing modes yet. |
@@ -2757,6 +2763,10 @@ static void computeInlineStaticDistance(Length& logicalLeft, Length& logicalRigh |
} |
} |
} |
+ if (!logicalLeft.isAuto()) |
+ staticPosition += valueForLength(logicalLeft, containerLogicalWidth); |
+ else if (!logicalRight.isAuto()) |
+ staticPosition -= valueForLength(logicalRight, containerLogicalWidth); |
Julien - ping for review
2014/10/20 19:34:43
It's unclear to me why this doesn't impact regular
Manuel Rego
2014/10/23 12:48:38
Basically it doesn't affect regular blocks, becaus
|
logicalLeft.setValue(Fixed, staticPosition); |
} else { |
RenderBox* enclosingBox = child->parent()->enclosingBox(); |
@@ -2781,6 +2791,10 @@ static void computeInlineStaticDistance(Length& logicalLeft, Length& logicalRigh |
if (curr == containerBlock) |
break; |
} |
+ if (!logicalRight.isAuto()) |
+ staticPosition += valueForLength(logicalRight, containerLogicalWidth); |
+ else if (!logicalLeft.isAuto()) |
+ staticPosition -= valueForLength(logicalLeft, containerLogicalWidth); |
Manuel Rego
2014/10/23 12:48:38
Like in the previous method, I've done something s
|
logicalRight.setValue(Fixed, staticPosition); |
} |
} |
@@ -3103,9 +3117,9 @@ void RenderBox::computePositionedLogicalWidthUsing(Length logicalWidth, const Re |
computeLogicalLeftPositionedOffset(computedValues.m_position, this, computedValues.m_extent, containerBlock, containerLogicalWidth); |
} |
-static void computeBlockStaticDistance(Length& logicalTop, Length& logicalBottom, const RenderBox* child, const RenderBoxModelObject* containerBlock) |
+static void computeBlockStaticDistance(Length& logicalTop, Length& logicalBottom, const RenderBox* child, const RenderBoxModelObject* containerBlock, LayoutUnit containerLogicalHeight) |
{ |
- if (!logicalTop.isAuto() || !logicalBottom.isAuto()) |
+ if ((!logicalTop.isAuto() || !logicalBottom.isAuto()) && !child->parent()->isRenderGrid()) |
return; |
// FIXME: The static distance computation has not been patched for mixed writing modes. |
@@ -3114,6 +3128,10 @@ static void computeBlockStaticDistance(Length& logicalTop, Length& logicalBottom |
if (curr->isBox() && !curr->isTableRow()) |
staticLogicalTop += toRenderBox(curr)->logicalTop(); |
} |
+ if (!logicalTop.isAuto()) |
+ staticLogicalTop += valueForLength(logicalTop, containerLogicalHeight); |
+ else if (!logicalBottom.isAuto()) |
+ staticLogicalTop -= valueForLength(logicalBottom, containerLogicalHeight); |
logicalTop.setValue(Fixed, staticLogicalTop); |
} |
@@ -3162,7 +3180,7 @@ void RenderBox::computePositionedLogicalHeight(LogicalExtentComputedValues& comp |
// see FIXME 1 |
// Calculate the static distance if needed. |
- computeBlockStaticDistance(logicalTopLength, logicalBottomLength, this, containerBlock); |
+ computeBlockStaticDistance(logicalTopLength, logicalBottomLength, this, containerBlock, containerLogicalHeight); |
// Calculate constraint equation values for 'height' case. |
LayoutUnit logicalHeight = computedValues.m_extent; |
@@ -3568,7 +3586,7 @@ void RenderBox::computePositionedLogicalHeightReplaced(LogicalExtentComputedValu |
* with the element's static position. |
\*-----------------------------------------------------------------------*/ |
// see FIXME 1 |
- computeBlockStaticDistance(logicalTop, logicalBottom, this, containerBlock); |
+ computeBlockStaticDistance(logicalTop, logicalBottom, this, containerBlock, containerLogicalHeight); |
/*-----------------------------------------------------------------------*\ |
* 3. If 'bottom' is 'auto', replace any 'auto' on 'margin-top' or |