Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
index 5a67a96d661ebf8b22efa0669535b77ca7ee773e..bd13394d3b187cc58ecec0c7d84f842303a2e734 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
@@ -2913,13 +2913,14 @@ LayoutUnit LayoutBox::computeReplacedLogicalHeightUsing(SizeType sizeType, const |
LayoutObject* cb = isOutOfFlowPositioned() ? container() : containingBlock(); |
while (cb->isAnonymous()) |
cb = cb->containingBlock(); |
- LayoutUnit stretchedFlexHeight(-1); |
+ LayoutUnit stretchedHeight(-1); |
if (cb->isLayoutBlock()) { |
LayoutBlock* block = toLayoutBlock(cb); |
block->addPercentHeightDescendant(const_cast<LayoutBox*>(this)); |
if (block->isFlexItem()) |
- stretchedFlexHeight = toLayoutFlexibleBox(block->parent())->childLogicalHeightForPercentageResolution(*block); |
- |
+ stretchedHeight = toLayoutFlexibleBox(block->parent())->childLogicalHeightForPercentageResolution(*block); |
+ else if (block->isGridItem() && block->hasOverrideLogicalContentHeight()) |
+ stretchedHeight = block->overrideLogicalContentHeight(); |
} |
if (cb->isOutOfFlowPositioned() && cb->style()->height().isAuto() && !(cb->style()->top().isAuto() || cb->style()->bottom().isAuto())) { |
@@ -2938,8 +2939,10 @@ LayoutUnit LayoutBox::computeReplacedLogicalHeightUsing(SizeType sizeType, const |
LayoutUnit availableHeight; |
if (isOutOfFlowPositioned()) { |
availableHeight = containingBlockLogicalHeightForPositioned(toLayoutBoxModelObject(cb)); |
- } else if (stretchedFlexHeight != -1) { |
- availableHeight = stretchedFlexHeight; |
+ } else if (stretchedHeight != -1) { |
+ availableHeight = stretchedHeight; |
+ } else if (isGridItem() && hasOverrideContainingBlockLogicalHeight()) { |
+ availableHeight = overrideContainingBlockContentLogicalHeight(); |
} else { |
availableHeight = containingBlockLogicalHeightForContent(IncludeMarginBorderPadding); |
// It is necessary to use the border-box to match WinIE's broken |