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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutInline.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/LayoutInline.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutInline.cpp b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
index 80d0e136787ff3e1a7fbb3cc922e046c3db568ad..89117a80e485d93cad65a63387c2749b8a692fdf 100644
--- a/third_party/WebKit/Source/core/layout/LayoutInline.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
@@ -631,7 +631,7 @@ public:
void operator()(const LayoutRect& rect)
{
IntRect intRect = enclosingIntRect(rect);
- intRect.move(m_accumulatedOffset.x(), m_accumulatedOffset.y());
+ intRect.move(m_accumulatedOffset.x().toInt(), m_accumulatedOffset.y().toInt());
m_rects.append(intRect);
}
private:
@@ -1232,7 +1232,7 @@ int LayoutInline::baselinePosition(FontBaseline baselineType, bool firstLine, Li
{
ASSERT(linePositionMode == PositionOnContainingLine);
const FontMetrics& fontMetrics = style(firstLine)->getFontMetrics();
- return fontMetrics.ascent(baselineType) + (lineHeight(firstLine, direction, linePositionMode) - fontMetrics.height()) / 2;
+ return (fontMetrics.ascent(baselineType) + (lineHeight(firstLine, direction, linePositionMode) - fontMetrics.height()) / 2).toInt();
}
LayoutSize LayoutInline::offsetForInFlowPositionedInline(const LayoutBox& child) const
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutFrameSet.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutListMarker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698