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

Unified Diff: third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp

Issue 1660863002: Force all LayoutUnit construction to be explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also fix LayoutRectTest.cpp Created 4 years, 10 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/style/StyleGeneratedImage.cpp
diff --git a/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp b/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp
index 499333d9726638cd4369921d6064d036c5770b7e..97bd8e9709f22cbc4885e9ce9049c21a3e37a8c9 100644
--- a/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp
+++ b/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp
@@ -53,14 +53,14 @@ LayoutSize StyleGeneratedImage::imageSize(const LayoutObject* layoutObject, floa
if (multiplier == 1.0f)
return fixedSize;
- LayoutUnit width = fixedSize.width() * multiplier;
- LayoutUnit height = fixedSize.height() * multiplier;
+ LayoutUnit width(fixedSize.width() * multiplier);
+ LayoutUnit height(fixedSize.height() * multiplier);
// Don't let images that have a width/height >= 1 shrink below 1 when zoomed.
- if (fixedSize.width() > 0)
+ if (fixedSize.width() > LayoutUnit())
width = max(LayoutUnit(1), width);
- if (fixedSize.height() > 0)
+ if (fixedSize.height() > LayoutUnit())
height = max(LayoutUnit(1), height);
return LayoutSize(width, height);
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.cpp ('k') | third_party/WebKit/Source/platform/LayoutUnit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698