Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1198)

Unified Diff: Source/core/layout/svg/LayoutSVGImage.cpp

Issue 963733002: [svg2] Make 'width' and 'height' presentation attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaseline some EX tests [Mac Win] Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/layout/svg/LayoutSVGForeignObject.cpp ('k') | Source/core/layout/svg/LayoutSVGRect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..61bcf090db125b503a43ba4331a1d475fa55374e 100644
--- a/Source/core/layout/svg/LayoutSVGImage.cpp
+++ b/Source/core/layout/svg/LayoutSVGImage.cpp
@@ -92,14 +92,18 @@ 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));
+ 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));
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(styleRef().effectiveZoom())
|| !containerSizeIsSetForRenderer(*cachedImage, this)) {
m_imageResource->setContainerSizeForRenderer(roundedIntSize(imageViewportSize));
updatedViewport = true;
« no previous file with comments | « Source/core/layout/svg/LayoutSVGForeignObject.cpp ('k') | Source/core/layout/svg/LayoutSVGRect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698