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

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

Issue 1660863002: Force all LayoutUnit construction to be explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also fix LayoutRectTest.cpp Created 4 years, 10 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/TableLayoutAlgorithmAuto.cpp
diff --git a/third_party/WebKit/Source/core/layout/TableLayoutAlgorithmAuto.cpp b/third_party/WebKit/Source/core/layout/TableLayoutAlgorithmAuto.cpp
index 86b0d907ad1c477716379dfc73bda22ec0688ae5..f9b062f67255540bccc43fb1615a7a2b0ec19c0a 100644
--- a/third_party/WebKit/Source/core/layout/TableLayoutAlgorithmAuto.cpp
+++ b/third_party/WebKit/Source/core/layout/TableLayoutAlgorithmAuto.cpp
@@ -242,11 +242,11 @@ void TableLayoutAlgorithmAuto::computeIntrinsicLogicalWidths(LayoutUnit& minWidt
if (scaleColumns) {
maxNonPercent = maxNonPercent * 100 / std::max(remainingPercent, epsilon);
- maxWidth = std::max(maxWidth, LayoutUnit(std::min(maxNonPercent, static_cast<float>(tableMaxWidth)))).floor();
- maxWidth = std::max(maxWidth, LayoutUnit(std::min(maxPercent, static_cast<float>(tableMaxWidth)))).floor();
+ maxWidth = std::max(maxWidth, LayoutUnit(std::min(maxNonPercent, static_cast<float>(tableMaxWidth))));
+ maxWidth = std::max(maxWidth, LayoutUnit(std::min(maxPercent, static_cast<float>(tableMaxWidth))));
}
- maxWidth = std::max(maxWidth.floor(), spanMaxLogicalWidth);
+ maxWidth = LayoutUnit(std::max(maxWidth.floor(), spanMaxLogicalWidth));
}
void TableLayoutAlgorithmAuto::applyPreferredLogicalWidthQuirks(LayoutUnit& minWidth, LayoutUnit& maxWidth) const
@@ -259,11 +259,11 @@ void TableLayoutAlgorithmAuto::applyPreferredLogicalWidthQuirks(LayoutUnit& minW
// FIXME: This line looks REALLY suspicious as it could allow the minimum
// preferred logical width to be smaller than the table content. This has
// to be cross-checked against other browsers.
- minWidth = maxWidth = std::max<int>(minWidth.floor(), tableLogicalWidth.value());
+ minWidth = maxWidth = LayoutUnit(std::max<int>(minWidth.floor(), tableLogicalWidth.value()));
const Length& styleMaxLogicalWidth = m_table->style()->logicalMaxWidth();
if (styleMaxLogicalWidth.isFixed() && !styleMaxLogicalWidth.isNegative()) {
- minWidth = std::min<int>(minWidth.floor(), styleMaxLogicalWidth.value());
+ minWidth = LayoutUnit(std::min<int>(minWidth.floor(), styleMaxLogicalWidth.value()));
minWidth = std::max(minWidth, minContentWidth);
maxWidth = minWidth;
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutVTTCue.cpp ('k') | third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698