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

Unified Diff: third_party/WebKit/Source/core/paint/TableSectionPainter.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/paint/TableSectionPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp b/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp
index d7388880d25be6c67036f2a9ac07a39b066179bb..35495ca66b963468a8527f914c1d74958ceca7eb 100644
--- a/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp
@@ -50,18 +50,18 @@ void TableSectionPainter::paintRepeatingHeaderGroup(const PaintInfo& paintInfo,
if (LayoutTableRow* row = m_layoutTableSection.firstRow())
headerGroupOffset += m_layoutTableSection.paginationStrutForRow(row, table->pageLogicalOffset());
LayoutUnit offsetToNextPage = pageHeight - intMod(headerGroupOffset, pageHeight);
- paginationOffset.move(0, offsetToNextPage);
+ paginationOffset.move(0, offsetToNextPage.toInt());
// Now move paginationOffset to the top of the page the cull rect starts on.
if (paintInfo.cullRect().m_rect.y() > paginationOffset.y())
- paginationOffset.move(0, pageHeight * static_cast<int>((paintInfo.cullRect().m_rect.y() - paginationOffset.y()) / pageHeight));
+ paginationOffset.move(0, pageHeight.toInt() * ((paintInfo.cullRect().m_rect.y() - paginationOffset.y()) / pageHeight).toInt());
LayoutUnit bottomBound = std::min(LayoutUnit(paintInfo.cullRect().m_rect.maxY()), paintOffset.y() + table->logicalHeight());
while (paginationOffset.y() < bottomBound) {
- LayoutPoint nestedOffset = paginationOffset + LayoutPoint(0, m_layoutTableSection.offsetForRepeatingHeader());
+ LayoutPoint nestedOffset = paginationOffset + LayoutPoint(0, m_layoutTableSection.offsetForRepeatingHeader().toInt());
if (itemToPaint == PaintCollapsedBorders)
paintCollapsedSectionBorders(paintInfo, nestedOffset, currentBorderValue);
else
paintSection(paintInfo, nestedOffset);
- paginationOffset.move(0, pageHeight);
+ paginationOffset.move(0, pageHeight.toInt());
}
}

Powered by Google App Engine
This is Rietveld 408576698