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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutDeprecatedFlexibleBox.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/LayoutDeprecatedFlexibleBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutDeprecatedFlexibleBox.cpp b/third_party/WebKit/Source/core/layout/LayoutDeprecatedFlexibleBox.cpp
index b6e963d85f875748d09ffe76b208561002469c39..97343cf14bceac04a6eb2fdd40bef2ec29dd5061 100644
--- a/third_party/WebKit/Source/core/layout/LayoutDeprecatedFlexibleBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutDeprecatedFlexibleBox.cpp
@@ -135,7 +135,7 @@ static int getHeightForLineCount(const LayoutBlockFlow* blockFlow, int lineCount
if (blockFlow->childrenInline()) {
for (RootInlineBox* box = blockFlow->firstRootBox(); box; box = box->nextRootBox()) {
if (++count == lineCount)
- return box->lineBottom() + (includeBottom ? (blockFlow->borderBottom() + blockFlow->paddingBottom()) : LayoutUnit());
+ return (box->lineBottom() + (includeBottom ? (blockFlow->borderBottom() + blockFlow->paddingBottom()) : LayoutUnit())).toInt();
}
return -1;
}
@@ -145,13 +145,13 @@ static int getHeightForLineCount(const LayoutBlockFlow* blockFlow, int lineCount
if (obj->isLayoutBlockFlow() && shouldCheckLines(toLayoutBlockFlow(obj))) {
int result = getHeightForLineCount(toLayoutBlockFlow(obj), lineCount, false, count);
if (result != -1)
- return result + obj->location().y() + (includeBottom ? (blockFlow->borderBottom() + blockFlow->paddingBottom()) : LayoutUnit());
+ return (result + obj->location().y() + (includeBottom ? (blockFlow->borderBottom() + blockFlow->paddingBottom()) : LayoutUnit())).toInt();
} else if (!obj->isFloatingOrOutOfFlowPositioned()) {
normalFlowChildWithoutLines = obj;
}
}
if (normalFlowChildWithoutLines && lineCount == 0)
- return normalFlowChildWithoutLines->location().y() + normalFlowChildWithoutLines->size().height();
+ return (normalFlowChildWithoutLines->location().y() + normalFlowChildWithoutLines->size().height()).toInt();
return -1;
}
@@ -1026,7 +1026,7 @@ void LayoutDeprecatedFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool
continue;
LayoutUnit blockRightEdge = destBlock.logicalRightOffsetForLine(lastVisibleLine->y(), DoNotIndentText);
- if (!lastVisibleLine->lineCanAccommodateEllipsis(leftToRight, blockRightEdge, lastVisibleLine->x() + lastVisibleLine->logicalWidth(), totalWidth))
+ if (!lastVisibleLine->lineCanAccommodateEllipsis(leftToRight, blockRightEdge.toInt(), (lastVisibleLine->x() + lastVisibleLine->logicalWidth()).toInt(), totalWidth))
continue;
// Let the truncation code kick in.
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutButton.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutFieldset.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698