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) 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 * | 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 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2174 // A positioned element that specified both top/bottom or that specifies hei
ght should be treated as though it has a height | 2174 // A positioned element that specified both top/bottom or that specifies hei
ght should be treated as though it has a height |
2175 // explicitly specified that can be used for any percentage computations. | 2175 // explicitly specified that can be used for any percentage computations. |
2176 // FIXME: We can't just check top/bottom here. | 2176 // FIXME: We can't just check top/bottom here. |
2177 // https://bugs.webkit.org/show_bug.cgi?id=46500 | 2177 // https://bugs.webkit.org/show_bug.cgi?id=46500 |
2178 bool isOutOfFlowPositionedWithSpecifiedHeight = cb->isOutOfFlowPositioned()
&& (!cbstyle->logicalHeight().isAuto() || (!cbstyle->top().isAuto() && !cbstyle-
>bottom().isAuto())); | 2178 bool isOutOfFlowPositionedWithSpecifiedHeight = cb->isOutOfFlowPositioned()
&& (!cbstyle->logicalHeight().isAuto() || (!cbstyle->top().isAuto() && !cbstyle-
>bottom().isAuto())); |
2179 | 2179 |
2180 bool includeBorderPadding = isTable(); | 2180 bool includeBorderPadding = isTable(); |
2181 | 2181 |
2182 if (isHorizontalWritingMode() != cb->isHorizontalWritingMode()) | 2182 if (isHorizontalWritingMode() != cb->isHorizontalWritingMode()) |
2183 availableHeight = cb->contentLogicalWidth(); | 2183 availableHeight = cb->contentLogicalWidth(); |
2184 else if (cb->isTableCell() && !skippedAutoHeightContainingBlock) { | 2184 else if (cb->isTableCell()) { |
2185 // Table cells violate what the CSS spec says to do with heights. Basica
lly we | 2185 if (!skippedAutoHeightContainingBlock) { |
2186 // don't care if the cell specified a height or not. We just always make
ourselves | 2186 // Table cells violate what the CSS spec says to do with heights. Ba
sically we |
2187 // be a percentage of the cell's current content height. | 2187 // don't care if the cell specified a height or not. We just always
make ourselves |
2188 if (!cb->hasOverrideHeight()) { | 2188 // be a percentage of the cell's current content height. |
2189 // Normally we would let the cell size intrinsically, but scrolling
overflow has to be | 2189 if (!cb->hasOverrideHeight()) { |
2190 // treated differently, since WinIE lets scrolled overflow regions s
hrink as needed. | 2190 // Normally we would let the cell size intrinsically, but scroll
ing overflow has to be |
2191 // While we can't get all cases right, we can at least detect when t
he cell has a specified | 2191 // treated differently, since WinIE lets scrolled overflow regio
ns shrink as needed. |
2192 // height or when the table has a specified height. In these cases w
e want to initially have | 2192 // While we can't get all cases right, we can at least detect wh
en the cell has a specified |
2193 // no size and allow the flexing of the table or the cell to its spe
cified height to cause us | 2193 // height or when the table has a specified height. In these cas
es we want to initially have |
2194 // to grow to fill the space. This could end up being wrong in some
cases, but it is | 2194 // no size and allow the flexing of the table or the cell to its
specified height to cause us |
2195 // preferable to the alternative (sizing intrinsically and making th
e row end up too big). | 2195 // to grow to fill the space. This could end up being wrong in s
ome cases, but it is |
2196 RenderTableCell* cell = toRenderTableCell(cb); | 2196 // preferable to the alternative (sizing intrinsically and makin
g the row end up too big). |
2197 if (scrollsOverflowY() && (!cell->style()->logicalHeight().isAuto()
|| !cell->table()->style()->logicalHeight().isAuto())) | 2197 RenderTableCell* cell = toRenderTableCell(cb); |
2198 return 0; | 2198 if (scrollsOverflowY() && (!cell->style()->logicalHeight().isAut
o() || !cell->table()->style()->logicalHeight().isAuto())) |
2199 return -1; | 2199 return 0; |
| 2200 return -1; |
| 2201 } |
| 2202 availableHeight = cb->overrideLogicalContentHeight(); |
| 2203 includeBorderPadding = true; |
2200 } | 2204 } |
2201 availableHeight = cb->overrideLogicalContentHeight(); | |
2202 includeBorderPadding = true; | |
2203 } else if (cbstyle->logicalHeight().isFixed()) { | 2205 } else if (cbstyle->logicalHeight().isFixed()) { |
2204 LayoutUnit contentBoxHeightWithScrollbar = cb->adjustContentBoxLogicalHe
ightForBoxSizing(cbstyle->logicalHeight().value()); | 2206 LayoutUnit contentBoxHeightWithScrollbar = cb->adjustContentBoxLogicalHe
ightForBoxSizing(cbstyle->logicalHeight().value()); |
2205 availableHeight = max<LayoutUnit>(0, contentBoxHeightWithScrollbar - cb-
>scrollbarLogicalHeight()); | 2207 availableHeight = max<LayoutUnit>(0, contentBoxHeightWithScrollbar - cb-
>scrollbarLogicalHeight()); |
2206 } else if (cbstyle->logicalHeight().isPercent() && !isOutOfFlowPositionedWit
hSpecifiedHeight) { | 2208 } else if (cbstyle->logicalHeight().isPercent() && !isOutOfFlowPositionedWit
hSpecifiedHeight) { |
2207 // We need to recur and compute the percentage height for our containing
block. | 2209 // We need to recur and compute the percentage height for our containing
block. |
2208 LayoutUnit heightWithScrollbar = cb->computePercentageLogicalHeight(cbst
yle->logicalHeight()); | 2210 LayoutUnit heightWithScrollbar = cb->computePercentageLogicalHeight(cbst
yle->logicalHeight()); |
2209 if (heightWithScrollbar != -1) { | 2211 if (heightWithScrollbar != -1) { |
2210 LayoutUnit contentBoxHeightWithScrollbar = cb->adjustContentBoxLogic
alHeightForBoxSizing(heightWithScrollbar); | 2212 LayoutUnit contentBoxHeightWithScrollbar = cb->adjustContentBoxLogic
alHeightForBoxSizing(heightWithScrollbar); |
2211 availableHeight = max<LayoutUnit>(0, contentBoxHeightWithScrollbar -
cb->scrollbarLogicalHeight()); | 2213 availableHeight = max<LayoutUnit>(0, contentBoxHeightWithScrollbar -
cb->scrollbarLogicalHeight()); |
2212 } | 2214 } |
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4084 } | 4086 } |
4085 | 4087 |
4086 if (didSplitParentAnonymousBoxes) | 4088 if (didSplitParentAnonymousBoxes) |
4087 markBoxForRelayoutAfterSplit(this); | 4089 markBoxForRelayoutAfterSplit(this); |
4088 | 4090 |
4089 ASSERT(beforeChild->parent() == this); | 4091 ASSERT(beforeChild->parent() == this); |
4090 return beforeChild; | 4092 return beforeChild; |
4091 } | 4093 } |
4092 | 4094 |
4093 } // namespace WebCore | 4095 } // namespace WebCore |
OLD | NEW |