diff options
Diffstat (limited to 'Source/WebCore/rendering/RenderTable.cpp')
-rw-r--r-- | Source/WebCore/rendering/RenderTable.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/WebCore/rendering/RenderTable.cpp b/Source/WebCore/rendering/RenderTable.cpp index ab3187794..64337bd5e 100644 --- a/Source/WebCore/rendering/RenderTable.cpp +++ b/Source/WebCore/rendering/RenderTable.cpp @@ -273,7 +273,8 @@ LayoutUnit RenderTable::convertStyleLogicalWidthToComputedWidth(const Length& st bool isCSSTable = !node() || !node()->hasTagName(tableTag); if (isCSSTable && styleLogicalWidth.isFixed() && styleLogicalWidth.isPositive()) { recalcBordersInRowDirection(); - borders = borderStart() + borderEnd() + (collapseBorders() ? ZERO_LAYOUT_UNIT : paddingStart() + paddingEnd()); + if (style()->boxSizing() == CONTENT_BOX) + borders = borderStart() + borderEnd() + (collapseBorders() ? ZERO_LAYOUT_UNIT : paddingStart() + paddingEnd()); } return minimumValueForLength(styleLogicalWidth, availableWidth, view()) + borders; } @@ -397,7 +398,10 @@ void RenderTable::layout() LayoutUnit computedLogicalHeight = 0; if (logicalHeightLength.isFixed()) { // HTML tables size as though CSS height includes border/padding, CSS tables do not. - LayoutUnit borders = node() && node()->hasTagName(tableTag) ? (borderAndPaddingBefore + borderAndPaddingAfter) : ZERO_LAYOUT_UNIT; + LayoutUnit borders = ZERO_LAYOUT_UNIT; + // FIXME: We cannot apply box-sizing: content-box on <table> which other browsers allow. + if ((node() && node()->hasTagName(tableTag)) || style()->boxSizing() == BORDER_BOX) + borders = borderAndPaddingBefore + borderAndPaddingAfter; computedLogicalHeight = logicalHeightLength.value() - borders; } else if (logicalHeightLength.isPercent()) computedLogicalHeight = computePercentageLogicalHeight(logicalHeightLength); |