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

Side by Side 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, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2009 Google, Inc. All rights reserved. 4 * Copyright (C) 2009 Google, Inc. All rights reserved.
5 * Copyright (C) 2009 Apple Inc. All rights reserved. 5 * Copyright (C) 2009 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 RenderObject* lastChild() const { ASSERT(children() == virtualChildren()); r eturn children()->lastChild(); } 46 RenderObject* lastChild() const { ASSERT(children() == virtualChildren()); r eturn children()->lastChild(); }
47 47
48 const RenderObjectChildList* children() const { return &m_children; } 48 const RenderObjectChildList* children() const { return &m_children; }
49 RenderObjectChildList* children() { return &m_children; } 49 RenderObjectChildList* children() { return &m_children; }
50 50
51 bool isLayoutSizeChanged() const { return m_isLayoutSizeChanged; } 51 bool isLayoutSizeChanged() const { return m_isLayoutSizeChanged; }
52 virtual void setNeedsBoundariesUpdate() OVERRIDE { m_needsBoundariesOrTransf ormUpdate = true; } 52 virtual void setNeedsBoundariesUpdate() OVERRIDE { m_needsBoundariesOrTransf ormUpdate = true; }
53 virtual void setNeedsTransformUpdate() OVERRIDE { m_needsBoundariesOrTransfo rmUpdate = true; } 53 virtual void setNeedsTransformUpdate() OVERRIDE { m_needsBoundariesOrTransfo rmUpdate = true; }
54 54
55 IntSize containerSize() const { return m_containerSize; } 55 IntSize containerSize() const { return m_containerSize; }
56 void setContainerSize(const IntSize& containerSize) { m_containerSize = cont ainerSize; } 56 void setContainerSize(const IntSize& containerSize)
57 {
58 // SVGImage::draw() does a view layout prior to painting,
59 // and we need that layout to know of the new size otherwise
60 // the rendering may be incorrectly using the old size.
61 if (m_containerSize != containerSize)
62 setNeedsLayout();
63 m_containerSize = containerSize;
64 }
57 65
58 virtual bool hasRelativeIntrinsicLogicalWidth() const OVERRIDE; 66 virtual bool hasRelativeIntrinsicLogicalWidth() const OVERRIDE;
59 virtual bool hasRelativeLogicalHeight() const OVERRIDE; 67 virtual bool hasRelativeLogicalHeight() const OVERRIDE;
60 virtual bool visibleForTouchAction() const OVERRIDE { return true; } 68 virtual bool visibleForTouchAction() const OVERRIDE { return true; }
61 69
62 // localToBorderBoxTransform maps local SVG viewport coordinates to local CS S box coordinates. 70 // localToBorderBoxTransform maps local SVG viewport coordinates to local CS S box coordinates.
63 const AffineTransform& localToBorderBoxTransform() const { return m_localToB orderBoxTransform; } 71 const AffineTransform& localToBorderBoxTransform() const { return m_localToB orderBoxTransform; }
64 72
65 private: 73 private:
66 virtual RenderObjectChildList* virtualChildren() OVERRIDE { return children( ); } 74 virtual RenderObjectChildList* virtualChildren() OVERRIDE { return children( ); }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 AffineTransform m_localToBorderBoxTransform; 123 AffineTransform m_localToBorderBoxTransform;
116 bool m_isLayoutSizeChanged : 1; 124 bool m_isLayoutSizeChanged : 1;
117 bool m_needsBoundariesOrTransformUpdate : 1; 125 bool m_needsBoundariesOrTransformUpdate : 1;
118 }; 126 };
119 127
120 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderSVGRoot, isSVGRoot()); 128 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderSVGRoot, isSVGRoot());
121 129
122 } // namespace WebCore 130 } // namespace WebCore
123 131
124 #endif // RenderSVGRoot_h 132 #endif // RenderSVGRoot_h
OLDNEW
« 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