Index: third_party/WebKit/Source/core/layout/LayoutTable.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp |
index 7e781b9589895d5fe22b902de59437fa6c56b2f3..056550b464952e3f1eeb169dd389251685fcc39d 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp |
@@ -361,7 +361,7 @@ void LayoutTable::updateLogicalWidth() { |
// length and computes its actual value. |
LayoutUnit LayoutTable::convertStyleLogicalWidthToComputedWidth( |
const Length& styleLogicalWidth, |
- LayoutUnit availableWidth) { |
+ LayoutUnit availableWidth) const { |
if (styleLogicalWidth.isIntrinsic()) |
return computeIntrinsicLogicalWidthUsing( |
styleLogicalWidth, availableWidth, |
@@ -382,7 +382,7 @@ LayoutUnit LayoutTable::convertStyleLogicalWidthToComputedWidth( |
} |
LayoutUnit LayoutTable::convertStyleLogicalHeightToComputedHeight( |
- const Length& styleLogicalHeight) { |
+ const Length& styleLogicalHeight) const { |
LayoutUnit borderAndPaddingBefore = |
borderBefore() + (collapseBorders() ? LayoutUnit() : paddingBefore()); |
LayoutUnit borderAndPaddingAfter = |
@@ -455,6 +455,38 @@ void LayoutTable::layoutSection(LayoutTableSection& section, |
setLogicalHeight(logicalHeight() + sectionLogicalHeight); |
} |
+LayoutUnit LayoutTable::logicalHeightFromStyle() const { |
+ LayoutUnit computedLogicalHeight; |
+ Length logicalHeightLength = style()->logicalHeight(); |
+ if (logicalHeightLength.isIntrinsic() || |
+ (logicalHeightLength.isSpecified() && logicalHeightLength.isPositive())) { |
+ computedLogicalHeight = |
+ convertStyleLogicalHeightToComputedHeight(logicalHeightLength); |
+ } |
+ |
+ Length logicalMaxHeightLength = style()->logicalMaxHeight(); |
+ if (logicalMaxHeightLength.isIntrinsic() || |
+ (logicalMaxHeightLength.isSpecified() && |
+ !logicalMaxHeightLength.isNegative())) { |
+ LayoutUnit computedMaxLogicalHeight = |
+ convertStyleLogicalHeightToComputedHeight(logicalMaxHeightLength); |
+ computedLogicalHeight = |
+ std::min(computedLogicalHeight, computedMaxLogicalHeight); |
+ } |
+ |
+ Length logicalMinHeightLength = style()->logicalMinHeight(); |
+ if (logicalMinHeightLength.isIntrinsic() || |
+ (logicalMinHeightLength.isSpecified() && |
+ !logicalMinHeightLength.isNegative())) { |
+ LayoutUnit computedMinLogicalHeight = |
+ convertStyleLogicalHeightToComputedHeight(logicalMinHeightLength); |
+ computedLogicalHeight = |
+ std::max(computedLogicalHeight, computedMinLogicalHeight); |
+ } |
+ |
+ return computedLogicalHeight; |
+} |
+ |
void LayoutTable::distributeExtraLogicalHeight(int extraLogicalHeight) { |
if (extraLogicalHeight <= 0) |
return; |
@@ -613,34 +645,7 @@ void LayoutTable::layout() { |
setLogicalHeight(tableBoxLogicalTop + borderAndPaddingBefore); |
- LayoutUnit computedLogicalHeight; |
- |
- Length logicalHeightLength = style()->logicalHeight(); |
- if (logicalHeightLength.isIntrinsic() || |
- (logicalHeightLength.isSpecified() && logicalHeightLength.isPositive())) |
- computedLogicalHeight = |
- convertStyleLogicalHeightToComputedHeight(logicalHeightLength); |
- |
- Length logicalMaxHeightLength = style()->logicalMaxHeight(); |
- if (logicalMaxHeightLength.isIntrinsic() || |
- (logicalMaxHeightLength.isSpecified() && |
- !logicalMaxHeightLength.isNegative())) { |
- LayoutUnit computedMaxLogicalHeight = |
- convertStyleLogicalHeightToComputedHeight(logicalMaxHeightLength); |
- computedLogicalHeight = |
- std::min(computedLogicalHeight, computedMaxLogicalHeight); |
- } |
- |
- Length logicalMinHeightLength = style()->logicalMinHeight(); |
- if (logicalMinHeightLength.isIntrinsic() || |
- (logicalMinHeightLength.isSpecified() && |
- !logicalMinHeightLength.isNegative())) { |
- LayoutUnit computedMinLogicalHeight = |
- convertStyleLogicalHeightToComputedHeight(logicalMinHeightLength); |
- computedLogicalHeight = |
- std::max(computedLogicalHeight, computedMinLogicalHeight); |
- } |
- |
+ LayoutUnit computedLogicalHeight = logicalHeightFromStyle(); |
LayoutUnit totalSectionLogicalHeight; |
if (topSection) { |
totalSectionLogicalHeight = |