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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.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/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 0c0c4a6bb10792e02cf8cc3a007abdab506dc195..fac3e8f844128ff82976021366a666c1b6d902bc 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -760,8 +760,8 @@ int LayoutBox::reflectionOffset() const
if (!style()->boxReflect())
return 0;
if (style()->boxReflect()->direction() == ReflectionLeft || style()->boxReflect()->direction() == ReflectionRight)
- return valueForLength(style()->boxReflect()->offset(), borderBoxRect().width());
- return valueForLength(style()->boxReflect()->offset(), borderBoxRect().height());
+ return valueForLength(style()->boxReflect()->offset(), borderBoxRect().width()).toInt();
+ return valueForLength(style()->boxReflect()->offset(), borderBoxRect().height()).toInt();
}
LayoutRect LayoutBox::reflectedRect(const LayoutRect& r) const
@@ -1558,7 +1558,7 @@ ResourcePriority LayoutBox::computeResourcePriority() const
int screenArea = 0;
if (!screenRect.isEmpty() && isVisible)
- screenArea = static_cast<uint32_t>(screenRect.width() * screenRect.height());
+ screenArea = (screenRect.width() * screenRect.height()).toInt();
return ResourcePriority(isVisible ? ResourcePriority::Visible : ResourcePriority::NotVisible, screenArea);
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutButton.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698