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

Unified Diff: third_party/WebKit/Source/core/layout/TableLayoutAlgorithmFixed.cpp

Issue 1656743002: Removing more implicit LayoutUnit construction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
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()) {

Powered by Google App Engine
This is Rietveld 408576698