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 14 matching lines...) Expand all Loading... |
25 | 25 |
26 #include "core/layout/svg/LayoutSVGModelObject.h" | 26 #include "core/layout/svg/LayoutSVGModelObject.h" |
27 | 27 |
28 namespace blink { | 28 namespace blink { |
29 | 29 |
30 class SVGElement; | 30 class SVGElement; |
31 | 31 |
32 class LayoutSVGContainer : public LayoutSVGModelObject { | 32 class LayoutSVGContainer : public LayoutSVGModelObject { |
33 public: | 33 public: |
34 explicit LayoutSVGContainer(SVGElement*); | 34 explicit LayoutSVGContainer(SVGElement*); |
35 virtual ~LayoutSVGContainer(); | 35 ~LayoutSVGContainer() override; |
36 | 36 |
37 // If you have a LayoutSVGContainer, use firstChild or lastChild instead. | 37 // If you have a LayoutSVGContainer, use firstChild or lastChild instead. |
38 void slowFirstChild() const = delete; | 38 void slowFirstChild() const = delete; |
39 void slowLastChild() const = delete; | 39 void slowLastChild() const = delete; |
40 | 40 |
41 LayoutObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } | 41 LayoutObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } |
42 LayoutObject* lastChild() const { ASSERT(children() == virtualChildren()); r
eturn children()->lastChild(); } | 42 LayoutObject* lastChild() const { ASSERT(children() == virtualChildren()); r
eturn children()->lastChild(); } |
43 | 43 |
44 virtual void paint(const PaintInfo&, const LayoutPoint&) override; | 44 void paint(const PaintInfo&, const LayoutPoint&) override; |
45 virtual void styleDidChange(StyleDifference, const ComputedStyle* oldStyle)
override; | 45 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override
; |
46 virtual void setNeedsBoundariesUpdate() override final { m_needsBoundariesUp
date = true; } | 46 void setNeedsBoundariesUpdate() final { m_needsBoundariesUpdate = true; } |
47 virtual bool didTransformToRootUpdate() { return false; } | 47 virtual bool didTransformToRootUpdate() { return false; } |
48 bool isObjectBoundingBoxValid() const { return m_objectBoundingBoxValid; } | 48 bool isObjectBoundingBoxValid() const { return m_objectBoundingBoxValid; } |
49 | 49 |
50 bool selfWillPaint(); | 50 bool selfWillPaint(); |
51 | 51 |
52 virtual bool hasNonIsolatedBlendingDescendants() const override final; | 52 bool hasNonIsolatedBlendingDescendants() const final; |
53 | 53 |
54 virtual const char* name() const override { return "LayoutSVGContainer"; } | 54 const char* name() const override { return "LayoutSVGContainer"; } |
55 | 55 |
56 virtual FloatRect objectBoundingBox() const override final { return m_object
BoundingBox; } | 56 FloatRect objectBoundingBox() const final { return m_objectBoundingBox; } |
57 | 57 |
58 protected: | 58 protected: |
59 virtual LayoutObjectChildList* virtualChildren() override final { return chi
ldren(); } | 59 LayoutObjectChildList* virtualChildren() final { return children(); } |
60 virtual const LayoutObjectChildList* virtualChildren() const override final
{ return children(); } | 60 const LayoutObjectChildList* virtualChildren() const final { return children
(); } |
61 | 61 |
62 virtual bool isOfType(LayoutObjectType type) const override { return type ==
LayoutObjectSVGContainer || LayoutSVGModelObject::isOfType(type); } | 62 bool isOfType(LayoutObjectType type) const override { return type == LayoutO
bjectSVGContainer || LayoutSVGModelObject::isOfType(type); } |
63 virtual void layout() override; | 63 void layout() override; |
64 | 64 |
65 virtual void addChild(LayoutObject* child, LayoutObject* beforeChild = nullp
tr) override final; | 65 void addChild(LayoutObject* child, LayoutObject* beforeChild = nullptr) fina
l; |
66 virtual void removeChild(LayoutObject*) override final; | 66 void removeChild(LayoutObject*) final; |
67 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit
ionalOffset) const override final; | 67 void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& additionalOff
set) const final; |
68 | 68 |
69 virtual FloatRect strokeBoundingBox() const override final { return m_stroke
BoundingBox; } | 69 FloatRect strokeBoundingBox() const final { return m_strokeBoundingBox; } |
70 | 70 |
71 virtual bool nodeAtFloatPoint(HitTestResult&, const FloatPoint& pointInParen
t, HitTestAction) override; | 71 bool nodeAtFloatPoint(HitTestResult&, const FloatPoint& pointInParent, HitTe
stAction) override; |
72 | 72 |
73 // Allow LayoutSVGTransformableContainer to hook in at the right time in lay
out(). | 73 // Allow LayoutSVGTransformableContainer to hook in at the right time in lay
out(). |
74 virtual bool calculateLocalTransform() { return false; } | 74 virtual bool calculateLocalTransform() { return false; } |
75 | 75 |
76 // Allow LayoutSVGViewportContainer to hook in at the right times in layout(
) and nodeAtFloatPoint(). | 76 // Allow LayoutSVGViewportContainer to hook in at the right times in layout(
) and nodeAtFloatPoint(). |
77 virtual void calcViewport() { } | 77 virtual void calcViewport() { } |
78 virtual bool pointIsInsideViewportClip(const FloatPoint& /*pointInParent*/)
{ return true; } | 78 virtual bool pointIsInsideViewportClip(const FloatPoint& /*pointInParent*/)
{ return true; } |
79 | 79 |
80 virtual void determineIfLayoutSizeChanged() { } | 80 virtual void determineIfLayoutSizeChanged() { } |
81 | 81 |
82 void updateCachedBoundaries(); | 82 void updateCachedBoundaries(); |
83 | 83 |
84 virtual void descendantIsolationRequirementsChanged(DescendantIsolationState
) override final; | 84 void descendantIsolationRequirementsChanged(DescendantIsolationState) final; |
85 | 85 |
86 private: | 86 private: |
87 const LayoutObjectChildList* children() const { return &m_children; } | 87 const LayoutObjectChildList* children() const { return &m_children; } |
88 LayoutObjectChildList* children() { return &m_children; } | 88 LayoutObjectChildList* children() { return &m_children; } |
89 | 89 |
90 LayoutObjectChildList m_children; | 90 LayoutObjectChildList m_children; |
91 FloatRect m_objectBoundingBox; | 91 FloatRect m_objectBoundingBox; |
92 FloatRect m_strokeBoundingBox; | 92 FloatRect m_strokeBoundingBox; |
93 bool m_objectBoundingBoxValid; | 93 bool m_objectBoundingBoxValid; |
94 bool m_needsBoundariesUpdate; | 94 bool m_needsBoundariesUpdate; |
95 mutable bool m_hasNonIsolatedBlendingDescendants : 1; | 95 mutable bool m_hasNonIsolatedBlendingDescendants : 1; |
96 mutable bool m_hasNonIsolatedBlendingDescendantsDirty : 1; | 96 mutable bool m_hasNonIsolatedBlendingDescendantsDirty : 1; |
97 }; | 97 }; |
98 | 98 |
99 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGContainer, isSVGContainer()); | 99 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGContainer, isSVGContainer()); |
100 | 100 |
101 } // namespace blink | 101 } // namespace blink |
102 | 102 |
103 #endif // LayoutSVGContainer_h | 103 #endif // LayoutSVGContainer_h |
OLD | NEW |