Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp |
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp |
index 91867b267e3846e7871142f9b3e0af1f11131e9a..3d14a4dc6f61811bfd17dfd5bc3711cb26663c7d 100644 |
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp |
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp |
@@ -66,11 +66,12 @@ void LayoutSVGImage::updateBoundingBox() |
FloatRect oldBoundaries = m_objectBoundingBox; |
SVGLengthContext lengthContext(element()); |
+ LayoutSize intrinsicSize = m_imageResource->imageSize(style()->effectiveZoom()); |
fs
2016/08/11 15:52:57
Probably needs to refine this a bit. (The end of)
Shanmuga Pandi
2016/08/16 10:24:57
Done.
|
m_objectBoundingBox = FloatRect( |
lengthContext.valueForLength(styleRef().svgStyle().x(), styleRef(), SVGLengthMode::Width), |
lengthContext.valueForLength(styleRef().svgStyle().y(), styleRef(), SVGLengthMode::Height), |
- lengthContext.valueForLength(styleRef().width(), styleRef(), SVGLengthMode::Width), |
- lengthContext.valueForLength(styleRef().height(), styleRef(), SVGLengthMode::Height)); |
+ styleRef().width().isAuto() ? intrinsicSize.width().toFloat() : lengthContext.valueForLength(styleRef().width(), styleRef(), SVGLengthMode::Width), |
+ styleRef().height().isAuto() ? intrinsicSize.height().toFloat() : lengthContext.valueForLength(styleRef().height(), styleRef(), SVGLengthMode::Height)); |
m_needsBoundariesUpdate |= oldBoundaries != m_objectBoundingBox; |
} |