Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
| index 691734c6f921a96e44ac6dc707bae503e4cce547..ed78616803b87a59df5d35e81a762f3145104742 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
| @@ -492,6 +492,11 @@ void LayoutBoxModelObject::updateFromStyle() |
| setHorizontalWritingMode(styleToUse.isHorizontalWritingMode()); |
| } |
| +static bool isOutOfFlowPositionedWithImplicitHeight(LayoutBlock* child) |
|
mstensho (USE GERRIT)
2016/08/29 16:02:26
static inline and const LayoutBlock?
|
| +{ |
| + return child->isOutOfFlowPositioned() && !child->style()->logicalTop().isAuto() && !child->style()->logicalBottom().isAuto(); |
| +} |
| + |
| LayoutBlock* LayoutBoxModelObject::containingBlockForAutoHeightDetection(Length logicalHeight) const |
| { |
| // For percentage heights: The percentage is calculated with respect to the height of the generated box's |
| @@ -519,7 +524,7 @@ LayoutBlock* LayoutBoxModelObject::containingBlockForAutoHeightDetection(Length |
| if (cb->isLayoutView()) |
| return nullptr; |
| - if (cb->isOutOfFlowPositioned() && !cb->style()->logicalTop().isAuto() && !cb->style()->logicalBottom().isAuto()) |
| + if (isOutOfFlowPositionedWithImplicitHeight(cb)) |
| return nullptr; |
| return cb; |
| @@ -543,7 +548,7 @@ bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight(bool che |
| if (!checkingContainingBlock && thisBox->hasOverrideContainingBlockLogicalHeight()) |
| return false; |
| } |
| - if (logicalHeightLength.isAuto()) |
| + if (logicalHeightLength.isAuto() && !isOutOfFlowPositionedWithImplicitHeight(this)) |
| return true; |
| if (document().inQuirksMode()) |