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

Unified Diff: Source/WebCore/rendering/RenderTable.cpp

Issue 13674002: Support intrinsic values for height, min-height and max-height (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: CSS table tests Created 7 years, 8 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 | « Source/WebCore/rendering/RenderReplaced.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderTable.cpp
diff --git a/Source/WebCore/rendering/RenderTable.cpp b/Source/WebCore/rendering/RenderTable.cpp
index 48e925780e4af28b28b7be6862a250c39fb47851..0e461912546a20be8df137f33b9028e62f8bc99d 100644
--- a/Source/WebCore/rendering/RenderTable.cpp
+++ b/Source/WebCore/rendering/RenderTable.cpp
@@ -327,21 +327,24 @@ LayoutUnit RenderTable::convertStyleLogicalWidthToComputedWidth(const Length& st
LayoutUnit RenderTable::convertStyleLogicalHeightToComputedHeight(const Length& styleLogicalHeight)
{
+ LayoutUnit borderAndPaddingBefore = borderBefore() + (collapseBorders() ? LayoutUnit() : paddingBefore());
+ LayoutUnit borderAndPaddingAfter = borderAfter() + (collapseBorders() ? LayoutUnit() : paddingAfter());
+ LayoutUnit borderAndPadding = borderAndPaddingBefore + borderAndPaddingAfter;
LayoutUnit computedLogicalHeight = 0;
if (styleLogicalHeight.isFixed()) {
// HTML tables size as though CSS height includes border/padding, CSS tables do not.
LayoutUnit borders = LayoutUnit();
// FIXME: We cannot apply box-sizing: content-box on <table> which other browsers allow.
if ((node() && node()->hasTagName(tableTag)) || style()->boxSizing() == BORDER_BOX) {
- LayoutUnit borderAndPaddingBefore = borderBefore() + (collapseBorders() ? LayoutUnit() : paddingBefore());
- LayoutUnit borderAndPaddingAfter = borderAfter() + (collapseBorders() ? LayoutUnit() : paddingAfter());
- borders = borderAndPaddingBefore + borderAndPaddingAfter;
+ borders = borderAndPadding;
}
computedLogicalHeight = styleLogicalHeight.value() - borders;
} else if (styleLogicalHeight.isPercent())
computedLogicalHeight = computePercentageLogicalHeight(styleLogicalHeight);
else if (styleLogicalHeight.isViewportPercentage())
computedLogicalHeight = minimumValueForLength(styleLogicalHeight, 0, view());
+ else if (styleLogicalHeight.isIntrinsic())
+ computedLogicalHeight = computeIntrinsicLogicalContentHeightUsing(styleLogicalHeight, logicalHeight() - borderAndPadding, borderAndPadding);
else
ASSERT_NOT_REACHED();
return max<LayoutUnit>(0, computedLogicalHeight);
@@ -476,17 +479,17 @@ void RenderTable::layout()
LayoutUnit computedLogicalHeight = 0;
Length logicalHeightLength = style()->logicalHeight();
- if (logicalHeightLength.isSpecified() && logicalHeightLength.isPositive())
+ if (logicalHeightLength.isIntrinsic() || (logicalHeightLength.isSpecified() && logicalHeightLength.isPositive()))
computedLogicalHeight = convertStyleLogicalHeightToComputedHeight(logicalHeightLength);
Length logicalMaxHeightLength = style()->logicalMaxHeight();
- if (logicalMaxHeightLength.isSpecified() && !logicalMaxHeightLength.isNegative()) {
+ if (logicalMaxHeightLength.isIntrinsic() || (logicalMaxHeightLength.isSpecified() && !logicalMaxHeightLength.isNegative())) {
LayoutUnit computedMaxLogicalHeight = convertStyleLogicalHeightToComputedHeight(logicalMaxHeightLength);
computedLogicalHeight = min(computedLogicalHeight, computedMaxLogicalHeight);
}
Length logicalMinHeightLength = style()->logicalMinHeight();
- if (logicalMinHeightLength.isSpecified() && !logicalMinHeightLength.isNegative()) {
+ if (logicalMinHeightLength.isIntrinsic() || (logicalMinHeightLength.isSpecified() && !logicalMinHeightLength.isNegative())) {
LayoutUnit computedMinLogicalHeight = convertStyleLogicalHeightToComputedHeight(logicalMinHeightLength);
computedLogicalHeight = max(computedLogicalHeight, computedMinLogicalHeight);
}
« no previous file with comments | « Source/WebCore/rendering/RenderReplaced.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698