| Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
|
| index 681374d984ae9a33d8fa017e12bdc7b534958fdf..eac327c5497d6b9198d4881793a00c6cee4e4c00 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
|
| @@ -2745,12 +2745,6 @@ LayoutUnit LayoutBox::computePercentageLogicalHeight(const Length& height) const
|
| availableHeight = overrideContainingBlockContentLogicalHeight();
|
| } else if (cb->isGridItem() && cb->hasOverrideLogicalContentHeight()) {
|
| availableHeight = cb->overrideLogicalContentHeight();
|
| - } else if (cbstyle.logicalHeight().isFixed()) {
|
| - LayoutUnit contentBoxHeight = cb->adjustContentBoxLogicalHeightForBoxSizing(cbstyle.logicalHeight().value());
|
| - availableHeight = cb->constrainContentBoxLogicalHeightByMinMax(
|
| - contentBoxHeight - cb->scrollbarLogicalHeight(), LayoutUnit(-1)).clampNegativeToZero();
|
| - if (cb->isTableCell())
|
| - includeBorderPadding = true;
|
| } else if (cb->isTableCell()) {
|
| if (!skippedAutoHeightContainingBlock) {
|
| // Table cells violate what the CSS spec says to do with heights. Basically we
|
| @@ -2772,6 +2766,9 @@ LayoutUnit LayoutBox::computePercentageLogicalHeight(const Length& height) const
|
| availableHeight = cb->overrideLogicalContentHeight();
|
| includeBorderPadding = true;
|
| }
|
| + } else if (cbstyle.logicalHeight().isFixed()) {
|
| + LayoutUnit contentBoxHeight = cb->adjustContentBoxLogicalHeightForBoxSizing(LayoutUnit(cbstyle.logicalHeight().value()));
|
| + availableHeight = std::max(LayoutUnit(), cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeight - cb->scrollbarLogicalHeight(), LayoutUnit(-1)));
|
| } else if (cbstyle.logicalHeight().hasPercent() && !isOutOfFlowPositionedWithSpecifiedHeight) {
|
| // We need to recur and compute the percentage height for our containing block.
|
| LayoutUnit heightWithScrollbar = cb->computePercentageLogicalHeight(cbstyle.logicalHeight());
|
| @@ -2804,8 +2801,10 @@ LayoutUnit LayoutBox::computePercentageLogicalHeight(const Length& height) const
|
|
|
| LayoutUnit result = valueForLength(height, availableHeight);
|
| if (includeBorderPadding) {
|
| - // TODO(rhogan) crbug.com/467378: Doing this for content inside tables cells is wrong, it should fill
|
| - // whatever height the cell makes available.
|
| + // FIXME: Table cells should default to box-sizing: border-box so we can avoid this hack.
|
| + // It is necessary to use the border-box to match WinIE's broken
|
| + // box model. This is essential for sizing inside
|
| + // table cells using percentage heights.
|
| result -= borderAndPaddingLogicalHeight();
|
| return std::max(LayoutUnit(), result);
|
| }
|
|
|