Chromium Code Reviews| Index: Source/core/layout/svg/LayoutSVGImage.cpp |
| diff --git a/Source/core/layout/svg/LayoutSVGImage.cpp b/Source/core/layout/svg/LayoutSVGImage.cpp |
| index 1a7140412d0bddf002c2895a4377e1d317dcb52e..e1adf5a7e8765ca56470c54d270658ef5ddb6670 100644 |
| --- a/Source/core/layout/svg/LayoutSVGImage.cpp |
| +++ b/Source/core/layout/svg/LayoutSVGImage.cpp |
| @@ -92,14 +92,19 @@ bool LayoutSVGImage::updateImageViewport() |
| FloatRect oldBoundaries = m_objectBoundingBox; |
| 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)); |
| + const LayoutStyle& style = image->layoutObject()->styleRef(); |
|
fs
2015/03/12 14:28:48
image->layoutObject()->styleRef() => styleRef()
Erik Dahlström (inactive)
2015/03/12 16:14:56
Done.
|
| + m_objectBoundingBox = FloatRect( |
| + lengthContext.valueForLength(style.svgStyle().x(), style, SVGLengthMode::Width), |
| + lengthContext.valueForLength(style.svgStyle().y(), style, SVGLengthMode::Height), |
| + lengthContext.valueForLength(style.width(), style, SVGLengthMode::Width), |
| + lengthContext.valueForLength(style.height(), style, SVGLengthMode::Height)); |
|
fs
2015/03/12 14:28:48
Almost looks like
style.svgStyle().x(), style.svg
Erik Dahlström (inactive)
2015/03/12 16:14:56
np, I'll do that as a followup.
|
| bool boundsChanged = oldBoundaries != m_objectBoundingBox; |
| bool updatedViewport = false; |
| ImageResource* cachedImage = m_imageResource->cachedImage(); |
| if (cachedImage && cachedImage->usesImageContainerSize()) { |
| FloatSize imageViewportSize = computeImageViewportSize(*cachedImage); |
| - if (LayoutSize(imageViewportSize) != m_imageResource->imageSize(style()->effectiveZoom()) |
| + if (LayoutSize(imageViewportSize) != m_imageResource->imageSize(style.effectiveZoom()) |
| || !containerSizeIsSetForRenderer(*cachedImage, this)) { |
| m_imageResource->setContainerSizeForRenderer(roundedIntSize(imageViewportSize)); |
| updatedViewport = true; |