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

Unified Diff: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp

Issue 1690253002: Align IntrinsicSizingInfo with computeIntrinsicDimensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More rebaselines 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
index 90a7524683d22369ce3b6c8bc99df714f4db7f04..105915073b428da170c90c92c01eebc24b173148 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -156,11 +156,14 @@ IntSize SVGImage::containerSize() const
LayoutBox::IntrinsicSizingInfo intrinsicSizingInfo;
layoutObject->computeIntrinsicSizingInfo(intrinsicSizingInfo);
- if (intrinsicSizingInfo.size.isEmpty() && intrinsicSizingInfo.aspectRatio) {
- if (!intrinsicSizingInfo.size.width() && intrinsicSizingInfo.size.height())
- intrinsicSizingInfo.size.setWidth(intrinsicSizingInfo.size.height() * intrinsicSizingInfo.aspectRatio);
- else if (intrinsicSizingInfo.size.width() && !intrinsicSizingInfo.size.height())
- intrinsicSizingInfo.size.setHeight(intrinsicSizingInfo.size.width() / intrinsicSizingInfo.aspectRatio);
+ if (intrinsicSizingInfo.size.isEmpty() && !intrinsicSizingInfo.aspectRatio.isEmpty()) {
+ if (!intrinsicSizingInfo.size.width() && intrinsicSizingInfo.size.height()) {
+ intrinsicSizingInfo.size.setWidth(
+ intrinsicSizingInfo.size.height() * intrinsicSizingInfo.aspectRatio.width() / intrinsicSizingInfo.aspectRatio.height());
+ } else if (intrinsicSizingInfo.size.width() && !intrinsicSizingInfo.size.height()) {
+ intrinsicSizingInfo.size.setHeight(
+ intrinsicSizingInfo.size.width() * intrinsicSizingInfo.aspectRatio.height() / intrinsicSizingInfo.aspectRatio.width());
+ }
}
// TODO(davve): In order to maintain aspect ratio the intrinsic
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698