Chromium Code Reviews| 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..e1aa94a1a815e441a27454b33e8a70237c8aa042 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()); |
| + SVGImageElement* image = toSVGImageElement(element()); |
| 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() ? image->width()->currentValue()->value(lengthContext) : lengthContext.valueForLength(styleRef().width(), styleRef(), SVGLengthMode::Width), |
|
fs
2016/08/10 18:01:34
No, this is not what should happen. To quote the r
Shanmuga Pandi
2016/08/11 05:54:20
Thank you fs@ for explaining in detail.
Done the c
|
| + styleRef().height().isAuto() ? image->height()->currentValue()->value(lengthContext) : lengthContext.valueForLength(styleRef().height(), styleRef(), SVGLengthMode::Height)); |
| m_needsBoundariesUpdate |= oldBoundaries != m_objectBoundingBox; |
| } |