OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Inc. All rights reserved. |
3 * Copyright (C) 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2006, 2008 Nikolas Zimmermann <zimmermann@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 14 matching lines...) Expand all Loading... |
25 #include "platform/geometry/FloatPoint.h" | 25 #include "platform/geometry/FloatPoint.h" |
26 #include "platform/heap/Handle.h" | 26 #include "platform/heap/Handle.h" |
27 #include "wtf/Forward.h" | 27 #include "wtf/Forward.h" |
28 #include "wtf/HashMap.h" | 28 #include "wtf/HashMap.h" |
29 #include "wtf/HashSet.h" | 29 #include "wtf/HashSet.h" |
30 #include "wtf/text/AtomicStringHash.h" | 30 #include "wtf/text/AtomicStringHash.h" |
31 | 31 |
32 namespace blink { | 32 namespace blink { |
33 | 33 |
34 class Document; | 34 class Document; |
| 35 class Element; |
35 class LayoutSVGResourceContainer; | 36 class LayoutSVGResourceContainer; |
| 37 class SVGElement; |
| 38 class SVGElementProxy; |
| 39 class SVGElementProxySet; |
| 40 class SVGSVGElement; |
36 class SubtreeLayoutScope; | 41 class SubtreeLayoutScope; |
37 class SVGSVGElement; | |
38 class SVGElement; | |
39 class Element; | |
40 | 42 |
41 class SVGDocumentExtensions | 43 class SVGDocumentExtensions |
42 : public GarbageCollectedFinalized<SVGDocumentExtensions> { | 44 : public GarbageCollectedFinalized<SVGDocumentExtensions> { |
43 WTF_MAKE_NONCOPYABLE(SVGDocumentExtensions); | 45 WTF_MAKE_NONCOPYABLE(SVGDocumentExtensions); |
44 | 46 |
45 public: | 47 public: |
46 typedef HeapHashSet<Member<Element>> SVGPendingElements; | 48 typedef HeapHashSet<Member<Element>> SVGPendingElements; |
47 explicit SVGDocumentExtensions(Document*); | 49 explicit SVGDocumentExtensions(Document*); |
48 ~SVGDocumentExtensions(); | 50 ~SVGDocumentExtensions(); |
49 | 51 |
(...skipping 28 matching lines...) Expand all Loading... |
78 void startPan(const FloatPoint& start); | 80 void startPan(const FloatPoint& start); |
79 void updatePan(const FloatPoint& pos) const; | 81 void updatePan(const FloatPoint& pos) const; |
80 | 82 |
81 static SVGSVGElement* rootElement(const Document&); | 83 static SVGSVGElement* rootElement(const Document&); |
82 SVGSVGElement* rootElement() const; | 84 SVGSVGElement* rootElement() const; |
83 | 85 |
84 DECLARE_TRACE(); | 86 DECLARE_TRACE(); |
85 | 87 |
86 private: | 88 private: |
87 Member<Document> m_document; | 89 Member<Document> m_document; |
88 // For SVG 1.2 support this will need to be made more general. | |
89 HeapHashSet<Member<SVGSVGElement>> m_timeContainers; | 90 HeapHashSet<Member<SVGSVGElement>> m_timeContainers; |
90 using SVGElementSet = HeapHashSet<Member<SVGElement>>; | 91 using SVGElementSet = HeapHashSet<Member<SVGElement>>; |
91 SVGElementSet m_webAnimationsPendingSVGElements; | 92 SVGElementSet m_webAnimationsPendingSVGElements; |
92 HashMap<AtomicString, LayoutSVGResourceContainer*> m_resources; | 93 HashMap<AtomicString, LayoutSVGResourceContainer*> m_resources; |
93 // Resources that are pending. | 94 // Resources that are pending. |
94 HeapHashMap<AtomicString, Member<SVGPendingElements>> m_pendingResources; | 95 HeapHashMap<AtomicString, Member<SVGPendingElements>> m_pendingResources; |
| 96 HeapHashMap<AtomicString, Member<SVGElementProxySet>> m_pendingProxies; |
95 // Resources that are pending and scheduled for removal. | 97 // Resources that are pending and scheduled for removal. |
96 HeapHashMap<AtomicString, Member<SVGPendingElements>> | 98 HeapHashMap<AtomicString, Member<SVGPendingElements>> |
97 m_pendingResourcesForRemoval; | 99 m_pendingResourcesForRemoval; |
98 SVGResourcesCache m_resourcesCache; | 100 SVGResourcesCache m_resourcesCache; |
99 // Root SVG elements with relative length descendants. | 101 // Root SVG elements with relative length descendants. |
100 HeapHashSet<Member<SVGSVGElement>> m_relativeLengthSVGRoots; | 102 HeapHashSet<Member<SVGSVGElement>> m_relativeLengthSVGRoots; |
101 FloatPoint m_translate; | 103 FloatPoint m_translate; |
102 #if ENABLE(ASSERT) | 104 #if ENABLE(ASSERT) |
103 bool m_inRelativeLengthSVGRootsInvalidation; | 105 bool m_inRelativeLengthSVGRootsInvalidation; |
104 #endif | 106 #endif |
105 | 107 |
106 public: | 108 public: |
107 // This HashMap contains a list of pending resources. Pending resources, are | 109 // This HashMap contains a list of pending resources. Pending resources, are |
108 // such which are referenced by any object in the SVG document, but do NOT | 110 // such which are referenced by any object in the SVG document, but do NOT |
109 // exist yet. | 111 // exist yet. |
110 // For instance, dynamically build gradients / patterns / clippers... | 112 // For instance, dynamically build gradients / patterns / clippers... |
111 void addPendingResource(const AtomicString& id, Element*); | 113 void addPendingResource(const AtomicString& id, Element*); |
112 bool hasPendingResource(const AtomicString& id) const; | 114 bool hasPendingResource(const AtomicString& id) const; |
113 bool isElementPendingResources(Element*) const; | 115 bool isElementPendingResources(Element*) const; |
114 bool isElementPendingResource(Element*, const AtomicString& id) const; | 116 bool isElementPendingResource(Element*, const AtomicString& id) const; |
115 void clearHasPendingResourcesIfPossible(Element*); | 117 void clearHasPendingResourcesIfPossible(Element*); |
116 void removeElementFromPendingResources(Element*); | 118 void removeElementFromPendingResources(Element*); |
117 SVGPendingElements* removePendingResource(const AtomicString& id); | 119 SVGPendingElements* removePendingResource(const AtomicString& id); |
| 120 void attachPendingProxy(SVGElementProxy&); |
| 121 void invalidatePendingProxies(const AtomicString& id); |
118 | 122 |
119 void serviceAnimations(); | 123 void serviceAnimations(); |
120 | 124 |
121 // The following two functions are used for scheduling a pending resource to | 125 // The following two functions are used for scheduling a pending resource to |
122 // be removed. | 126 // be removed. |
123 void markPendingResourcesForRemoval(const AtomicString&); | 127 void markPendingResourcesForRemoval(const AtomicString&); |
124 Element* removeElementFromPendingResourcesForRemoval(const AtomicString&); | 128 Element* removeElementFromPendingResourcesForRemoval(const AtomicString&); |
125 | 129 |
126 private: | 130 private: |
127 SVGPendingElements* removePendingResourceForRemoval(const AtomicString&); | 131 SVGPendingElements* removePendingResourceForRemoval(const AtomicString&); |
128 }; | 132 }; |
129 | 133 |
130 } // namespace blink | 134 } // namespace blink |
131 | 135 |
132 #endif | 136 #endif |
OLD | NEW |