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

Unified Diff: third_party/WebKit/Source/core/html/HTMLImageElement.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/HTMLImageElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
index 858f7595cbdfe1fb7acf2703792527a7f75bdcdf..6689203f3cca345dfef15e3e284c8b23cc531d60 100644
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
@@ -418,7 +418,7 @@ int HTMLImageElement::width()
// if the image is available, use its width
if (imageLoader().image())
- return imageLoader().image()->imageSize(LayoutObject::shouldRespectImageOrientation(nullptr), 1.0f).width();
+ return imageLoader().image()->imageSize(LayoutObject::shouldRespectImageOrientation(nullptr), 1.0f).width().toInt();
}
LayoutBox* box = layoutBox();
@@ -439,7 +439,7 @@ int HTMLImageElement::height()
// if the image is available, use its height
if (imageLoader().image())
- return imageLoader().image()->imageSize(LayoutObject::shouldRespectImageOrientation(nullptr), 1.0f).height();
+ return imageLoader().image()->imageSize(LayoutObject::shouldRespectImageOrientation(nullptr), 1.0f).height().toInt();
}
LayoutBox* box = layoutBox();
@@ -451,7 +451,7 @@ int HTMLImageElement::naturalWidth() const
if (!imageLoader().image())
return 0;
- return imageLoader().image()->imageSize(LayoutObject::shouldRespectImageOrientation(layoutObject()), m_imageDevicePixelRatio, ImageResource::IntrinsicCorrectedToDPR).width();
+ return imageLoader().image()->imageSize(LayoutObject::shouldRespectImageOrientation(layoutObject()), m_imageDevicePixelRatio, ImageResource::IntrinsicCorrectedToDPR).width().toInt();
}
int HTMLImageElement::naturalHeight() const
@@ -459,7 +459,7 @@ int HTMLImageElement::naturalHeight() const
if (!imageLoader().image())
return 0;
- return imageLoader().image()->imageSize(LayoutObject::shouldRespectImageOrientation(layoutObject()), m_imageDevicePixelRatio, ImageResource::IntrinsicCorrectedToDPR).height();
+ return imageLoader().image()->imageSize(LayoutObject::shouldRespectImageOrientation(layoutObject()), m_imageDevicePixelRatio, ImageResource::IntrinsicCorrectedToDPR).height().toInt();
}
const String& HTMLImageElement::currentSrc() const
@@ -830,7 +830,7 @@ IntSize HTMLImageElement::bitmapSourceSize() const
return IntSize();
LayoutSize lSize = image->imageSize(LayoutObject::shouldRespectImageOrientation(layoutObject()), 1.0f);
DCHECK(lSize.fraction().isZero());
- return IntSize(lSize.width(), lSize.height());
+ return IntSize(lSize.width().toInt(), lSize.height().toInt());
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameViewAutoSizeInfo.cpp ('k') | third_party/WebKit/Source/core/html/ImageDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698