Index: Source/core/svg/graphics/SVGImage.cpp |
diff --git a/Source/core/svg/graphics/SVGImage.cpp b/Source/core/svg/graphics/SVGImage.cpp |
index 32d839fdebc7156085228a0d38be1ce4a596b7d8..dbb770f8a0e850419f0d6d2b33193c817ba44f11 100644 |
--- a/Source/core/svg/graphics/SVGImage.cpp |
+++ b/Source/core/svg/graphics/SVGImage.cpp |
@@ -178,6 +178,13 @@ IntSize SVGImage::containerSize() const |
intrinsicSize.setHeight(intrinsicSize.width() / intrinsicRatio); |
} |
+ // TODO(davve): In order to maintain aspect ratio the intrinsic |
+ // size is faked from the viewBox as a last resort. This may cause |
+ // unwanted side effects. Preferably we should be able to signal |
+ // the intrinsic ratio in another way. |
+ if (intrinsicSize.isEmpty()) |
+ intrinsicSize = rootElement->currentViewBoxRect().size(); |
+ |
if (!intrinsicSize.isEmpty()) |
return expandedIntSize(intrinsicSize); |