OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2009 Apple Inc. All rights reserved. | 4 * Copyright (C) 2009 Apple Inc. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 177 |
178 bool hasSVGRareData() const { return m_hasSVGRareData; } | 178 bool hasSVGRareData() const { return m_hasSVGRareData; } |
179 void setHasSVGRareData() { m_hasSVGRareData = true; } | 179 void setHasSVGRareData() { m_hasSVGRareData = true; } |
180 void clearHasSVGRareData() { m_hasSVGRareData = false; } | 180 void clearHasSVGRareData() { m_hasSVGRareData = false; } |
181 | 181 |
182 // SVGFitToViewBox::parseAttribute uses reportAttributeParsingError. | 182 // SVGFitToViewBox::parseAttribute uses reportAttributeParsingError. |
183 friend class SVGFitToViewBox; | 183 friend class SVGFitToViewBox; |
184 void reportAttributeParsingError(SVGParsingError, const QualifiedName&, cons
t AtomicString&); | 184 void reportAttributeParsingError(SVGParsingError, const QualifiedName&, cons
t AtomicString&); |
185 bool hasFocusEventListeners() const; | 185 bool hasFocusEventListeners() const; |
186 | 186 |
187 class CleanUpAnimatedPropertiesCaller { | |
188 public: | |
189 CleanUpAnimatedPropertiesCaller() | |
190 : m_owner(0) | |
191 { | |
192 } | |
193 | |
194 ~CleanUpAnimatedPropertiesCaller() | |
195 { | |
196 ASSERT(m_owner); | |
197 m_owner->cleanupAnimatedProperties(); | |
198 } | |
199 | |
200 void setOwner(SVGElement* owner) { m_owner = owner; } | |
201 | |
202 private: | |
203 SVGElement* m_owner; | |
204 }; | |
205 | |
206 private: | 187 private: |
207 friend class SVGElementInstance; | 188 friend class SVGElementInstance; |
208 | 189 |
209 // FIXME: Author shadows should be allowed | 190 // FIXME: Author shadows should be allowed |
210 // https://bugs.webkit.org/show_bug.cgi?id=77938 | 191 // https://bugs.webkit.org/show_bug.cgi?id=77938 |
211 virtual bool areAuthorShadowsAllowed() const OVERRIDE FINAL { return false;
} | 192 virtual bool areAuthorShadowsAllowed() const OVERRIDE FINAL { return false;
} |
212 | 193 |
213 RenderStyle* computedStyle(PseudoId = NOPSEUDO); | 194 RenderStyle* computedStyle(PseudoId = NOPSEUDO); |
214 virtual RenderStyle* virtualComputedStyle(PseudoId pseudoElementSpecifier =
NOPSEUDO) OVERRIDE FINAL { return computedStyle(pseudoElementSpecifier); } | 195 virtual RenderStyle* virtualComputedStyle(PseudoId pseudoElementSpecifier =
NOPSEUDO) OVERRIDE FINAL { return computedStyle(pseudoElementSpecifier); } |
215 virtual void willRecalcStyle(StyleRecalcChange) OVERRIDE; | 196 virtual void willRecalcStyle(StyleRecalcChange) OVERRIDE; |
216 virtual bool isKeyboardFocusable() const OVERRIDE; | 197 virtual bool isKeyboardFocusable() const OVERRIDE; |
217 | 198 |
218 void buildPendingResourcesIfNeeded(); | 199 void buildPendingResourcesIfNeeded(); |
219 | 200 |
220 void mapInstanceToElement(SVGElementInstance*); | 201 void mapInstanceToElement(SVGElementInstance*); |
221 void removeInstanceMapping(SVGElementInstance*); | 202 void removeInstanceMapping(SVGElementInstance*); |
222 | 203 |
223 void cleanupAnimatedProperties(); | 204 void cleanupAnimatedProperties(); |
224 friend class CleanUpAnimatedPropertiesCaller; | 205 friend class CleanUpAnimatedPropertiesCaller; |
225 | 206 |
226 HashSet<SVGElement*> m_elementsWithRelativeLengths; | 207 HashSet<SVGElement*> m_elementsWithRelativeLengths; |
227 | 208 |
228 typedef HashMap<QualifiedName, RefPtr<NewSVGAnimatedPropertyBase> > Attribut
eToPropertyMap; | 209 typedef HashMap<QualifiedName, RefPtr<NewSVGAnimatedPropertyBase> > Attribut
eToPropertyMap; |
229 AttributeToPropertyMap m_newAttributeToPropertyMap; | 210 AttributeToPropertyMap m_newAttributeToPropertyMap; |
230 | 211 |
231 #if !ASSERT_DISABLED | 212 #if !ASSERT_DISABLED |
232 bool m_inRelativeLengthClientsInvalidation; | 213 bool m_inRelativeLengthClientsInvalidation; |
233 #endif | 214 #endif |
234 unsigned m_animatedPropertiesDestructed : 1; | |
235 unsigned m_isContextElement : 1; | 215 unsigned m_isContextElement : 1; |
236 unsigned m_hasSVGRareData : 1; | 216 unsigned m_hasSVGRareData : 1; |
237 | 217 |
238 RefPtr<SVGAnimatedString> m_className; | 218 RefPtr<SVGAnimatedString> m_className; |
239 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGElement) | 219 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGElement) |
240 END_DECLARE_ANIMATED_PROPERTIES | 220 END_DECLARE_ANIMATED_PROPERTIES |
241 }; | 221 }; |
242 | 222 |
243 struct SVGAttributeHashTranslator { | 223 struct SVGAttributeHashTranslator { |
244 static unsigned hash(const QualifiedName& key) | 224 static unsigned hash(const QualifiedName& key) |
245 { | 225 { |
246 if (key.hasPrefix()) { | 226 if (key.hasPrefix()) { |
247 QualifiedNameComponents components = { nullAtom.impl(), key.localNam
e().impl(), key.namespaceURI().impl() }; | 227 QualifiedNameComponents components = { nullAtom.impl(), key.localNam
e().impl(), key.namespaceURI().impl() }; |
248 return hashComponents(components); | 228 return hashComponents(components); |
249 } | 229 } |
250 return DefaultHash<QualifiedName>::Hash::hash(key); | 230 return DefaultHash<QualifiedName>::Hash::hash(key); |
251 } | 231 } |
252 static bool equal(const QualifiedName& a, const QualifiedName& b) { return a
.matches(b); } | 232 static bool equal(const QualifiedName& a, const QualifiedName& b) { return a
.matches(b); } |
253 }; | 233 }; |
254 | 234 |
255 DEFINE_NODE_TYPE_CASTS(SVGElement, isSVGElement()); | 235 DEFINE_NODE_TYPE_CASTS(SVGElement, isSVGElement()); |
256 | 236 |
257 } | 237 } |
258 | 238 |
259 #endif | 239 #endif |
OLD | NEW |