Index: third_party/WebKit/Source/core/layout/TableLayoutAlgorithmFixed.cpp |
diff --git a/third_party/WebKit/Source/core/layout/TableLayoutAlgorithmFixed.cpp b/third_party/WebKit/Source/core/layout/TableLayoutAlgorithmFixed.cpp |
index d2c9b6a69755475794d3ae0e5c9c741bcdf1038d..9b741577f83baaed5b2a4b1fd2807b5361a86e83 100644 |
--- a/third_party/WebKit/Source/core/layout/TableLayoutAlgorithmFixed.cpp |
+++ b/third_party/WebKit/Source/core/layout/TableLayoutAlgorithmFixed.cpp |
@@ -177,14 +177,15 @@ int TableLayoutAlgorithmFixed::calcWidthArray() |
void TableLayoutAlgorithmFixed::computeIntrinsicLogicalWidths(LayoutUnit& minWidth, LayoutUnit& maxWidth) |
{ |
- minWidth = maxWidth = calcWidthArray(); |
+ minWidth = maxWidth = LayoutUnit(calcWidthArray()); |
} |
void TableLayoutAlgorithmFixed::applyPreferredLogicalWidthQuirks(LayoutUnit& minWidth, LayoutUnit& maxWidth) const |
{ |
Length tableLogicalWidth = m_table->style()->logicalWidth(); |
- if (tableLogicalWidth.isFixed() && tableLogicalWidth.isPositive()) |
- minWidth = maxWidth = max<int>(minWidth, tableLogicalWidth.value() - m_table->bordersPaddingAndSpacingInRowDirection()); |
+ if (tableLogicalWidth.isFixed() && tableLogicalWidth.isPositive()) { |
+ minWidth = maxWidth = LayoutUnit(max(minWidth, LayoutUnit(tableLogicalWidth.value() - m_table->bordersPaddingAndSpacingInRowDirection())).floor()); |
+ } |
/* |
<table style="width:100%; background-color:red"><tr><td> |
@@ -199,7 +200,7 @@ void TableLayoutAlgorithmFixed::applyPreferredLogicalWidthQuirks(LayoutUnit& min |
// We can achieve this effect by making the maxwidth of fixed tables with percentage |
// widths be infinite. |
if (m_table->style()->logicalWidth().hasPercent() && maxWidth < tableMaxWidth) |
- maxWidth = tableMaxWidth; |
+ maxWidth = LayoutUnit(tableMaxWidth); |
} |
void TableLayoutAlgorithmFixed::layout() |
@@ -233,7 +234,7 @@ void TableLayoutAlgorithmFixed::layout() |
totalFixedWidth += calcWidth[i]; |
} else if (m_width[i].hasPercent()) { |
// TODO(alancutter): Make this work correctly for calc lengths. |
- calcWidth[i] = valueForLength(m_width[i], tableLogicalWidth); |
+ calcWidth[i] = valueForLength(m_width[i], LayoutUnit(tableLogicalWidth)); |
totalPercentWidth += calcWidth[i]; |
totalPercent += m_width[i].percent(); |
} else if (m_width[i].isAuto()) { |