OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | |
3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org> | |
4 * Copyright (C) 2009 Google, Inc. All rights reserved. | |
5 * Copyright (C) 2009 Apple Inc. All rights reserved. | |
6 * | |
7 * This library is free software; you can redistribute it and/or | |
8 * modify it under the terms of the GNU Library General Public | |
9 * License as published by the Free Software Foundation; either | |
10 * version 2 of the License, or (at your option) any later version. | |
11 * | |
12 * This library is distributed in the hope that it will be useful, | |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * Library General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Library General Public License | |
18 * along with this library; see the file COPYING.LIB. If not, write to | |
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
20 * Boston, MA 02110-1301, USA. | |
21 */ | |
22 | |
23 #ifndef RenderSVGContainer_h | |
24 #define RenderSVGContainer_h | |
25 | |
26 #include "core/rendering/svg/RenderSVGModelObject.h" | |
27 | |
28 namespace blink { | |
29 | |
30 class SVGElement; | |
31 | |
32 class RenderSVGContainer : public RenderSVGModelObject { | |
33 public: | |
34 explicit RenderSVGContainer(SVGElement*); | |
35 virtual ~RenderSVGContainer(); | |
36 | |
37 // If you have a RenderSVGContainer, use firstChild or lastChild instead. | |
38 void slowFirstChild() const = delete; | |
39 void slowLastChild() const = delete; | |
40 | |
41 LayoutObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } | |
42 LayoutObject* lastChild() const { ASSERT(children() == virtualChildren()); r
eturn children()->lastChild(); } | |
43 | |
44 virtual void paint(const PaintInfo&, const LayoutPoint&) override; | |
45 virtual void styleDidChange(StyleDifference, const LayoutStyle* oldStyle) ov
erride; | |
46 virtual void setNeedsBoundariesUpdate() override final { m_needsBoundariesUp
date = true; } | |
47 virtual bool didTransformToRootUpdate() { return false; } | |
48 bool isObjectBoundingBoxValid() const { return m_objectBoundingBoxValid; } | |
49 | |
50 bool selfWillPaint(); | |
51 | |
52 virtual bool hasNonIsolatedBlendingDescendants() const override final; | |
53 protected: | |
54 virtual LayoutObjectChildList* virtualChildren() override final { return chi
ldren(); } | |
55 virtual const LayoutObjectChildList* virtualChildren() const override final
{ return children(); } | |
56 | |
57 virtual bool isOfType(LayoutObjectType type) const override { return type ==
LayoutObjectSVGContainer || RenderSVGModelObject::isOfType(type); } | |
58 virtual const char* renderName() const override { return "RenderSVGContainer
"; } | |
59 | |
60 virtual void layout() override; | |
61 | |
62 virtual void addChild(LayoutObject* child, LayoutObject* beforeChild = 0) ov
erride final; | |
63 virtual void removeChild(LayoutObject*) override final; | |
64 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit
ionalOffset) const override final; | |
65 | |
66 virtual FloatRect objectBoundingBox() const override final { return m_object
BoundingBox; } | |
67 virtual FloatRect strokeBoundingBox() const override final { return m_stroke
BoundingBox; } | |
68 | |
69 virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const F
loatPoint& pointInParent, HitTestAction) override; | |
70 | |
71 // Allow RenderSVGTransformableContainer to hook in at the right time in lay
out(). | |
72 virtual bool calculateLocalTransform() { return false; } | |
73 | |
74 // Allow RenderSVGViewportContainer to hook in at the right times in layout(
) and nodeAtFloatPoint(). | |
75 virtual void calcViewport() { } | |
76 virtual bool pointIsInsideViewportClip(const FloatPoint& /*pointInParent*/)
{ return true; } | |
77 | |
78 virtual void determineIfLayoutSizeChanged() { } | |
79 | |
80 void updateCachedBoundaries(); | |
81 | |
82 virtual void descendantIsolationRequirementsChanged(DescendantIsolationState
) override final; | |
83 | |
84 private: | |
85 const LayoutObjectChildList* children() const { return &m_children; } | |
86 LayoutObjectChildList* children() { return &m_children; } | |
87 | |
88 LayoutObjectChildList m_children; | |
89 FloatRect m_objectBoundingBox; | |
90 FloatRect m_strokeBoundingBox; | |
91 bool m_objectBoundingBoxValid; | |
92 bool m_needsBoundariesUpdate; | |
93 mutable bool m_hasNonIsolatedBlendingDescendants : 1; | |
94 mutable bool m_hasNonIsolatedBlendingDescendantsDirty : 1; | |
95 }; | |
96 | |
97 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(RenderSVGContainer, isSVGContainer()); | |
98 | |
99 } // namespace blink | |
100 | |
101 #endif // RenderSVGContainer_h | |
OLD | NEW |