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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2039223002: [css-grid] Fix percentage height on grid item's children (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: New version using overrideLogicalContentHeight Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-resolution-grid-item-children.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 2715 matching lines...) Expand 10 before | Expand all | Expand 10 after
2726 LayoutUnit stretchedFlexHeight(-1); 2726 LayoutUnit stretchedFlexHeight(-1);
2727 if (cb->isFlexItem()) 2727 if (cb->isFlexItem())
2728 stretchedFlexHeight = toLayoutFlexibleBox(cb->parent())->childLogicalHei ghtForPercentageResolution(*cb); 2728 stretchedFlexHeight = toLayoutFlexibleBox(cb->parent())->childLogicalHei ghtForPercentageResolution(*cb);
2729 2729
2730 if (isHorizontalWritingMode() != cb->isHorizontalWritingMode()) { 2730 if (isHorizontalWritingMode() != cb->isHorizontalWritingMode()) {
2731 availableHeight = containingBlockChild->containingBlockLogicalWidthForCo ntent(); 2731 availableHeight = containingBlockChild->containingBlockLogicalWidthForCo ntent();
2732 } else if (stretchedFlexHeight != LayoutUnit(-1)) { 2732 } else if (stretchedFlexHeight != LayoutUnit(-1)) {
2733 availableHeight = stretchedFlexHeight; 2733 availableHeight = stretchedFlexHeight;
2734 } else if (hasOverrideContainingBlockLogicalHeight() && !isOutOfFlowPosition edWithSpecifiedHeight) { 2734 } else if (hasOverrideContainingBlockLogicalHeight() && !isOutOfFlowPosition edWithSpecifiedHeight) {
2735 availableHeight = overrideContainingBlockContentLogicalHeight(); 2735 availableHeight = overrideContainingBlockContentLogicalHeight();
2736 } else if (cb->isGridItem() && cb->hasOverrideLogicalContentHeight()) {
2737 availableHeight = cb->overrideLogicalContentHeight();
2736 } else if (cbstyle.logicalHeight().isFixed()) { 2738 } else if (cbstyle.logicalHeight().isFixed()) {
2737 LayoutUnit contentBoxHeight = cb->adjustContentBoxLogicalHeightForBoxSiz ing(cbstyle.logicalHeight().value()); 2739 LayoutUnit contentBoxHeight = cb->adjustContentBoxLogicalHeightForBoxSiz ing(cbstyle.logicalHeight().value());
2738 availableHeight = cb->constrainContentBoxLogicalHeightByMinMax( 2740 availableHeight = cb->constrainContentBoxLogicalHeightByMinMax(
2739 contentBoxHeight - cb->scrollbarLogicalHeight(), LayoutUnit(-1)).cla mpNegativeToZero(); 2741 contentBoxHeight - cb->scrollbarLogicalHeight(), LayoutUnit(-1)).cla mpNegativeToZero();
2740 if (cb->isTableCell()) { 2742 if (cb->isTableCell()) {
2741 includeBorderPadding = true; 2743 includeBorderPadding = true;
2742 // We're sizing content to the height from the cell's style so don't involve the intrinsic padding used to align the content. 2744 // We're sizing content to the height from the cell's style so don't involve the intrinsic padding used to align the content.
2743 availableHeight -= cb->computedCSSPaddingBefore() + cb->computedCSSP addingAfter() + cb->borderBefore() + cb->borderAfter(); 2745 availableHeight -= cb->computedCSSPaddingBefore() + cb->computedCSSP addingAfter() + cb->borderBefore() + cb->borderAfter();
2744 } 2746 }
2745 } else if (cb->isTableCell()) { 2747 } else if (cb->isTableCell()) {
(...skipping 2129 matching lines...) Expand 10 before | Expand all | Expand 10 after
4875 m_rareData->m_snapAreas->remove(&snapArea); 4877 m_rareData->m_snapAreas->remove(&snapArea);
4876 } 4878 }
4877 } 4879 }
4878 4880
4879 SnapAreaSet* LayoutBox::snapAreas() const 4881 SnapAreaSet* LayoutBox::snapAreas() const
4880 { 4882 {
4881 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; 4883 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr;
4882 } 4884 }
4883 4885
4884 } // namespace blink 4886 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-resolution-grid-item-children.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698