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

Unified Diff: third_party/WebKit/Source/core/html/forms/ImageInputType.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/html/forms/ImageInputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/ImageInputType.cpp b/third_party/WebKit/Source/core/html/forms/ImageInputType.cpp
index afdeea8d2f12fdfa3bdf5c0b9a3855248aae7354..b7b1cb428261a51eb5c912a902a38dcaf1370c94 100644
--- a/third_party/WebKit/Source/core/html/forms/ImageInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/ImageInputType.cpp
@@ -196,13 +196,13 @@ unsigned ImageInputType::height() const
// If the image is available, use its height.
HTMLImageLoader* imageLoader = element().imageLoader();
if (imageLoader && imageLoader->image())
- return imageLoader->image()->imageSize(LayoutObject::shouldRespectImageOrientation(nullptr), 1).height();
+ return imageLoader->image()->imageSize(LayoutObject::shouldRespectImageOrientation(nullptr), 1).height().toUnsigned();
}
element().document().updateStyleAndLayout();
LayoutBox* box = element().layoutBox();
- return box ? adjustForAbsoluteZoom(box->contentHeight(), box) : 0;
+ return box ? adjustForAbsoluteZoom(box->contentHeight().toInt(), box) : 0;
}
unsigned ImageInputType::width() const
@@ -216,13 +216,13 @@ unsigned ImageInputType::width() const
// If the image is available, use its width.
HTMLImageLoader* imageLoader = element().imageLoader();
if (imageLoader && imageLoader->image())
- return imageLoader->image()->imageSize(LayoutObject::shouldRespectImageOrientation(nullptr), 1).width();
+ return imageLoader->image()->imageSize(LayoutObject::shouldRespectImageOrientation(nullptr), 1).width().toUnsigned();
}
element().document().updateStyleAndLayout();
LayoutBox* box = element().layoutBox();
- return box ? adjustForAbsoluteZoom(box->contentWidth(), box) : 0;
+ return box ? adjustForAbsoluteZoom(box->contentWidth().toInt(), box) : 0;
}
bool ImageInputType::hasLegalLinkAttribute(const QualifiedName& name) const
« no previous file with comments | « third_party/WebKit/Source/core/html/ImageDocument.cpp ('k') | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698