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

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

Issue 462243002: Make logical height calculations on RenderView use unscaled FrameRect (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed up test Created 6 years, 4 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 | « LayoutTests/plugins/page-scale-does-not-affect-plugin-height-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 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after
1754 1754
1755 RenderBlock* cb = containingBlock(); 1755 RenderBlock* cb = containingBlock();
1756 if (cb->hasOverrideHeight()) 1756 if (cb->hasOverrideHeight())
1757 return cb->overrideLogicalContentHeight(); 1757 return cb->overrideLogicalContentHeight();
1758 1758
1759 RenderStyle* containingBlockStyle = cb->style(); 1759 RenderStyle* containingBlockStyle = cb->style();
1760 Length logicalHeightLength = containingBlockStyle->logicalHeight(); 1760 Length logicalHeightLength = containingBlockStyle->logicalHeight();
1761 1761
1762 // FIXME: For now just support fixed heights. Eventually should support per centage heights as well. 1762 // FIXME: For now just support fixed heights. Eventually should support per centage heights as well.
1763 if (!logicalHeightLength.isFixed()) { 1763 if (!logicalHeightLength.isFixed()) {
1764 LayoutUnit fillFallbackExtent = containingBlockStyle->isHorizontalWritin gMode() ? view()->frameView()->visibleHeight() : view()->frameView()->visibleWid th(); 1764 LayoutUnit fillFallbackExtent = containingBlockStyle->isHorizontalWritin gMode()
1765 ? view()->frameView()->unscaledVisibleContentSize().height()
1766 : view()->frameView()->unscaledVisibleContentSize().width();
1765 LayoutUnit fillAvailableExtent = containingBlock()->availableLogicalHeig ht(ExcludeMarginBorderPadding); 1767 LayoutUnit fillAvailableExtent = containingBlock()->availableLogicalHeig ht(ExcludeMarginBorderPadding);
1766 return std::min(fillAvailableExtent, fillFallbackExtent); 1768 return std::min(fillAvailableExtent, fillFallbackExtent);
1767 } 1769 }
1768 1770
1769 // Use the content box logical height as specified by the style. 1771 // Use the content box logical height as specified by the style.
1770 return cb->adjustContentBoxLogicalHeightForBoxSizing(logicalHeightLength.val ue()); 1772 return cb->adjustContentBoxLogicalHeightForBoxSizing(logicalHeightLength.val ue());
1771 } 1773 }
1772 1774
1773 void RenderBox::mapLocalToContainer(const RenderLayerModelObject* paintInvalidat ionContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wa sFixed, const PaintInvalidationState* paintInvalidationState) const 1775 void RenderBox::mapLocalToContainer(const RenderLayerModelObject* paintInvalidat ionContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wa sFixed, const PaintInvalidationState* paintInvalidationState) const
1774 { 1776 {
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
2841 2843
2842 LayoutUnit RenderBox::availableLogicalHeight(AvailableLogicalHeightType heightTy pe) const 2844 LayoutUnit RenderBox::availableLogicalHeight(AvailableLogicalHeightType heightTy pe) const
2843 { 2845 {
2844 // http://www.w3.org/TR/CSS2/visudet.html#propdef-height - We are interested in the content height. 2846 // http://www.w3.org/TR/CSS2/visudet.html#propdef-height - We are interested in the content height.
2845 return constrainContentBoxLogicalHeightByMinMax(availableLogicalHeightUsing( style()->logicalHeight(), heightType), -1); 2847 return constrainContentBoxLogicalHeightByMinMax(availableLogicalHeightUsing( style()->logicalHeight(), heightType), -1);
2846 } 2848 }
2847 2849
2848 LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h, AvailableLogi calHeightType heightType) const 2850 LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h, AvailableLogi calHeightType heightType) const
2849 { 2851 {
2850 if (isRenderView()) 2852 if (isRenderView())
2851 return isHorizontalWritingMode() ? toRenderView(this)->frameView()->visi bleHeight() : toRenderView(this)->frameView()->visibleWidth(); 2853 return isHorizontalWritingMode() ? toRenderView(this)->frameView()->unsc aledVisibleContentSize().height() : toRenderView(this)->frameView()->unscaledVis ibleContentSize().width();
2852 2854
2853 // We need to stop here, since we don't want to increase the height of the t able 2855 // We need to stop here, since we don't want to increase the height of the t able
2854 // artificially. We're going to rely on this cell getting expanded to some new 2856 // artificially. We're going to rely on this cell getting expanded to some new
2855 // height, and then when we lay out again we'll use the calculation below. 2857 // height, and then when we lay out again we'll use the calculation below.
2856 if (isTableCell() && (h.isAuto() || h.isPercent())) { 2858 if (isTableCell() && (h.isAuto() || h.isPercent())) {
2857 if (hasOverrideHeight()) 2859 if (hasOverrideHeight())
2858 return overrideLogicalContentHeight(); 2860 return overrideLogicalContentHeight();
2859 return logicalHeight() - borderAndPaddingLogicalHeight(); 2861 return logicalHeight() - borderAndPaddingLogicalHeight();
2860 } 2862 }
2861 2863
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after
4694 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) 4696 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style)
4695 { 4697 {
4696 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor); 4698 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor);
4697 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); 4699 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage();
4698 ASSERT(hasBackground == style.hasBackground()); 4700 ASSERT(hasBackground == style.hasBackground());
4699 hasBorder = style.hasBorder(); 4701 hasBorder = style.hasBorder();
4700 hasAppearance = style.hasAppearance(); 4702 hasAppearance = style.hasAppearance();
4701 } 4703 }
4702 4704
4703 } // namespace blink 4705 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/plugins/page-scale-does-not-affect-plugin-height-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698