Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2121173002: [css-grid] Fix percentage height resolution for replaced elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make hasAutoHeightOrContainingBlockWithAutoHeight(bool) private Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698