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

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: Address nits 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..be3510929a8ec1a9608a40928d9a439e98ba07e9 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);
LayoutSize minimumSize(resolvedSize.width() > LayoutUnit() ? LayoutUnit(1) : LayoutUnit(),
resolvedSize.height() > LayoutUnit() ? LayoutUnit(1) : LayoutUnit());
if (shouldScaleOrNot == ScaleByEffectiveZoom)
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.cpp ('k') | third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698