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 11 matching lines...) Expand all Loading... |
22 | 22 |
23 #ifndef RenderSVGRoot_h | 23 #ifndef RenderSVGRoot_h |
24 #define RenderSVGRoot_h | 24 #define RenderSVGRoot_h |
25 | 25 |
26 #include "core/rendering/RenderReplaced.h" | 26 #include "core/rendering/RenderReplaced.h" |
27 | 27 |
28 namespace blink { | 28 namespace blink { |
29 | 29 |
30 class SVGElement; | 30 class SVGElement; |
31 | 31 |
32 class RenderSVGRoot FINAL : public RenderReplaced { | 32 class RenderSVGRoot final : public RenderReplaced { |
33 public: | 33 public: |
34 explicit RenderSVGRoot(SVGElement*); | 34 explicit RenderSVGRoot(SVGElement*); |
35 virtual ~RenderSVGRoot(); | 35 virtual ~RenderSVGRoot(); |
36 virtual void trace(Visitor*) OVERRIDE; | 36 virtual void trace(Visitor*) override; |
37 | 37 |
38 bool isEmbeddedThroughSVGImage() const; | 38 bool isEmbeddedThroughSVGImage() const; |
39 bool isEmbeddedThroughFrameContainingSVGDocument() const; | 39 bool isEmbeddedThroughFrameContainingSVGDocument() const; |
40 | 40 |
41 virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, doub
le& intrinsicRatio) const OVERRIDE; | 41 virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, doub
le& intrinsicRatio) const override; |
42 | 42 |
43 // If you have a RenderSVGRoot, use firstChild or lastChild instead. | 43 // If you have a RenderSVGRoot, use firstChild or lastChild instead. |
44 void slowFirstChild() const WTF_DELETED_FUNCTION; | 44 void slowFirstChild() const WTF_DELETED_FUNCTION; |
45 void slowLastChild() const WTF_DELETED_FUNCTION; | 45 void slowLastChild() const WTF_DELETED_FUNCTION; |
46 | 46 |
47 bool isLayoutSizeChanged() const { return m_isLayoutSizeChanged; } | 47 bool isLayoutSizeChanged() const { return m_isLayoutSizeChanged; } |
48 virtual void setNeedsBoundariesUpdate() OVERRIDE { m_needsBoundariesOrTransf
ormUpdate = true; } | 48 virtual void setNeedsBoundariesUpdate() override { m_needsBoundariesOrTransf
ormUpdate = true; } |
49 virtual void setNeedsTransformUpdate() OVERRIDE { m_needsBoundariesOrTransfo
rmUpdate = true; } | 49 virtual void setNeedsTransformUpdate() override { m_needsBoundariesOrTransfo
rmUpdate = true; } |
50 | 50 |
51 IntSize containerSize() const { return m_containerSize; } | 51 IntSize containerSize() const { return m_containerSize; } |
52 void setContainerSize(const IntSize& containerSize) | 52 void setContainerSize(const IntSize& containerSize) |
53 { | 53 { |
54 // SVGImage::draw() does a view layout prior to painting, | 54 // SVGImage::draw() does a view layout prior to painting, |
55 // and we need that layout to know of the new size otherwise | 55 // and we need that layout to know of the new size otherwise |
56 // the rendering may be incorrectly using the old size. | 56 // the rendering may be incorrectly using the old size. |
57 if (m_containerSize != containerSize) | 57 if (m_containerSize != containerSize) |
58 setNeedsLayoutAndFullPaintInvalidation(); | 58 setNeedsLayoutAndFullPaintInvalidation(); |
59 m_containerSize = containerSize; | 59 m_containerSize = containerSize; |
60 } | 60 } |
61 | 61 |
62 // localToBorderBoxTransform maps local SVG viewport coordinates to local CS
S box coordinates. | 62 // localToBorderBoxTransform maps local SVG viewport coordinates to local CS
S box coordinates. |
63 const AffineTransform& localToBorderBoxTransform() const { return m_localToB
orderBoxTransform; } | 63 const AffineTransform& localToBorderBoxTransform() const { return m_localToB
orderBoxTransform; } |
64 bool shouldApplyViewportClip() const; | 64 bool shouldApplyViewportClip() const; |
65 | 65 |
66 private: | 66 private: |
67 RenderObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } | 67 RenderObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } |
68 RenderObject* lastChild() const { ASSERT(children() == virtualChildren()); r
eturn children()->lastChild(); } | 68 RenderObject* lastChild() const { ASSERT(children() == virtualChildren()); r
eturn children()->lastChild(); } |
69 | 69 |
70 const RenderObjectChildList* children() const { return &m_children; } | 70 const RenderObjectChildList* children() const { return &m_children; } |
71 RenderObjectChildList* children() { return &m_children; } | 71 RenderObjectChildList* children() { return &m_children; } |
72 | 72 |
73 virtual RenderObjectChildList* virtualChildren() OVERRIDE { return children(
); } | 73 virtual RenderObjectChildList* virtualChildren() override { return children(
); } |
74 virtual const RenderObjectChildList* virtualChildren() const OVERRIDE { retu
rn children(); } | 74 virtual const RenderObjectChildList* virtualChildren() const override { retu
rn children(); } |
75 | 75 |
76 virtual const char* renderName() const OVERRIDE { return "RenderSVGRoot"; } | 76 virtual const char* renderName() const override { return "RenderSVGRoot"; } |
77 virtual bool isSVGRoot() const OVERRIDE { return true; } | 77 virtual bool isSVGRoot() const override { return true; } |
78 virtual bool isSVG() const OVERRIDE { return true; } | 78 virtual bool isSVG() const override { return true; } |
79 | 79 |
80 virtual LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = Com
puteActual) const OVERRIDE; | 80 virtual LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = Com
puteActual) const override; |
81 virtual LayoutUnit computeReplacedLogicalHeight() const OVERRIDE; | 81 virtual LayoutUnit computeReplacedLogicalHeight() const override; |
82 virtual void layout() OVERRIDE; | 82 virtual void layout() override; |
83 virtual void paintReplaced(PaintInfo&, const LayoutPoint&) OVERRIDE; | 83 virtual void paintReplaced(PaintInfo&, const LayoutPoint&) override; |
84 | 84 |
85 virtual void willBeDestroyed() OVERRIDE; | 85 virtual void willBeDestroyed() override; |
86 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV
ERRIDE; | 86 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov
erride; |
87 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const OVERRIDE; | 87 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const override; |
88 virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) OV
ERRIDE; | 88 virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) ov
erride; |
89 virtual void removeChild(RenderObject*) OVERRIDE; | 89 virtual void removeChild(RenderObject*) override; |
90 virtual bool canHaveWhitespaceChildren() const OVERRIDE { return false; } | 90 virtual bool canHaveWhitespaceChildren() const override { return false; } |
91 | 91 |
92 virtual void insertedIntoTree() OVERRIDE; | 92 virtual void insertedIntoTree() override; |
93 virtual void willBeRemovedFromTree() OVERRIDE; | 93 virtual void willBeRemovedFromTree() override; |
94 | 94 |
95 virtual const AffineTransform& localToParentTransform() const OVERRIDE; | 95 virtual const AffineTransform& localToParentTransform() const override; |
96 | 96 |
97 virtual FloatRect objectBoundingBox() const OVERRIDE { return m_objectBoundi
ngBox; } | 97 virtual FloatRect objectBoundingBox() const override { return m_objectBoundi
ngBox; } |
98 virtual FloatRect strokeBoundingBox() const OVERRIDE { return m_strokeBoundi
ngBox; } | 98 virtual FloatRect strokeBoundingBox() const override { return m_strokeBoundi
ngBox; } |
99 virtual FloatRect paintInvalidationRectInLocalCoordinates() const OVERRIDE {
return m_paintInvalidationBoundingBox; } | 99 virtual FloatRect paintInvalidationRectInLocalCoordinates() const override {
return m_paintInvalidationBoundingBox; } |
100 | 100 |
101 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) OVERRIDE; | 101 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) override; |
102 | 102 |
103 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const RenderLayer
ModelObject* paintInvalidationContainer, const PaintInvalidationState* = 0) cons
t OVERRIDE; | 103 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const RenderLayer
ModelObject* paintInvalidationContainer, const PaintInvalidationState* = 0) cons
t override; |
104 virtual void computeFloatRectForPaintInvalidation(const RenderLayerModelObje
ct* paintInvalidationContainer, FloatRect& paintInvalidationRect, const PaintInv
alidationState* = 0) const OVERRIDE; | 104 virtual void computeFloatRectForPaintInvalidation(const RenderLayerModelObje
ct* paintInvalidationContainer, FloatRect& paintInvalidationRect, const PaintInv
alidationState* = 0) const override; |
105 | 105 |
106 virtual void mapLocalToContainer(const RenderLayerModelObject* paintInvalida
tionContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool*
wasFixed = 0, const PaintInvalidationState* = 0) const OVERRIDE; | 106 virtual void mapLocalToContainer(const RenderLayerModelObject* paintInvalida
tionContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool*
wasFixed = 0, const PaintInvalidationState* = 0) const override; |
107 virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap&) const OVERRIDE; | 107 virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap&) const override; |
108 | 108 |
109 virtual bool canBeSelectionLeaf() const OVERRIDE { return false; } | 109 virtual bool canBeSelectionLeaf() const override { return false; } |
110 virtual bool canHaveChildren() const OVERRIDE { return true; } | 110 virtual bool canHaveChildren() const override { return true; } |
111 | 111 |
112 void updateCachedBoundaries(); | 112 void updateCachedBoundaries(); |
113 void buildLocalToBorderBoxTransform(); | 113 void buildLocalToBorderBoxTransform(); |
114 | 114 |
115 RenderObjectChildList m_children; | 115 RenderObjectChildList m_children; |
116 IntSize m_containerSize; | 116 IntSize m_containerSize; |
117 FloatRect m_objectBoundingBox; | 117 FloatRect m_objectBoundingBox; |
118 bool m_objectBoundingBoxValid; | 118 bool m_objectBoundingBoxValid; |
119 FloatRect m_strokeBoundingBox; | 119 FloatRect m_strokeBoundingBox; |
120 FloatRect m_paintInvalidationBoundingBox; | 120 FloatRect m_paintInvalidationBoundingBox; |
121 mutable AffineTransform m_localToParentTransform; | 121 mutable AffineTransform m_localToParentTransform; |
122 AffineTransform m_localToBorderBoxTransform; | 122 AffineTransform m_localToBorderBoxTransform; |
123 bool m_isLayoutSizeChanged : 1; | 123 bool m_isLayoutSizeChanged : 1; |
124 bool m_needsBoundariesOrTransformUpdate : 1; | 124 bool m_needsBoundariesOrTransformUpdate : 1; |
125 bool m_hasBoxDecorationBackground : 1; | 125 bool m_hasBoxDecorationBackground : 1; |
126 }; | 126 }; |
127 | 127 |
128 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderSVGRoot, isSVGRoot()); | 128 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderSVGRoot, isSVGRoot()); |
129 | 129 |
130 } // namespace blink | 130 } // namespace blink |
131 | 131 |
132 #endif // RenderSVGRoot_h | 132 #endif // RenderSVGRoot_h |
OLD | NEW |