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, |
(...skipping 13 matching lines...) Loading... |
24 #include "SVGNames.h" | 24 #include "SVGNames.h" |
25 #include "core/fetch/DocumentResource.h" | 25 #include "core/fetch/DocumentResource.h" |
26 #include "core/svg/SVGAnimatedBoolean.h" | 26 #include "core/svg/SVGAnimatedBoolean.h" |
27 #include "core/svg/SVGAnimatedLength.h" | 27 #include "core/svg/SVGAnimatedLength.h" |
28 #include "core/svg/SVGGraphicsElement.h" | 28 #include "core/svg/SVGGraphicsElement.h" |
29 #include "core/svg/SVGURIReference.h" | 29 #include "core/svg/SVGURIReference.h" |
30 | 30 |
31 namespace WebCore { | 31 namespace WebCore { |
32 | 32 |
33 class DocumentResource; | 33 class DocumentResource; |
34 class SVGElementInstance; | |
35 | 34 |
36 class SVGUseElement FINAL : public SVGGraphicsElement, | 35 class SVGUseElement FINAL : public SVGGraphicsElement, |
37 public SVGURIReference, | 36 public SVGURIReference, |
38 public DocumentResourceClient { | 37 public DocumentResourceClient { |
39 public: | 38 public: |
40 static PassRefPtrWillBeRawPtr<SVGUseElement> create(Document&); | 39 static PassRefPtrWillBeRawPtr<SVGUseElement> create(Document&); |
41 virtual ~SVGUseElement(); | 40 virtual ~SVGUseElement(); |
42 | 41 |
43 SVGElementInstance* instanceRoot(); | |
44 SVGElementInstance* animatedInstanceRoot() const; | |
45 void invalidateShadowTree(); | 42 void invalidateShadowTree(); |
46 void invalidateDependentShadowTrees(); | |
47 | 43 |
48 RenderObject* rendererClipChild() const; | 44 RenderObject* rendererClipChild() const; |
49 | 45 |
50 SVGAnimatedLength* x() const { return m_x.get(); } | 46 SVGAnimatedLength* x() const { return m_x.get(); } |
51 SVGAnimatedLength* y() const { return m_y.get(); } | 47 SVGAnimatedLength* y() const { return m_y.get(); } |
52 SVGAnimatedLength* width() const { return m_width.get(); } | 48 SVGAnimatedLength* width() const { return m_width.get(); } |
53 SVGAnimatedLength* height() const { return m_height.get(); } | 49 SVGAnimatedLength* height() const { return m_height.get(); } |
54 | 50 |
55 virtual void buildPendingResource() OVERRIDE; | 51 virtual void buildPendingResource() OVERRIDE; |
56 | 52 |
(...skipping 16 matching lines...) Loading... |
73 | 69 |
74 void clearResourceReferences(); | 70 void clearResourceReferences(); |
75 void buildShadowAndInstanceTree(SVGElement* target); | 71 void buildShadowAndInstanceTree(SVGElement* target); |
76 | 72 |
77 void scheduleShadowTreeRecreation(); | 73 void scheduleShadowTreeRecreation(); |
78 virtual bool haveLoadedRequiredResources() OVERRIDE { return !isStructurally
External() || m_haveFiredLoadEvent; } | 74 virtual bool haveLoadedRequiredResources() OVERRIDE { return !isStructurally
External() || m_haveFiredLoadEvent; } |
79 | 75 |
80 virtual bool selfHasRelativeLengths() const OVERRIDE; | 76 virtual bool selfHasRelativeLengths() const OVERRIDE; |
81 | 77 |
82 // Instance tree handling | 78 // Instance tree handling |
83 void buildInstanceTree(SVGElement* target, SVGElementInstance* targetInstanc
e, bool& foundCycle, bool foundUse); | 79 void buildShadowTree(SVGElement* target, SVGElement* targetInstance, bool& f
oundProblem, bool foundUse); |
84 bool hasCycleUseReferencing(SVGUseElement*, SVGElementInstance* targetInstan
ce, SVGElement*& newTarget); | 80 bool hasCycleUseReferencing(SVGUseElement*, ContainerNode* targetInstance, S
VGElement*& newTarget); |
85 | 81 void expandUseElementsInShadowTree(SVGElement*, bool& foundProblem); |
86 // Shadow tree handling | 82 void expandSymbolElementsInShadowTree(SVGElement*); |
87 void buildShadowTree(SVGElement* target, SVGElementInstance* targetInstance,
ShadowRoot* shadowTreeRootElement); | |
88 | |
89 void expandUseElementsInShadowTree(Node* element); | |
90 void expandSymbolElementsInShadowTree(Node* element); | |
91 | |
92 // "Tree connector" | |
93 void associateInstancesWithShadowTreeElements(Node* target, SVGElementInstan
ce* targetInstance); | |
94 | 83 |
95 void transferUseAttributesToReplacedElement(SVGElement* from, SVGElement* to
) const; | 84 void transferUseAttributesToReplacedElement(SVGElement* from, SVGElement* to
) const; |
96 void transferEventListenersToShadowTree(SVGElement* shadowTreeTargetElement)
; | 85 |
| 86 void invalidateDependentShadowTrees(); |
| 87 |
| 88 bool resourceIsStillLoading(); |
| 89 Document* externalDocument() const; |
| 90 bool instanceTreeIsLoading(SVGElement*); |
| 91 virtual void notifyFinished(Resource*) OVERRIDE; |
| 92 TreeScope* referencedScope() const; |
| 93 void setDocumentResource(ResourcePtr<DocumentResource>); |
| 94 |
| 95 virtual Timer<SVGElement>* svgLoadEventTimer() OVERRIDE { return &m_svgLoadE
ventTimer; } |
97 | 96 |
98 RefPtr<SVGAnimatedLength> m_x; | 97 RefPtr<SVGAnimatedLength> m_x; |
99 RefPtr<SVGAnimatedLength> m_y; | 98 RefPtr<SVGAnimatedLength> m_y; |
100 RefPtr<SVGAnimatedLength> m_width; | 99 RefPtr<SVGAnimatedLength> m_width; |
101 RefPtr<SVGAnimatedLength> m_height; | 100 RefPtr<SVGAnimatedLength> m_height; |
102 | 101 |
103 bool resourceIsStillLoading(); | |
104 Document* externalDocument() const; | |
105 bool instanceTreeIsLoading(SVGElementInstance*); | |
106 virtual void notifyFinished(Resource*) OVERRIDE; | |
107 TreeScope* referencedScope() const; | |
108 void setDocumentResource(ResourcePtr<DocumentResource>); | |
109 | |
110 virtual Timer<SVGElement>* svgLoadEventTimer() OVERRIDE { return &m_svgLoadE
ventTimer; } | |
111 | |
112 bool m_haveFiredLoadEvent; | 102 bool m_haveFiredLoadEvent; |
113 bool m_needsShadowTreeRecreation; | 103 bool m_needsShadowTreeRecreation; |
114 RefPtrWillBeMember<SVGElementInstance> m_targetElementInstance; | 104 RefPtrWillBeMember<SVGElement> m_targetElementInstance; |
115 ResourcePtr<DocumentResource> m_resource; | 105 ResourcePtr<DocumentResource> m_resource; |
116 Timer<SVGElement> m_svgLoadEventTimer; | 106 Timer<SVGElement> m_svgLoadEventTimer; |
117 }; | 107 }; |
118 | 108 |
119 } | 109 } |
120 | 110 |
121 #endif | 111 #endif |
OLD | NEW |