OLD | NEW |
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 22 matching lines...) Expand all Loading... |
33 class SVGElement; | 33 class SVGElement; |
34 | 34 |
35 class RenderSVGRoot FINAL : public RenderReplaced { | 35 class RenderSVGRoot FINAL : public RenderReplaced { |
36 public: | 36 public: |
37 explicit RenderSVGRoot(SVGElement*); | 37 explicit RenderSVGRoot(SVGElement*); |
38 virtual ~RenderSVGRoot(); | 38 virtual ~RenderSVGRoot(); |
39 | 39 |
40 bool isEmbeddedThroughSVGImage() const; | 40 bool isEmbeddedThroughSVGImage() const; |
41 bool isEmbeddedThroughFrameContainingSVGDocument() const; | 41 bool isEmbeddedThroughFrameContainingSVGDocument() const; |
42 | 42 |
43 virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, doub
le& intrinsicRatio, bool& isPercentageIntrinsicSize) const OVERRIDE; | 43 virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, doub
le& intrinsicRatio) const OVERRIDE; |
44 | 44 |
45 RenderObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } | 45 RenderObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } |
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) | 56 void setContainerSize(const IntSize& containerSize) |
57 { | 57 { |
58 // SVGImage::draw() does a view layout prior to painting, | 58 // SVGImage::draw() does a view layout prior to painting, |
59 // and we need that layout to know of the new size otherwise | 59 // and we need that layout to know of the new size otherwise |
60 // the rendering may be incorrectly using the old size. | 60 // the rendering may be incorrectly using the old size. |
61 if (m_containerSize != containerSize) | 61 if (m_containerSize != containerSize) |
62 setNeedsLayout(); | 62 setNeedsLayout(); |
63 m_containerSize = containerSize; | 63 m_containerSize = containerSize; |
64 } | 64 } |
65 | 65 |
66 virtual bool hasRelativeIntrinsicLogicalWidth() const OVERRIDE; | |
67 virtual bool hasRelativeLogicalHeight() const OVERRIDE; | |
68 | |
69 // localToBorderBoxTransform maps local SVG viewport coordinates to local CS
S box coordinates. | 66 // localToBorderBoxTransform maps local SVG viewport coordinates to local CS
S box coordinates. |
70 const AffineTransform& localToBorderBoxTransform() const { return m_localToB
orderBoxTransform; } | 67 const AffineTransform& localToBorderBoxTransform() const { return m_localToB
orderBoxTransform; } |
71 | 68 |
72 private: | 69 private: |
73 virtual RenderObjectChildList* virtualChildren() OVERRIDE { return children(
); } | 70 virtual RenderObjectChildList* virtualChildren() OVERRIDE { return children(
); } |
74 virtual const RenderObjectChildList* virtualChildren() const OVERRIDE { retu
rn children(); } | 71 virtual const RenderObjectChildList* virtualChildren() const OVERRIDE { retu
rn children(); } |
75 | 72 |
76 virtual const char* renderName() const OVERRIDE { return "RenderSVGRoot"; } | 73 virtual const char* renderName() const OVERRIDE { return "RenderSVGRoot"; } |
77 virtual bool isSVGRoot() const OVERRIDE { return true; } | 74 virtual bool isSVGRoot() const OVERRIDE { return true; } |
78 virtual bool isSVG() const OVERRIDE { return true; } | 75 virtual bool isSVG() const OVERRIDE { return true; } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 bool m_isLayoutSizeChanged : 1; | 120 bool m_isLayoutSizeChanged : 1; |
124 bool m_needsBoundariesOrTransformUpdate : 1; | 121 bool m_needsBoundariesOrTransformUpdate : 1; |
125 bool m_hasBoxDecorations : 1; | 122 bool m_hasBoxDecorations : 1; |
126 }; | 123 }; |
127 | 124 |
128 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderSVGRoot, isSVGRoot()); | 125 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderSVGRoot, isSVGRoot()); |
129 | 126 |
130 } // namespace WebCore | 127 } // namespace WebCore |
131 | 128 |
132 #endif // RenderSVGRoot_h | 129 #endif // RenderSVGRoot_h |
OLD | NEW |