OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org> | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 */ | 19 */ |
20 | 20 |
21 #ifndef SVGUseElement_h | 21 #ifndef SVGUseElement_h |
22 #define SVGUseElement_h | 22 #define SVGUseElement_h |
23 | 23 |
24 #include "core/events/EventSender.h" | 24 #include "core/events/EventSender.h" |
25 #include "core/fetch/DocumentResource.h" | 25 #include "core/fetch/DocumentResource.h" |
26 #include "core/svg/SVGAnimatedLength.h" | 26 #include "core/svg/SVGAnimatedLength.h" |
27 #include "core/svg/SVGGeometryElement.h" | |
27 #include "core/svg/SVGGraphicsElement.h" | 28 #include "core/svg/SVGGraphicsElement.h" |
28 #include "core/svg/SVGURIReference.h" | 29 #include "core/svg/SVGURIReference.h" |
29 #include "platform/heap/Handle.h" | 30 #include "platform/heap/Handle.h" |
30 | 31 |
31 namespace blink { | 32 namespace blink { |
32 | 33 |
33 typedef EventSender<SVGUseElement> SVGUseEventSender; | 34 typedef EventSender<SVGUseElement> SVGUseEventSender; |
34 | 35 |
35 class SVGUseElement final : public SVGGraphicsElement, | 36 class SVGUseElement final : public SVGGraphicsElement, |
36 public SVGURIReference, | 37 public SVGURIReference, |
37 public DocumentResourceClient { | 38 public DocumentResourceClient { |
38 DEFINE_WRAPPERTYPEINFO(); | 39 DEFINE_WRAPPERTYPEINFO(); |
39 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SVGUseElement); | 40 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SVGUseElement); |
40 public: | 41 public: |
41 static PassRefPtrWillBeRawPtr<SVGUseElement> create(Document&); | 42 static PassRefPtrWillBeRawPtr<SVGUseElement> create(Document&); |
42 virtual ~SVGUseElement(); | 43 virtual ~SVGUseElement(); |
43 | 44 |
44 void invalidateShadowTree(); | 45 void invalidateShadowTree(); |
45 | 46 |
47 SVGGraphicsElement* targetGraphicsElementForClipping() const; | |
pdr.
2015/06/17 04:42:13
Please add a comment describing this.
Something l
| |
46 LayoutObject* layoutObjectClipChild() const; | 48 LayoutObject* layoutObjectClipChild() const; |
47 | 49 |
48 SVGAnimatedLength* x() const { return m_x.get(); } | 50 SVGAnimatedLength* x() const { return m_x.get(); } |
49 SVGAnimatedLength* y() const { return m_y.get(); } | 51 SVGAnimatedLength* y() const { return m_y.get(); } |
50 SVGAnimatedLength* width() const { return m_width.get(); } | 52 SVGAnimatedLength* width() const { return m_width.get(); } |
51 SVGAnimatedLength* height() const { return m_height.get(); } | 53 SVGAnimatedLength* height() const { return m_height.get(); } |
52 | 54 |
53 virtual void buildPendingResource() override; | 55 virtual void buildPendingResource() override; |
54 | 56 |
55 void dispatchPendingEvent(SVGUseEventSender*); | 57 void dispatchPendingEvent(SVGUseEventSender*); |
58 void toClipPath(Path&); | |
56 | 59 |
57 DECLARE_VIRTUAL_TRACE(); | 60 DECLARE_VIRTUAL_TRACE(); |
58 | 61 |
59 private: | 62 private: |
60 explicit SVGUseElement(Document&); | 63 explicit SVGUseElement(Document&); |
61 | 64 |
62 virtual bool isPresentationAttribute(const QualifiedName&) const override; | 65 virtual bool isPresentationAttribute(const QualifiedName&) const override; |
63 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons t AtomicString&, MutableStylePropertySet*) override; | 66 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons t AtomicString&, MutableStylePropertySet*) override; |
64 virtual bool isPresentationAttributeWithSVGDOM(const QualifiedName&) const o verride; | 67 virtual bool isPresentationAttributeWithSVGDOM(const QualifiedName&) const o verride; |
65 | 68 |
66 virtual bool isStructurallyExternal() const override { return !hrefString(). isNull() && isExternalURIReference(hrefString(), document()); } | 69 virtual bool isStructurallyExternal() const override { return !hrefString(). isNull() && isExternalURIReference(hrefString(), document()); } |
67 | 70 |
68 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; | 71 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; |
69 virtual void removedFrom(ContainerNode*) override; | 72 virtual void removedFrom(ContainerNode*) override; |
70 | 73 |
71 virtual void svgAttributeChanged(const QualifiedName&) override; | 74 virtual void svgAttributeChanged(const QualifiedName&) override; |
72 | 75 |
73 virtual LayoutObject* createLayoutObject(const ComputedStyle&) override; | 76 virtual LayoutObject* createLayoutObject(const ComputedStyle&) override; |
74 virtual void toClipPath(Path&) override; | |
75 | 77 |
76 void clearResourceReferences(); | 78 void clearResourceReferences(); |
77 void buildShadowAndInstanceTree(SVGElement* target); | 79 void buildShadowAndInstanceTree(SVGElement* target); |
78 | 80 |
79 void scheduleShadowTreeRecreation(); | 81 void scheduleShadowTreeRecreation(); |
80 virtual bool haveLoadedRequiredResources() override { return !isStructurally External() || m_haveFiredLoadEvent; } | 82 virtual bool haveLoadedRequiredResources() override { return !isStructurally External() || m_haveFiredLoadEvent; } |
81 | 83 |
82 virtual bool selfHasRelativeLengths() const override; | 84 virtual bool selfHasRelativeLengths() const override; |
83 | 85 |
84 // Instance tree handling | 86 // Instance tree handling |
(...skipping 20 matching lines...) Expand all Loading... | |
105 | 107 |
106 bool m_haveFiredLoadEvent; | 108 bool m_haveFiredLoadEvent; |
107 bool m_needsShadowTreeRecreation; | 109 bool m_needsShadowTreeRecreation; |
108 RefPtrWillBeMember<SVGElement> m_targetElementInstance; | 110 RefPtrWillBeMember<SVGElement> m_targetElementInstance; |
109 ResourcePtr<DocumentResource> m_resource; | 111 ResourcePtr<DocumentResource> m_resource; |
110 }; | 112 }; |
111 | 113 |
112 } // namespace blink | 114 } // namespace blink |
113 | 115 |
114 #endif // SVGUseElement_h | 116 #endif // SVGUseElement_h |
OLD | NEW |