| 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 19 matching lines...) Expand all Loading... |
| 30 #include "core/svg/SVGParsingError.h" | 30 #include "core/svg/SVGParsingError.h" |
| 31 #include "core/svg/properties/SVGAnimatedPropertyMacros.h" | 31 #include "core/svg/properties/SVGAnimatedPropertyMacros.h" |
| 32 #include "core/svg/properties/SVGPropertyInfo.h" | 32 #include "core/svg/properties/SVGPropertyInfo.h" |
| 33 #include "wtf/HashMap.h" | 33 #include "wtf/HashMap.h" |
| 34 | 34 |
| 35 namespace WebCore { | 35 namespace WebCore { |
| 36 | 36 |
| 37 class AffineTransform; | 37 class AffineTransform; |
| 38 class CSSCursorImageValue; | 38 class CSSCursorImageValue; |
| 39 class Document; | 39 class Document; |
| 40 class SubtreeLayoutScope; |
| 40 class SVGAttributeToPropertyMap; | 41 class SVGAttributeToPropertyMap; |
| 41 class SVGCursorElement; | 42 class SVGCursorElement; |
| 42 class SVGDocumentExtensions; | 43 class SVGDocumentExtensions; |
| 43 class SVGElementInstance; | 44 class SVGElementInstance; |
| 44 class SVGElementRareData; | 45 class SVGElementRareData; |
| 45 class SVGSVGElement; | 46 class SVGSVGElement; |
| 46 | 47 |
| 47 void mapAttributeToCSSProperty(HashMap<StringImpl*, CSSPropertyID>* propertyName
ToIdMap, const QualifiedName& attrName); | 48 void mapAttributeToCSSProperty(HashMap<StringImpl*, CSSPropertyID>* propertyName
ToIdMap, const QualifiedName& attrName); |
| 48 | 49 |
| 49 class SVGElement : public Element, public SVGLangSpace { | 50 class SVGElement : public Element, public SVGLangSpace { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 MutableStylePropertySet* ensureAnimatedSMILStyleProperties(); | 127 MutableStylePropertySet* ensureAnimatedSMILStyleProperties(); |
| 127 void setUseOverrideComputedStyle(bool); | 128 void setUseOverrideComputedStyle(bool); |
| 128 | 129 |
| 129 virtual bool haveLoadedRequiredResources(); | 130 virtual bool haveLoadedRequiredResources(); |
| 130 | 131 |
| 131 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even
tListener>, bool useCapture) OVERRIDE; | 132 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even
tListener>, bool useCapture) OVERRIDE; |
| 132 virtual bool removeEventListener(const AtomicString& eventType, EventListene
r*, bool useCapture) OVERRIDE; | 133 virtual bool removeEventListener(const AtomicString& eventType, EventListene
r*, bool useCapture) OVERRIDE; |
| 133 | 134 |
| 134 virtual bool shouldMoveToFlowThread(RenderStyle*) const OVERRIDE; | 135 virtual bool shouldMoveToFlowThread(RenderStyle*) const OVERRIDE; |
| 135 | 136 |
| 137 void invalidateRelativeLengthClients(SubtreeLayoutScope* = 0); |
| 138 |
| 136 protected: | 139 protected: |
| 137 SVGElement(const QualifiedName&, Document&, ConstructionType = CreateSVGElem
ent); | 140 SVGElement(const QualifiedName&, Document&, ConstructionType = CreateSVGElem
ent); |
| 138 | 141 |
| 139 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 142 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; |
| 140 | 143 |
| 141 virtual void finishParsingChildren(); | 144 virtual void finishParsingChildren(); |
| 142 virtual void attributeChanged(const QualifiedName&, const AtomicString&, Att
ributeModificationReason = ModifiedDirectly) OVERRIDE; | 145 virtual void attributeChanged(const QualifiedName&, const AtomicString&, Att
ributeModificationReason = ModifiedDirectly) OVERRIDE; |
| 143 virtual bool childShouldCreateRenderer(const Node& child) const OVERRIDE; | 146 virtual bool childShouldCreateRenderer(const Node& child) const OVERRIDE; |
| 144 | 147 |
| 145 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; | 148 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 virtual bool isSupported(StringImpl* feature, StringImpl* version) const; | 182 virtual bool isSupported(StringImpl* feature, StringImpl* version) const; |
| 180 | 183 |
| 181 void mapInstanceToElement(SVGElementInstance*); | 184 void mapInstanceToElement(SVGElementInstance*); |
| 182 void removeInstanceMapping(SVGElementInstance*); | 185 void removeInstanceMapping(SVGElementInstance*); |
| 183 | 186 |
| 184 HashSet<SVGElement*> m_elementsWithRelativeLengths; | 187 HashSet<SVGElement*> m_elementsWithRelativeLengths; |
| 185 | 188 |
| 186 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGElement) | 189 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGElement) |
| 187 DECLARE_ANIMATED_STRING(ClassName, className) | 190 DECLARE_ANIMATED_STRING(ClassName, className) |
| 188 END_DECLARE_ANIMATED_PROPERTIES | 191 END_DECLARE_ANIMATED_PROPERTIES |
| 192 |
| 193 #if !ASSERT_DISABLED |
| 194 bool m_inRelativeLengthClientsInvalidation; |
| 195 #endif |
| 189 }; | 196 }; |
| 190 | 197 |
| 191 struct SVGAttributeHashTranslator { | 198 struct SVGAttributeHashTranslator { |
| 192 static unsigned hash(const QualifiedName& key) | 199 static unsigned hash(const QualifiedName& key) |
| 193 { | 200 { |
| 194 if (key.hasPrefix()) { | 201 if (key.hasPrefix()) { |
| 195 QualifiedNameComponents components = { nullAtom.impl(), key.localNam
e().impl(), key.namespaceURI().impl() }; | 202 QualifiedNameComponents components = { nullAtom.impl(), key.localNam
e().impl(), key.namespaceURI().impl() }; |
| 196 return hashComponents(components); | 203 return hashComponents(components); |
| 197 } | 204 } |
| 198 return DefaultHash<QualifiedName>::Hash::hash(key); | 205 return DefaultHash<QualifiedName>::Hash::hash(key); |
| 199 } | 206 } |
| 200 static bool equal(const QualifiedName& a, const QualifiedName& b) { return a
.matches(b); } | 207 static bool equal(const QualifiedName& a, const QualifiedName& b) { return a
.matches(b); } |
| 201 }; | 208 }; |
| 202 | 209 |
| 203 inline SVGElement* toSVGElement(Node* node) | 210 inline SVGElement* toSVGElement(Node* node) |
| 204 { | 211 { |
| 205 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isSVGElement()); | 212 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isSVGElement()); |
| 206 return static_cast<SVGElement*>(node); | 213 return static_cast<SVGElement*>(node); |
| 207 } | 214 } |
| 208 | 215 |
| 209 inline const SVGElement* toSVGElement(const Node* node) | 216 inline const SVGElement* toSVGElement(const Node* node) |
| 210 { | 217 { |
| 211 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isSVGElement()); | 218 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isSVGElement()); |
| 212 return static_cast<const SVGElement*>(node); | 219 return static_cast<const SVGElement*>(node); |
| 213 } | 220 } |
| 214 | 221 |
| 215 } | 222 } |
| 216 | 223 |
| 217 #endif | 224 #endif |
| OLD | NEW |