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

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..bac651832a4187b9e055875d00daa68fd69a08e8 100644
--- a/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp
@@ -50,18 +50,22 @@ 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));
+ if (paintInfo.cullRect().m_rect.y() > paginationOffset.y()) {
+ // TODO(crbug.com/638981): Is the first conversion to int intentional?
Stephen Chennney 2016/08/22 17:46:10 I suspect so. Tables are still laid out at int res
Xianzhu 2016/08/22 18:14:38 Done.
+ 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());
+ // TODO(crbug.com/638981): Is the conversion to int (in LayoutPoint(0, ...)) intentional?
Xianzhu 2016/08/22 18:14:38 Removed.
+ LayoutPoint nestedOffset = paginationOffset + LayoutPoint(0, m_layoutTableSection.offsetForRepeatingHeader().toInt());
if (itemToPaint == PaintCollapsedBorders)
paintCollapsedSectionBorders(paintInfo, nestedOffset, currentBorderValue);
else
paintSection(paintInfo, nestedOffset);
- paginationOffset.move(0, pageHeight);
+ // TODO(crbug.com/638981): Is the conversion to int (in move(0, ...)) intentional?
Xianzhu 2016/08/22 18:14:38 Removed.
+ paginationOffset.move(0, pageHeight.toInt());
}
}

Powered by Google App Engine
This is Rietveld 408576698