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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.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/layout/LayoutBoxModelObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
index 3cf9c29073131c37b32e3e797e6b6b4b05d36186..13c15370a4482ea4b9808974bc7e4ad9970e7b6a 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -729,15 +729,11 @@ LayoutSize LayoutBoxModelObject::calculateImageIntrinsicDimensions(StyleImage* i
if (image->isGeneratedImage() && image->usesImageContainerSize())
return positioningAreaSize;
- Length intrinsicWidth(Fixed);
- Length intrinsicHeight(Fixed);
+ FloatSize intrinsicSize;
FloatSize intrinsicRatio;
- image->computeIntrinsicDimensions(this, intrinsicWidth, intrinsicHeight, intrinsicRatio);
+ image->computeIntrinsicDimensions(this, intrinsicSize, intrinsicRatio);
- ASSERT(intrinsicWidth.isFixed());
- ASSERT(intrinsicHeight.isFixed());
-
- LayoutSize resolvedSize(intrinsicWidth.value(), intrinsicHeight.value());
+ LayoutSize resolvedSize(intrinsicSize.width(), intrinsicSize.height());
fs 2016/02/12 11:24:46 Nit: Use LayoutSize(const FloatSize&)?
davve 2016/02/12 11:58:29 Done.
LayoutSize minimumSize(resolvedSize.width() > LayoutUnit() ? LayoutUnit(1) : LayoutUnit(),
resolvedSize.height() > LayoutUnit() ? LayoutUnit(1) : LayoutUnit());
if (shouldScaleOrNot == ScaleByEffectiveZoom)

Powered by Google App Engine
This is Rietveld 408576698