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 b79d4d6bbb6958acc35faf9942a375174d0ed3c5..3b8daff1a8c1f64730cd7999110873ae89f034b1 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
@@ -555,7 +555,7 @@ LayoutBlock* LayoutBoxModelObject::containingBlockForAutoHeightDetection(Length |
return cb; |
} |
-bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight() const |
+bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight(bool checkingContainingBlock) const |
{ |
const LayoutBox* thisBox = isBox() ? toLayoutBox(this) : nullptr; |
Length logicalHeightLength = style()->logicalHeight(); |
@@ -567,6 +567,12 @@ bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight() const |
if (flexBox.childLogicalHeightForPercentageResolution(*thisBox) != LayoutUnit(-1)) |
return false; |
} |
+ if (thisBox && thisBox->isGridItem()) { |
+ if (checkingContainingBlock && thisBox->hasOverrideLogicalContentHeight()) |
+ return false; |
+ if (!checkingContainingBlock && thisBox->hasOverrideContainingBlockLogicalHeight()) |
+ return false; |
+ } |
if (logicalHeightLength.isAuto()) |
return true; |
@@ -575,10 +581,15 @@ bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight() const |
// If the height of the containing block computes to 'auto', then it hasn't been 'specified explicitly'. |
if (cb) |
- return cb->hasAutoHeightOrContainingBlockWithAutoHeight(); |
+ return cb->hasAutoHeightOrContainingBlockWithAutoHeight(true); |
return false; |
} |
+bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight() const |
+{ |
+ return hasAutoHeightOrContainingBlockWithAutoHeight(false); |
+} |
+ |
LayoutSize LayoutBoxModelObject::relativePositionOffset() const |
{ |
LayoutSize offset = accumulateInFlowPositionOffsets(); |