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

Unified Diff: Source/core/layout/LayoutReplaced.cpp

Issue 1019813002: Use viewBox for SVG image as intrinsic size when all else fails (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated test expectations and added TODOs Created 5 years, 9 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: Source/core/layout/LayoutReplaced.cpp
diff --git a/Source/core/layout/LayoutReplaced.cpp b/Source/core/layout/LayoutReplaced.cpp
index cadc5b1efdfca7550721f9fc995e1c951ff800b8..22f0af4f7fc2f8a29b85f3924d8c2174bfaabc7a 100644
--- a/Source/core/layout/LayoutReplaced.cpp
+++ b/Source/core/layout/LayoutReplaced.cpp
@@ -226,6 +226,10 @@ LayoutRect LayoutReplaced::replacedContentRect(const LayoutSize* overriddenIntri
return contentRect;
}
+ // TODO(davve): intrinsicSize doubles as both intrinsic size and intrinsic ratio. In the case of
+ // SVG images this isn't correct since they can have intrinsic ratio but no intrinsic size. In
+ // order to maintain aspect ratio, the intrinsic size for SVG might be faked from the aspect
+ // ratio, see SVGImage::containerSize().
LayoutSize intrinsicSize = overriddenIntrinsicSize ? *overriddenIntrinsicSize : this->intrinsicSize();
if (!intrinsicSize.width() || !intrinsicSize.height())
return contentRect;
« no previous file with comments | « LayoutTests/svg/as-image/svg-as-image-object-fit-cover-expected.html ('k') | Source/core/svg/graphics/SVGImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698