| OLD | NEW |
| 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) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
| 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
| 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 1883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1894 LayoutUnit stretchedFlexHeight(-1); | 1894 LayoutUnit stretchedFlexHeight(-1); |
| 1895 if (isFlexItem()) | 1895 if (isFlexItem()) |
| 1896 stretchedFlexHeight = toLayoutFlexibleBox(parent())->childLogicalHeightF
orPercentageResolution(*this); | 1896 stretchedFlexHeight = toLayoutFlexibleBox(parent())->childLogicalHeightF
orPercentageResolution(*this); |
| 1897 | 1897 |
| 1898 if (stretchedFlexHeight != LayoutUnit(-1)) { | 1898 if (stretchedFlexHeight != LayoutUnit(-1)) { |
| 1899 availableHeight = stretchedFlexHeight; | 1899 availableHeight = stretchedFlexHeight; |
| 1900 } else if (isGridItem() && hasOverrideLogicalContentHeight()) { | 1900 } else if (isGridItem() && hasOverrideLogicalContentHeight()) { |
| 1901 availableHeight = overrideLogicalContentHeight(); | 1901 availableHeight = overrideLogicalContentHeight(); |
| 1902 } else if (style.logicalHeight().isFixed()) { | 1902 } else if (style.logicalHeight().isFixed()) { |
| 1903 LayoutUnit contentBoxHeight = adjustContentBoxLogicalHeightForBoxSizing(
style.logicalHeight().value()); | 1903 LayoutUnit contentBoxHeight = adjustContentBoxLogicalHeightForBoxSizing(
style.logicalHeight().value()); |
| 1904 availableHeight = constrainContentBoxLogicalHeightByMinMax( | 1904 availableHeight = std::max(LayoutUnit(), constrainContentBoxLogicalHeigh
tByMinMax(contentBoxHeight - scrollbarLogicalHeight(), LayoutUnit(-1))); |
| 1905 contentBoxHeight - scrollbarLogicalHeight(), LayoutUnit(-1)).clampNe
gativeToZero(); | |
| 1906 } else if (style.logicalHeight().hasPercent() && !isOutOfFlowPositionedWithS
pecifiedHeight) { | 1905 } else if (style.logicalHeight().hasPercent() && !isOutOfFlowPositionedWithS
pecifiedHeight) { |
| 1907 LayoutUnit heightWithScrollbar = computePercentageLogicalHeight(style.lo
gicalHeight()); | 1906 LayoutUnit heightWithScrollbar = computePercentageLogicalHeight(style.lo
gicalHeight()); |
| 1908 if (heightWithScrollbar != -1) { | 1907 if (heightWithScrollbar != -1) { |
| 1909 LayoutUnit contentBoxHeightWithScrollbar = adjustContentBoxLogicalHe
ightForBoxSizing(heightWithScrollbar); | 1908 LayoutUnit contentBoxHeightWithScrollbar = adjustContentBoxLogicalHe
ightForBoxSizing(heightWithScrollbar); |
| 1910 // We need to adjust for min/max height because this method does not | 1909 // We need to adjust for min/max height because this method does not |
| 1911 // handle the min/max of the current block, its caller does. So the | 1910 // handle the min/max of the current block, its caller does. So the |
| 1912 // return value from the recursive call will not have been adjusted | 1911 // return value from the recursive call will not have been adjusted |
| 1913 // yet. | 1912 // yet. |
| 1914 LayoutUnit contentBoxHeight = constrainContentBoxLogicalHeightByMinM
ax(contentBoxHeightWithScrollbar - scrollbarLogicalHeight(), LayoutUnit(-1)); | 1913 LayoutUnit contentBoxHeight = constrainContentBoxLogicalHeightByMinM
ax(contentBoxHeightWithScrollbar - scrollbarLogicalHeight(), LayoutUnit(-1)); |
| 1915 availableHeight = std::max(LayoutUnit(), contentBoxHeight); | 1914 availableHeight = std::max(LayoutUnit(), contentBoxHeight); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1926 | 1925 |
| 1927 return availableHeight; | 1926 return availableHeight; |
| 1928 } | 1927 } |
| 1929 | 1928 |
| 1930 bool LayoutBlock::hasDefiniteLogicalHeight() const | 1929 bool LayoutBlock::hasDefiniteLogicalHeight() const |
| 1931 { | 1930 { |
| 1932 return availableLogicalHeightForPercentageComputation() != LayoutUnit(-1); | 1931 return availableLogicalHeightForPercentageComputation() != LayoutUnit(-1); |
| 1933 } | 1932 } |
| 1934 | 1933 |
| 1935 } // namespace blink | 1934 } // namespace blink |
| OLD | NEW |