Index: Source/core/layout/LayoutBox.cpp |
diff --git a/Source/core/layout/LayoutBox.cpp b/Source/core/layout/LayoutBox.cpp |
index 7288f8a70565cef5b881e34fdd8d785b900a700f..dfb3d9d781a9e5d010185c0b36e7d7f283e20788 100644 |
--- a/Source/core/layout/LayoutBox.cpp |
+++ b/Source/core/layout/LayoutBox.cpp |
@@ -4195,37 +4195,32 @@ void LayoutBox::clearLayoutOverflow() |
m_overflow->setLayoutOverflow(noOverflowRect()); |
} |
-bool LayoutBox::logicalWidthIsResolvableFromBlock(const RenderBlock* containingBlock) |
+bool LayoutBox::logicalWidthIsResolvableFromBlock(const LayoutBox* box) |
{ |
- const RenderBlock* cb = containingBlock; |
- while (!cb->isRenderView() && !cb->isOutOfFlowPositioned() && (cb->style()->logicalWidth().isAuto() || cb->isAnonymousBlock())) |
- cb = cb->containingBlock(); |
+ while (!box->isRenderView() && !box->isOutOfFlowPositioned() |
+ && (box->style()->logicalWidth().isAuto() || box->isAnonymousBlock()) |
+ && !box->hasOverrideContainingBlockLogicalWidth()) |
+ box = box->containingBlock(); |
- if (cb->style()->logicalWidth().isFixed()) |
+ if (box->style()->logicalWidth().isFixed()) |
return true; |
- if (cb->isRenderView()) |
+ if (box->isRenderView()) |
return true; |
- if (cb->isOutOfFlowPositioned()) |
+ // The size of the containing block of an absolutely positioned element is always definite with respect to that |
+ // element (http://dev.w3.org/csswg/css-sizing-3/#definite). |
+ if (box->isOutOfFlowPositioned()) |
return true; |
- if (cb->style()->logicalWidth().isPercent()) |
- return logicalWidthIsResolvableFromBlock(cb->containingBlock()); |
+ if (box->hasOverrideContainingBlockLogicalWidth()) |
+ return box->overrideContainingBlockContentLogicalWidth() != -1; |
+ if (box->style()->logicalWidth().isPercent()) |
+ return logicalWidthIsResolvableFromBlock(box->containingBlock()); |
return false; |
} |
bool LayoutBox::hasDefiniteLogicalWidth() const |
{ |
- const Length& logicalWidth = style()->logicalWidth(); |
- if (logicalWidth.isIntrinsic() || logicalWidth.isLegacyIntrinsic()) |
- return false; |
- if (logicalWidth.isFixed()) |
- return true; |
- // The size of the containing block of an absolutely positioned element is always definite with respect to that |
- // element (http://dev.w3.org/csswg/css-sizing-3/#definite). |
- if (isOutOfFlowPositioned()) |
- return true; |
- |
- return LayoutBox::logicalWidthIsResolvableFromBlock(containingBlock()); |
+ return LayoutBox::logicalWidthIsResolvableFromBlock(this); |
} |
inline static bool percentageLogicalHeightIsResolvable(const LayoutBox* box) |
@@ -4245,6 +4240,9 @@ bool LayoutBox::percentageLogicalHeightIsResolvableFromBlock(const RenderBlock* |
while (!cb->isRenderView() && !cb->isBody() && !cb->isTableCell() && !cb->isOutOfFlowPositioned() && cb->style()->logicalHeight().isAuto()) { |
if (!inQuirksMode && !cb->isAnonymousBlock()) |
break; |
+ if (cb->hasOverrideContainingBlockLogicalHeight()) |
+ return cb->overrideContainingBlockContentLogicalHeight() != -1; |
+ |
cb = cb->containingBlock(); |
} |
@@ -4288,6 +4286,8 @@ bool LayoutBox::hasDefiniteLogicalHeight() const |
// element (http://dev.w3.org/csswg/css-sizing-3/#definite). |
if (isOutOfFlowPositioned()) |
return true; |
+ if (hasOverrideContainingBlockLogicalHeight()) |
+ return overrideContainingBlockContentLogicalHeight() != -1; |
return percentageLogicalHeightIsResolvable(this); |
} |