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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 WTF_MAKE_NONCOPYABLE(SVGDocumentExtensions); | 43 WTF_MAKE_NONCOPYABLE(SVGDocumentExtensions); |
44 | 44 |
45 public: | 45 public: |
46 typedef HeapHashSet<Member<Element>> SVGPendingElements; | 46 typedef HeapHashSet<Member<Element>> SVGPendingElements; |
47 explicit SVGDocumentExtensions(Document*); | 47 explicit SVGDocumentExtensions(Document*); |
48 ~SVGDocumentExtensions(); | 48 ~SVGDocumentExtensions(); |
49 | 49 |
50 void addTimeContainer(SVGSVGElement*); | 50 void addTimeContainer(SVGSVGElement*); |
51 void removeTimeContainer(SVGSVGElement*); | 51 void removeTimeContainer(SVGSVGElement*); |
52 | 52 |
53 // Records the SVG element as having a Web Animation on an SVG attribute that
needs applying. | 53 // Records the SVG element as having a Web Animation on an SVG attribute that |
| 54 // needs applying. |
54 void addWebAnimationsPendingSVGElement(SVGElement&); | 55 void addWebAnimationsPendingSVGElement(SVGElement&); |
55 | 56 |
56 void addResource(const AtomicString& id, LayoutSVGResourceContainer*); | 57 void addResource(const AtomicString& id, LayoutSVGResourceContainer*); |
57 void removeResource(const AtomicString& id); | 58 void removeResource(const AtomicString& id); |
58 LayoutSVGResourceContainer* resourceById(const AtomicString& id) const; | 59 LayoutSVGResourceContainer* resourceById(const AtomicString& id) const; |
59 | 60 |
60 static void serviceOnAnimationFrame(Document&); | 61 static void serviceOnAnimationFrame(Document&); |
61 | 62 |
62 void startAnimations(); | 63 void startAnimations(); |
63 void pauseAnimations(); | 64 void pauseAnimations(); |
(...skipping 13 matching lines...) Expand all Loading... |
77 void startPan(const FloatPoint& start); | 78 void startPan(const FloatPoint& start); |
78 void updatePan(const FloatPoint& pos) const; | 79 void updatePan(const FloatPoint& pos) const; |
79 | 80 |
80 static SVGSVGElement* rootElement(const Document&); | 81 static SVGSVGElement* rootElement(const Document&); |
81 SVGSVGElement* rootElement() const; | 82 SVGSVGElement* rootElement() const; |
82 | 83 |
83 DECLARE_TRACE(); | 84 DECLARE_TRACE(); |
84 | 85 |
85 private: | 86 private: |
86 Member<Document> m_document; | 87 Member<Document> m_document; |
87 HeapHashSet<Member<SVGSVGElement>> | 88 // For SVG 1.2 support this will need to be made more general. |
88 m_timeContainers; // For SVG 1.2 support this will need to be made more g
eneral. | 89 HeapHashSet<Member<SVGSVGElement>> m_timeContainers; |
89 using SVGElementSet = HeapHashSet<Member<SVGElement>>; | 90 using SVGElementSet = HeapHashSet<Member<SVGElement>>; |
90 SVGElementSet m_webAnimationsPendingSVGElements; | 91 SVGElementSet m_webAnimationsPendingSVGElements; |
91 HashMap<AtomicString, LayoutSVGResourceContainer*> m_resources; | 92 HashMap<AtomicString, LayoutSVGResourceContainer*> m_resources; |
| 93 // Resources that are pending. |
| 94 HeapHashMap<AtomicString, Member<SVGPendingElements>> m_pendingResources; |
| 95 // Resources that are pending and scheduled for removal. |
92 HeapHashMap<AtomicString, Member<SVGPendingElements>> | 96 HeapHashMap<AtomicString, Member<SVGPendingElements>> |
93 m_pendingResources; // Resources that are pending. | 97 m_pendingResourcesForRemoval; |
94 HeapHashMap<AtomicString, Member<SVGPendingElements>> | |
95 m_pendingResourcesForRemoval; // Resources that are pending and scheduled
for removal. | |
96 SVGResourcesCache m_resourcesCache; | 98 SVGResourcesCache m_resourcesCache; |
97 HeapHashSet<Member<SVGSVGElement>> | 99 // Root SVG elements with relative length descendants. |
98 m_relativeLengthSVGRoots; // Root SVG elements with relative length desce
ndants. | 100 HeapHashSet<Member<SVGSVGElement>> m_relativeLengthSVGRoots; |
99 FloatPoint m_translate; | 101 FloatPoint m_translate; |
100 #if ENABLE(ASSERT) | 102 #if ENABLE(ASSERT) |
101 bool m_inRelativeLengthSVGRootsInvalidation; | 103 bool m_inRelativeLengthSVGRootsInvalidation; |
102 #endif | 104 #endif |
103 | 105 |
104 public: | 106 public: |
105 // This HashMap contains a list of pending resources. Pending resources, are s
uch | 107 // This HashMap contains a list of pending resources. Pending resources, are |
106 // which are referenced by any object in the SVG document, but do NOT exist ye
t. | 108 // such which are referenced by any object in the SVG document, but do NOT |
| 109 // exist yet. |
107 // For instance, dynamically build gradients / patterns / clippers... | 110 // For instance, dynamically build gradients / patterns / clippers... |
108 void addPendingResource(const AtomicString& id, Element*); | 111 void addPendingResource(const AtomicString& id, Element*); |
109 bool hasPendingResource(const AtomicString& id) const; | 112 bool hasPendingResource(const AtomicString& id) const; |
110 bool isElementPendingResources(Element*) const; | 113 bool isElementPendingResources(Element*) const; |
111 bool isElementPendingResource(Element*, const AtomicString& id) const; | 114 bool isElementPendingResource(Element*, const AtomicString& id) const; |
112 void clearHasPendingResourcesIfPossible(Element*); | 115 void clearHasPendingResourcesIfPossible(Element*); |
113 void removeElementFromPendingResources(Element*); | 116 void removeElementFromPendingResources(Element*); |
114 SVGPendingElements* removePendingResource(const AtomicString& id); | 117 SVGPendingElements* removePendingResource(const AtomicString& id); |
115 | 118 |
116 void serviceAnimations(); | 119 void serviceAnimations(); |
117 | 120 |
118 // The following two functions are used for scheduling a pending resource to b
e removed. | 121 // The following two functions are used for scheduling a pending resource to |
| 122 // be removed. |
119 void markPendingResourcesForRemoval(const AtomicString&); | 123 void markPendingResourcesForRemoval(const AtomicString&); |
120 Element* removeElementFromPendingResourcesForRemoval(const AtomicString&); | 124 Element* removeElementFromPendingResourcesForRemoval(const AtomicString&); |
121 | 125 |
122 private: | 126 private: |
123 SVGPendingElements* removePendingResourceForRemoval(const AtomicString&); | 127 SVGPendingElements* removePendingResourceForRemoval(const AtomicString&); |
124 }; | 128 }; |
125 | 129 |
126 } // namespace blink | 130 } // namespace blink |
127 | 131 |
128 #endif | 132 #endif |
OLD | NEW |