| Index: Source/core/rendering/svg/RenderSVGImage.cpp
|
| diff --git a/Source/core/rendering/svg/RenderSVGImage.cpp b/Source/core/rendering/svg/RenderSVGImage.cpp
|
| index 79ebf3a7ea1d9ab11e99d9f89133834a9141a5b0..daf418c5408508f21054fea22375002b711b28d2 100644
|
| --- a/Source/core/rendering/svg/RenderSVGImage.cpp
|
| +++ b/Source/core/rendering/svg/RenderSVGImage.cpp
|
| @@ -65,26 +65,25 @@ bool RenderSVGImage::updateImageViewport()
|
| SVGLengthContext lengthContext(image);
|
| m_objectBoundingBox = FloatRect(image->x()->currentValue()->value(lengthContext), image->y()->currentValue()->value(lengthContext), image->width()->currentValue()->value(lengthContext), image->height()->currentValue()->value(lengthContext));
|
|
|
| + bool boundsChanged = oldBoundaries != m_objectBoundingBox;
|
| +
|
| // Images with preserveAspectRatio=none should force non-uniform scaling. This can be achieved
|
| // by setting the image's container size to its intrinsic size.
|
| // See: http://www.w3.org/TR/SVG/single-page.html, 7.8 The ‘preserveAspectRatio’ attribute.
|
| + IntSize newViewportSize;
|
| if (image->preserveAspectRatio()->currentValue()->align() == SVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE) {
|
| - if (ImageResource* cachedImage = m_imageResource->cachedImage()) {
|
| - LayoutSize intrinsicSize = cachedImage->imageSizeForRenderer(0, style()->effectiveZoom());
|
| - if (intrinsicSize != m_imageResource->imageSize(style()->effectiveZoom())) {
|
| - m_imageResource->setContainerSizeForRenderer(roundedIntSize(intrinsicSize));
|
| - updatedViewport = true;
|
| - }
|
| + LayoutSize intrinsicSize = m_imageResource->intrinsicSize(style()->effectiveZoom());
|
| + if (intrinsicSize != m_imageResource->imageSize(style()->effectiveZoom())) {
|
| + newViewportSize = roundedIntSize(intrinsicSize);
|
| + updatedViewport = true;
|
| }
|
| - }
|
| -
|
| - if (oldBoundaries != m_objectBoundingBox) {
|
| - if (!updatedViewport)
|
| - m_imageResource->setContainerSizeForRenderer(enclosingIntRect(m_objectBoundingBox).size());
|
| + } else if (boundsChanged) {
|
| + newViewportSize = enclosingIntRect(m_objectBoundingBox).size();
|
| updatedViewport = true;
|
| - m_needsBoundariesUpdate = true;
|
| }
|
| -
|
| + if (updatedViewport)
|
| + m_imageResource->setContainerSizeForRenderer(newViewportSize);
|
| + m_needsBoundariesUpdate |= boundsChanged;
|
| return updatedViewport;
|
| }
|
|
|
|
|