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

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

Issue 1685353004: Clean up Image::computeIntrinsicDimensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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..14e00ed42319b1771015bb55164c63b7b733f37e 100644
--- a/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp
+++ b/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp
@@ -69,13 +69,12 @@ LayoutSize StyleGeneratedImage::imageSize(const LayoutObject* layoutObject, floa
return LayoutSize();
}
-void StyleGeneratedImage::computeIntrinsicDimensions(const LayoutObject* layoutObject, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
+void StyleGeneratedImage::computeIntrinsicDimensions(const LayoutObject* layoutObject, FloatSize& intrinsicSize, FloatSize& intrinsicRatio)
{
// At a zoom level of 1 the image is guaranteed to have an integer size.
- IntSize size = flooredIntSize(imageSize(layoutObject, 1));
- intrinsicWidth = Length(size.width(), Fixed);
- intrinsicHeight = Length(size.height(), Fixed);
- intrinsicRatio = FloatSize(size);
+ LayoutSize size = imageSize(layoutObject, 1);
+ ASSERT(size.width().fraction() == 0 && size.height().fraction() == 0);
fs 2016/02/12 11:24:46 Nit: size.fraction().isZero()?
davve 2016/02/12 11:58:29 Yes, much nicer.
+ intrinsicSize = intrinsicRatio = FloatSize(size);
}
void StyleGeneratedImage::addClient(LayoutObject* layoutObject)

Powered by Google App Engine
This is Rietveld 408576698