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

Unified Diff: Source/core/layout/LayoutBox.cpp

Issue 1028773002: Revert of Percent height content should respect the fixed height of its containing cell (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/platform/linux/fast/html/details-writing-mode-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBox.cpp
diff --git a/Source/core/layout/LayoutBox.cpp b/Source/core/layout/LayoutBox.cpp
index 15100875e7410759419d192af656838466cabcc7..6a39e052cca35e4350b0fb9779fff94a383c082c 100644
--- a/Source/core/layout/LayoutBox.cpp
+++ b/Source/core/layout/LayoutBox.cpp
@@ -2470,14 +2470,6 @@ LayoutUnit LayoutBox::computePercentageLogicalHeight(const Length& height) const
availableHeight = containingBlockChild->containingBlockLogicalWidthForContent();
} else if (hasOverrideContainingBlockLogicalHeight()) {
availableHeight = overrideContainingBlockContentLogicalHeight();
- } else if (cbstyle.logicalHeight().isFixed()) {
- LayoutUnit contentBoxHeight = cb->adjustContentBoxLogicalHeightForBoxSizing(cbstyle.logicalHeight().value());
- availableHeight = std::max(LayoutUnit(), cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeight - cb->scrollbarLogicalHeight(), -1));
- if (cb->isTableCell()) {
- includeBorderPadding = true;
- // We're sizing content to the height from the cell's style so don't involve the intrinsic padding used to align the content.
- availableHeight -= cb->computedCSSPaddingBefore() + cb->computedCSSPaddingAfter() + cb->borderBefore() + cb->borderAfter();
- }
} else if (cb->isTableCell()) {
if (!skippedAutoHeightContainingBlock) {
// Table cells violate what the CSS spec says to do with heights. Basically we
@@ -2499,6 +2491,9 @@ LayoutUnit LayoutBox::computePercentageLogicalHeight(const Length& height) const
availableHeight = cb->overrideLogicalContentHeight();
includeBorderPadding = true;
}
+ } else if (cbstyle.logicalHeight().isFixed()) {
+ LayoutUnit contentBoxHeight = cb->adjustContentBoxLogicalHeightForBoxSizing(cbstyle.logicalHeight().value());
+ availableHeight = std::max(LayoutUnit(), cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeight - cb->scrollbarLogicalHeight(), -1));
} else if (cbstyle.logicalHeight().isPercent() && !isOutOfFlowPositionedWithSpecifiedHeight) {
// We need to recur and compute the percentage height for our containing block.
LayoutUnit heightWithScrollbar = cb->computePercentageLogicalHeight(cbstyle.logicalHeight());
@@ -2531,8 +2526,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);
}
« no previous file with comments | « LayoutTests/platform/linux/fast/html/details-writing-mode-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698