|
Lines 1175-1180
IntRect RenderBox::clipRect(const IntPoint& location)
a/Source/WebCore/rendering/RenderBox.cpp_sec1
|
| 1175 |
return clipRect; |
1175 |
return clipRect; |
| 1176 |
} |
1176 |
} |
| 1177 |
|
1177 |
|
|
|
1178 |
static bool avoidSqueezingWidth(RenderBlock* cb) |
| 1179 |
{ |
| 1180 |
while (cb && !cb->isRenderView()) { |
| 1181 |
if (!cb->style()->logicalWidth().isAuto() && !cb->style()->logicalWidth().isPercent()) |
| 1182 |
return false; |
| 1183 |
cb = cb->containingBlock(); |
| 1184 |
} |
| 1185 |
return true; |
| 1186 |
} |
| 1187 |
|
| 1188 |
static bool avoidSqueezingHeight(RenderBlock* cb) |
| 1189 |
{ |
| 1190 |
while (cb && !cb->isRenderView()) { |
| 1191 |
if (!cb->style()->logicalHeight().isAuto() && !cb->style()->logicalHeight().isPercent()) |
| 1192 |
return false; |
| 1193 |
cb = cb->containingBlock(); |
| 1194 |
} |
| 1195 |
return true; |
| 1196 |
} |
| 1197 |
|
| 1198 |
int RenderBox::containingBlockReplacedLogicalWidthForContent() const |
| 1199 |
{ |
| 1200 |
RenderBlock* cb = containingBlock(); |
| 1201 |
if (cb->isTableCell()) { |
| 1202 |
// Don't let table cells squeeze percent-height replaced elements |
| 1203 |
// <http://bugs.webkit.org/show_bug.cgi?id=29447> |
| 1204 |
if (avoidSqueezingWidth(cb)) |
| 1205 |
return max(shrinkToAvoidFloats() ? cb->availableLogicalWidthForLine(y(), false) : cb->availableLogicalWidth(), intrinsicLogicalWidth()); |
| 1206 |
} |
| 1207 |
return containingBlockLogicalWidthForContent(); |
| 1208 |
} |
| 1209 |
|
| 1178 |
int RenderBox::containingBlockLogicalWidthForContent() const |
1210 |
int RenderBox::containingBlockLogicalWidthForContent() const |
| 1179 |
{ |
1211 |
{ |
| 1180 |
RenderBlock* cb = containingBlock(); |
1212 |
RenderBlock* cb = containingBlock(); |
|
Lines 1954-1960
int RenderBox::computeReplacedLogicalWidthUsing(Length logicalWidth) const
a/Source/WebCore/rendering/RenderBox.cpp_sec2
|
| 1954 |
// FIXME: containingBlockLogicalWidthForContent() is wrong if the replaced element's block-flow is perpendicular to the |
1986 |
// FIXME: containingBlockLogicalWidthForContent() is wrong if the replaced element's block-flow is perpendicular to the |
| 1955 |
// containing block's block-flow. |
1987 |
// containing block's block-flow. |
| 1956 |
// https://bugs.webkit.org/show_bug.cgi?id=46496 |
1988 |
// https://bugs.webkit.org/show_bug.cgi?id=46496 |
| 1957 |
const int cw = isPositioned() ? containingBlockLogicalWidthForPositioned(toRenderBoxModelObject(container())) : containingBlockLogicalWidthForContent(); |
1989 |
const int cw = isPositioned() ? containingBlockLogicalWidthForPositioned(toRenderBoxModelObject(container())) : containingBlockReplacedLogicalWidthForContent(); |
| 1958 |
if (cw > 0) |
1990 |
if (cw > 0) |
| 1959 |
return computeContentBoxLogicalWidth(logicalWidth.calcMinValue(cw)); |
1991 |
return computeContentBoxLogicalWidth(logicalWidth.calcMinValue(cw)); |
| 1960 |
} |
1992 |
} |
|
Lines 2014-2027
int RenderBox::computeReplacedLogicalHeightUsing(Length logicalHeight) const
a/Source/WebCore/rendering/RenderBox.cpp_sec3
|
| 2014 |
// table cells using percentage heights. |
2046 |
// table cells using percentage heights. |
| 2015 |
// FIXME: This needs to be made block-flow-aware. If the cell and image are perpendicular block-flows, this isn't right. |
2047 |
// FIXME: This needs to be made block-flow-aware. If the cell and image are perpendicular block-flows, this isn't right. |
| 2016 |
// https://bugs.webkit.org/show_bug.cgi?id=46997 |
2048 |
// https://bugs.webkit.org/show_bug.cgi?id=46997 |
| 2017 |
while (cb && !cb->isRenderView() && (cb->style()->logicalHeight().isAuto() || cb->style()->logicalHeight().isPercent())) { |
2049 |
if (cb->isTableCell() && avoidSqueezingHeight(toRenderBlock(cb))) { |
| 2018 |
if (cb->isTableCell()) { |
2050 |
// Don't let table cells squeeze percent-height replaced elements |
| 2019 |
// Don't let table cells squeeze percent-height replaced elements |
2051 |
// <http://bugs.webkit.org/show_bug.cgi?id=15359> |
| 2020 |
// <http://bugs.webkit.org/show_bug.cgi?id=15359> |
2052 |
availableHeight = max(availableHeight, intrinsicLogicalHeight()); |
| 2021 |
availableHeight = max(availableHeight, intrinsicLogicalHeight()); |
2053 |
return logicalHeight.calcValue(availableHeight - borderAndPaddingLogicalHeight()); |
| 2022 |
return logicalHeight.calcValue(availableHeight - borderAndPaddingLogicalHeight()); |
|
|
| 2023 |
} |
| 2024 |
cb = cb->containingBlock(); |
| 2025 |
} |
2054 |
} |
| 2026 |
} |
2055 |
} |
| 2027 |
return computeContentBoxLogicalHeight(logicalHeight.calcValue(availableHeight)); |
2056 |
return computeContentBoxLogicalHeight(logicalHeight.calcValue(availableHeight)); |