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

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

Issue 2261663002: Disallow cast/implicit conversion from LayoutUnit to int/unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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 caa76258a55733d2fc5a54b0bebd953a1ede6d11..3686ec9a47dd8eb307750a6652366149d4212e08 100644
--- a/third_party/WebKit/Source/core/layout/TableLayoutAlgorithmFixed.cpp
+++ b/third_party/WebKit/Source/core/layout/TableLayoutAlgorithmFixed.cpp
@@ -148,7 +148,7 @@ int TableLayoutAlgorithmFixed::calcWidthArray()
// FIXME: Support other length types. If the width is non-auto, it should probably just use
// LayoutBox::computeLogicalWidthUsing to compute the width.
if (logicalWidth.isFixed() && logicalWidth.isPositive()) {
- fixedBorderBoxLogicalWidth = cell->adjustBorderBoxLogicalWidthForBoxSizing(logicalWidth.value());
+ fixedBorderBoxLogicalWidth = cell->adjustBorderBoxLogicalWidthForBoxSizing(logicalWidth.value()).toInt();
logicalWidth.setValue(fixedBorderBoxLogicalWidth);
}
@@ -205,7 +205,7 @@ void TableLayoutAlgorithmFixed::applyPreferredLogicalWidthQuirks(LayoutUnit& min
void TableLayoutAlgorithmFixed::layout()
{
- int tableLogicalWidth = m_table->logicalWidth() - m_table->bordersPaddingAndSpacingInRowDirection();
+ int tableLogicalWidth = (m_table->logicalWidth() - m_table->bordersPaddingAndSpacingInRowDirection()).toInt();
unsigned nEffCols = m_table->numEffectiveColumns();
// FIXME: It is possible to be called without having properly updated our internal representation.
@@ -234,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], LayoutUnit(tableLogicalWidth));
+ calcWidth[i] = valueForLength(m_width[i], LayoutUnit(tableLogicalWidth)).toInt();
totalPercentWidth += calcWidth[i];
totalPercent += m_width[i].percent();
} else if (m_width[i].isAuto()) {

Powered by Google App Engine
This is Rietveld 408576698