Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Side by Side Diff: Source/core/svg/SVGDocumentExtensions.h

Issue 268803005: Replace SVGDocument by XMLDocument (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix mentioned issues Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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,
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 SVGDocumentExtensions_h 21 #ifndef SVGDocumentExtensions_h
22 #define SVGDocumentExtensions_h 22 #define SVGDocumentExtensions_h
23 23
24 #include "platform/geometry/FloatPoint.h"
24 #include "wtf/Forward.h" 25 #include "wtf/Forward.h"
25 #include "wtf/HashMap.h" 26 #include "wtf/HashMap.h"
26 #include "wtf/HashSet.h" 27 #include "wtf/HashSet.h"
27 #include "wtf/text/AtomicStringHash.h" 28 #include "wtf/text/AtomicStringHash.h"
28 29
29 namespace WebCore { 30 namespace WebCore {
30 31
31 class Document; 32 class Document;
32 class RenderSVGResourceContainer; 33 class RenderSVGResourceContainer;
33 class SubtreeLayoutScope; 34 class SubtreeLayoutScope;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 79
79 #if ENABLE(SVG_FONTS) 80 #if ENABLE(SVG_FONTS)
80 const HashSet<SVGFontFaceElement*>& svgFontFaceElements() const { return m_s vgFontFaceElements; } 81 const HashSet<SVGFontFaceElement*>& svgFontFaceElements() const { return m_s vgFontFaceElements; }
81 void registerSVGFontFaceElement(SVGFontFaceElement*); 82 void registerSVGFontFaceElement(SVGFontFaceElement*);
82 void unregisterSVGFontFaceElement(SVGFontFaceElement*); 83 void unregisterSVGFontFaceElement(SVGFontFaceElement*);
83 84
84 void registerPendingSVGFontFaceElementsForRemoval(PassRefPtr<SVGFontFaceElem ent>); 85 void registerPendingSVGFontFaceElementsForRemoval(PassRefPtr<SVGFontFaceElem ent>);
85 void removePendingSVGFontFaceElementsForRemoval(); 86 void removePendingSVGFontFaceElementsForRemoval();
86 #endif 87 #endif
87 88
89 bool zoomAndPanEnabled() const;
90
91 void startPan(const FloatPoint& start);
92 void updatePan(const FloatPoint& pos) const;
93
94 static SVGSVGElement* rootElement(const Document&);
95
88 private: 96 private:
89 Document* m_document; // weak reference 97 Document* m_document; // weak reference
90 HashSet<SVGSVGElement*> m_timeContainers; // For SVG 1.2 support this will n eed to be made more general. 98 HashSet<SVGSVGElement*> m_timeContainers; // For SVG 1.2 support this will n eed to be made more general.
91 #if ENABLE(SVG_FONTS) 99 #if ENABLE(SVG_FONTS)
92 HashSet<SVGFontFaceElement*> m_svgFontFaceElements; 100 HashSet<SVGFontFaceElement*> m_svgFontFaceElements;
93 // SVGFontFaceElements that are pending and scheduled for removal. 101 // SVGFontFaceElements that are pending and scheduled for removal.
94 HashSet<RefPtr<SVGFontFaceElement> > m_pendingSVGFontFaceElementsForRemoval; 102 HashSet<RefPtr<SVGFontFaceElement> > m_pendingSVGFontFaceElementsForRemoval;
95 #endif 103 #endif
96 HashMap<AtomicString, RenderSVGResourceContainer*> m_resources; 104 HashMap<AtomicString, RenderSVGResourceContainer*> m_resources;
97 HashMap<AtomicString, OwnPtr<SVGPendingElements> > m_pendingResources; // Re sources that are pending. 105 HashMap<AtomicString, OwnPtr<SVGPendingElements> > m_pendingResources; // Re sources that are pending.
98 HashMap<AtomicString, OwnPtr<SVGPendingElements> > m_pendingResourcesForRemo val; // Resources that are pending and scheduled for removal. 106 HashMap<AtomicString, OwnPtr<SVGPendingElements> > m_pendingResourcesForRemo val; // Resources that are pending and scheduled for removal.
99 HashMap<SVGElement*, OwnPtr<HashSet<SVGElement*> > > m_elementDependencies; 107 HashMap<SVGElement*, OwnPtr<HashSet<SVGElement*> > > m_elementDependencies;
100 OwnPtr<SVGResourcesCache> m_resourcesCache; 108 OwnPtr<SVGResourcesCache> m_resourcesCache;
101 HashSet<SVGSVGElement*> m_relativeLengthSVGRoots; // Root SVG elements with relative length descendants. 109 HashSet<SVGSVGElement*> m_relativeLengthSVGRoots; // Root SVG elements with relative length descendants.
110 FloatPoint m_translate;
102 #if !ASSERT_DISABLED 111 #if !ASSERT_DISABLED
103 bool m_inRelativeLengthSVGRootsInvalidation; 112 bool m_inRelativeLengthSVGRootsInvalidation;
104 #endif 113 #endif
105 114
106 public: 115 public:
107 // This HashMap contains a list of pending resources. Pending resources, are such 116 // This HashMap contains a list of pending resources. Pending resources, are such
108 // which are referenced by any object in the SVG document, but do NOT exist yet. 117 // which are referenced by any object in the SVG document, but do NOT exist yet.
109 // For instance, dynamically build gradients / patterns / clippers... 118 // For instance, dynamically build gradients / patterns / clippers...
110 void addPendingResource(const AtomicString& id, Element*); 119 void addPendingResource(const AtomicString& id, Element*);
111 bool hasPendingResource(const AtomicString& id) const; 120 bool hasPendingResource(const AtomicString& id) const;
112 bool isElementPendingResources(Element*) const; 121 bool isElementPendingResources(Element*) const;
113 bool isElementPendingResource(Element*, const AtomicString& id) const; 122 bool isElementPendingResource(Element*, const AtomicString& id) const;
114 void clearHasPendingResourcesIfPossible(Element*); 123 void clearHasPendingResourcesIfPossible(Element*);
115 void removeElementFromPendingResources(Element*); 124 void removeElementFromPendingResources(Element*);
116 PassOwnPtr<SVGPendingElements> removePendingResource(const AtomicString& id) ; 125 PassOwnPtr<SVGPendingElements> removePendingResource(const AtomicString& id) ;
117 126
118 void serviceAnimations(double monotonicAnimationStartTime); 127 void serviceAnimations(double monotonicAnimationStartTime);
119 128
120 // The following two functions are used for scheduling a pending resource to be removed. 129 // The following two functions are used for scheduling a pending resource to be removed.
121 void markPendingResourcesForRemoval(const AtomicString&); 130 void markPendingResourcesForRemoval(const AtomicString&);
122 Element* removeElementFromPendingResourcesForRemoval(const AtomicString&); 131 Element* removeElementFromPendingResourcesForRemoval(const AtomicString&);
123 132
124 private: 133 private:
125 PassOwnPtr<SVGPendingElements> removePendingResourceForRemoval(const AtomicS tring&); 134 PassOwnPtr<SVGPendingElements> removePendingResourceForRemoval(const AtomicS tring&);
126 }; 135 };
127 136
128 } 137 }
129 138
130 #endif 139 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698