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

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

Issue 1971053003: Use new intrinsic content height when computing min-height: min-content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed tests Created 4 years, 7 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
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 2655 matching lines...) Expand 10 before | Expand all | Expand 10 after
2666 return std::max(LayoutUnit(), adjustContentBoxLogicalHeightForBoxSizing(heig htIncludingScrollbar) - scrollbarLogicalHeight()); 2666 return std::max(LayoutUnit(), adjustContentBoxLogicalHeightForBoxSizing(heig htIncludingScrollbar) - scrollbarLogicalHeight());
2667 } 2667 }
2668 2668
2669 LayoutUnit LayoutBox::computeIntrinsicLogicalContentHeightUsing(const Length& lo gicalHeightLength, LayoutUnit intrinsicContentHeight, LayoutUnit borderAndPaddin g) const 2669 LayoutUnit LayoutBox::computeIntrinsicLogicalContentHeightUsing(const Length& lo gicalHeightLength, LayoutUnit intrinsicContentHeight, LayoutUnit borderAndPaddin g) const
2670 { 2670 {
2671 // FIXME(cbiesinger): The css-sizing spec is considering changing what min-c ontent/max-content should resolve to. 2671 // FIXME(cbiesinger): The css-sizing spec is considering changing what min-c ontent/max-content should resolve to.
2672 // If that happens, this code will have to change. 2672 // If that happens, this code will have to change.
2673 if (logicalHeightLength.isMinContent() || logicalHeightLength.isMaxContent() || logicalHeightLength.isFitContent()) { 2673 if (logicalHeightLength.isMinContent() || logicalHeightLength.isMaxContent() || logicalHeightLength.isFitContent()) {
2674 if (isAtomicInlineLevel()) 2674 if (isAtomicInlineLevel())
2675 return intrinsicSize().height(); 2675 return intrinsicSize().height();
2676 if (m_intrinsicContentLogicalHeight != -1) 2676 if (intrinsicContentHeight != -1)
eae 2016/05/12 19:24:56 Shouldn't we be able to always use intrinsicConten
cbiesinger 2016/05/12 19:49:45 I believe you're correct, especially given that co
2677 return m_intrinsicContentLogicalHeight; 2677 return intrinsicContentHeight;
2678 return intrinsicContentHeight; 2678 return m_intrinsicContentLogicalHeight;
2679 } 2679 }
2680 if (logicalHeightLength.isFillAvailable()) 2680 if (logicalHeightLength.isFillAvailable())
2681 return containingBlock()->availableLogicalHeight(ExcludeMarginBorderPadd ing) - borderAndPadding; 2681 return containingBlock()->availableLogicalHeight(ExcludeMarginBorderPadd ing) - borderAndPadding;
2682 ASSERT_NOT_REACHED(); 2682 ASSERT_NOT_REACHED();
2683 return LayoutUnit(); 2683 return LayoutUnit();
2684 } 2684 }
2685 2685
2686 LayoutUnit LayoutBox::computeContentAndScrollbarLogicalHeightUsing(SizeType heig htType, const Length& height, LayoutUnit intrinsicContentHeight) const 2686 LayoutUnit LayoutBox::computeContentAndScrollbarLogicalHeightUsing(SizeType heig htType, const Length& height, LayoutUnit intrinsicContentHeight) const
2687 { 2687 {
2688 if (height.isAuto()) 2688 if (height.isAuto())
(...skipping 2259 matching lines...) Expand 10 before | Expand all | Expand 10 after
4948 m_rareData->m_snapAreas->remove(&snapArea); 4948 m_rareData->m_snapAreas->remove(&snapArea);
4949 } 4949 }
4950 } 4950 }
4951 4951
4952 SnapAreaSet* LayoutBox::snapAreas() const 4952 SnapAreaSet* LayoutBox::snapAreas() const
4953 { 4953 {
4954 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; 4954 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr;
4955 } 4955 }
4956 4956
4957 } // namespace blink 4957 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698