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

Unified Diff: Source/core/rendering/svg/RenderSVGRoot.h

Issue 210083003: [svg] in img element doesn't render correctly when height is changed dynamically. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use runRepaintAndPixelTest Created 6 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 | « LayoutTests/svg/as-image/set-img-height-expected.html ('k') | Source/core/svg/graphics/SVGImage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGRoot.h
diff --git a/Source/core/rendering/svg/RenderSVGRoot.h b/Source/core/rendering/svg/RenderSVGRoot.h
index 0d8c998b11e09f9d6246dae9ba2ffaa1eb46136e..6e1fc8187b25bff9dbfee8f8d224d54b3f30d3b8 100644
--- a/Source/core/rendering/svg/RenderSVGRoot.h
+++ b/Source/core/rendering/svg/RenderSVGRoot.h
@@ -53,7 +53,15 @@ public:
virtual void setNeedsTransformUpdate() OVERRIDE { m_needsBoundariesOrTransformUpdate = true; }
IntSize containerSize() const { return m_containerSize; }
- void setContainerSize(const IntSize& containerSize) { m_containerSize = containerSize; }
+ void setContainerSize(const IntSize& containerSize)
+ {
+ // SVGImage::draw() does a view layout prior to painting,
+ // and we need that layout to know of the new size otherwise
+ // the rendering may be incorrectly using the old size.
+ if (m_containerSize != containerSize)
+ setNeedsLayout();
+ m_containerSize = containerSize;
+ }
virtual bool hasRelativeIntrinsicLogicalWidth() const OVERRIDE;
virtual bool hasRelativeLogicalHeight() const OVERRIDE;
« no previous file with comments | « LayoutTests/svg/as-image/set-img-height-expected.html ('k') | Source/core/svg/graphics/SVGImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698