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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlow.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/LayoutBlockFlow.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
index d905a95cc48593fd20a2a29d9567e926152a09fb..2a619c502c3394d44382b56e26d3bb98e28f266a 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -2030,7 +2030,7 @@ int LayoutBlockFlow::firstLineBoxBaseline() const
if (!childrenInline())
return LayoutBlock::firstLineBoxBaseline();
if (firstLineBox())
- return firstLineBox()->logicalTop() + style(true)->getFontMetrics().ascent(firstRootBox()->baselineType());
+ return (firstLineBox()->logicalTop() + style(true)->getFontMetrics().ascent(firstRootBox()->baselineType())).toInt();
return -1;
}
@@ -2047,20 +2047,20 @@ int LayoutBlockFlow::inlineBlockBaseline(LineDirectionMode lineDirection) const
if ((!style()->isOverflowVisible() && !shouldIgnoreOverflowPropertyForInlineBlockBaseline()) || style()->containsSize()) {
// We are not calling baselinePosition here because the caller should add the margin-top/margin-right, not us.
- return lineDirection == HorizontalLine ? size().height() + marginBottom() : size().width() + marginLeft();
+ return (lineDirection == HorizontalLine ? size().height() + marginBottom() : size().width() + marginLeft()).toInt();
}
if (isWritingModeRoot() && !isRubyRun())
return -1;
if (!childrenInline())
return LayoutBlock::inlineBlockBaseline(lineDirection);
if (lastLineBox())
- return lastLineBox()->logicalTop() + style(lastLineBox() == firstLineBox())->getFontMetrics().ascent(lastRootBox()->baselineType());
+ return (lastLineBox()->logicalTop() + style(lastLineBox() == firstLineBox())->getFontMetrics().ascent(lastRootBox()->baselineType())).toInt();
if (!hasLineIfEmpty())
return -1;
const FontMetrics& fontMetrics = firstLineStyle()->getFontMetrics();
- return fontMetrics.ascent()
+ return (fontMetrics.ascent()
+ (lineHeight(true, lineDirection, PositionOfInteriorLineBoxes) - fontMetrics.height()) / 2
- + (lineDirection == HorizontalLine ? borderTop() + paddingTop() : borderRight() + paddingRight());
+ + (lineDirection == HorizontalLine ? borderTop() + paddingTop() : borderRight() + paddingRight())).toInt();
}
void LayoutBlockFlow::removeFloatingObjectsFromDescendants()
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698