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

Side by Side Diff: Source/core/rendering/RenderBox.cpp

Issue 407753002: Calculate the correct available height for content (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/replaced/available-height-for-content-expected.txt ('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 2819 matching lines...) Expand 10 before | Expand all | Expand 10 after
2830 case FitContent: 2830 case FitContent:
2831 case FillAvailable: 2831 case FillAvailable:
2832 return adjustContentBoxLogicalHeightForBoxSizing(computeIntrinsicLog icalContentHeightUsing(logicalHeight, intrinsicLogicalHeight(), borderAndPadding Height())); 2832 return adjustContentBoxLogicalHeightForBoxSizing(computeIntrinsicLog icalContentHeightUsing(logicalHeight, intrinsicLogicalHeight(), borderAndPadding Height()));
2833 default: 2833 default:
2834 return intrinsicLogicalHeight(); 2834 return intrinsicLogicalHeight();
2835 } 2835 }
2836 } 2836 }
2837 2837
2838 LayoutUnit RenderBox::availableLogicalHeight(AvailableLogicalHeightType heightTy pe) const 2838 LayoutUnit RenderBox::availableLogicalHeight(AvailableLogicalHeightType heightTy pe) const
2839 { 2839 {
2840 return constrainLogicalHeightByMinMax(availableLogicalHeightUsing(style()->l ogicalHeight(), heightType), -1); 2840 // http://www.w3.org/TR/CSS2/visudet.html#propdef-height - We are interested in the content height.
2841 return constrainContentBoxLogicalHeightByMinMax(availableLogicalHeightUsing( style()->logicalHeight(), heightType), -1);
2841 } 2842 }
2842 2843
2843 LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h, AvailableLogi calHeightType heightType) const 2844 LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h, AvailableLogi calHeightType heightType) const
2844 { 2845 {
2845 if (isRenderView()) 2846 if (isRenderView())
2846 return isHorizontalWritingMode() ? toRenderView(this)->frameView()->visi bleHeight() : toRenderView(this)->frameView()->visibleWidth(); 2847 return isHorizontalWritingMode() ? toRenderView(this)->frameView()->visi bleHeight() : toRenderView(this)->frameView()->visibleWidth();
2847 2848
2848 // We need to stop here, since we don't want to increase the height of the t able 2849 // We need to stop here, since we don't want to increase the height of the t able
2849 // artificially. We're going to rely on this cell getting expanded to some new 2850 // artificially. We're going to rely on this cell getting expanded to some new
2850 // height, and then when we lay out again we'll use the calculation below. 2851 // height, and then when we lay out again we'll use the calculation below.
(...skipping 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after
4667 4668
4668 // We need the old border box size only when the box has background or b ox decorations. 4669 // We need the old border box size only when the box has background or b ox decorations.
4669 if (!style()->hasBackground() && !style()->hasBoxDecorations()) 4670 if (!style()->hasBackground() && !style()->hasBoxDecorations())
4670 return; 4671 return;
4671 } 4672 }
4672 4673
4673 ensureRareData().m_previousBorderBoxSize = size(); 4674 ensureRareData().m_previousBorderBoxSize = size();
4674 } 4675 }
4675 4676
4676 } // namespace WebCore 4677 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/replaced/available-height-for-content-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698