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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.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/LayoutBlockFlowLine.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
index 9588dbe569d398a9a76147c973944dbbc5ed46a8..292d73be758c28928f81a90c4dd955a22817987f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
@@ -103,7 +103,7 @@ public:
if (r->m_lineLayoutItem.style()->whiteSpace() != PRE) {
InlineTextBox* textBox = toInlineTextBox(r->m_box);
RELEASE_ASSERT(m_totalOpportunities);
- int expansion = (availableLogicalWidth - totalLogicalWidth) * opportunitiesInRun / m_totalOpportunities;
+ int expansion = ((availableLogicalWidth - totalLogicalWidth) * opportunitiesInRun / m_totalOpportunities).toInt();
textBox->setExpansion(expansion);
totalLogicalWidth += expansion;
}
@@ -781,7 +781,7 @@ void LayoutBlockFlow::layoutRunsAndFloats(LineLayoutState& layoutState)
// Before restarting the layout loop with a new logicalHeight, remove all floats that were added and reset the resolver.
inline const InlineIterator& LayoutBlockFlow::restartLayoutRunsAndFloatsInRange(LayoutUnit oldLogicalHeight, LayoutUnit newLogicalHeight, FloatingObject* lastFloatFromPreviousLine, InlineBidiResolver& resolver, const InlineIterator& oldEnd)
{
- removeFloatingObjectsBelow(lastFloatFromPreviousLine, oldLogicalHeight);
+ removeFloatingObjectsBelow(lastFloatFromPreviousLine, oldLogicalHeight.toInt());
setLogicalHeight(newLogicalHeight);
resolver.setPositionIgnoringNestedIsolates(oldEnd);
return oldEnd;
@@ -1624,9 +1624,9 @@ void LayoutBlockFlow::layoutInlineChildren(bool relayoutChildren, LayoutUnit aft
if (lastRootBox()) {
LayoutUnit lowestAllowedPosition = std::max(lastRootBox()->lineBottom(), logicalHeight() + paddingAfter());
if (!style()->isFlippedLinesWritingMode())
- lastLineAnnotationsAdjustment = lastRootBox()->computeUnderAnnotationAdjustment(lowestAllowedPosition);
+ lastLineAnnotationsAdjustment = lastRootBox()->computeUnderAnnotationAdjustment(lowestAllowedPosition).toInt();
else
- lastLineAnnotationsAdjustment = lastRootBox()->computeOverAnnotationAdjustment(lowestAllowedPosition);
+ lastLineAnnotationsAdjustment = lastRootBox()->computeOverAnnotationAdjustment(lowestAllowedPosition).toInt();
}
// Now add in the bottom border/padding.
@@ -2003,7 +2003,7 @@ void LayoutBlockFlow::checkLinesForTextOverflow()
LayoutUnit width(indentText == IndentText ? firstLineEllipsisWidth : ellipsisWidth);
LayoutUnit blockEdge = ltr ? blockRightEdge : blockLeftEdge;
- if (curr->lineCanAccommodateEllipsis(ltr, blockEdge, lineBoxEdge, width)) {
+ if (curr->lineCanAccommodateEllipsis(ltr, blockEdge.toInt(), lineBoxEdge.toInt(), width.toInt())) {
LayoutUnit totalLogicalWidth = curr->placeEllipsis(selectedEllipsisStr, ltr, blockLeftEdge, blockRightEdge, width);
LayoutUnit logicalLeft; // We are only interested in the delta from the base position.
LayoutUnit availableLogicalWidth = blockRightEdge - blockLeftEdge;
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698