| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 virtual bool haveLoadedRequiredResources(); | 143 virtual bool haveLoadedRequiredResources(); |
| 144 | 144 |
| 145 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even
tListener>, bool useCapture) OVERRIDE FINAL; | 145 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even
tListener>, bool useCapture) OVERRIDE FINAL; |
| 146 virtual bool removeEventListener(const AtomicString& eventType, EventListene
r*, bool useCapture) OVERRIDE FINAL; | 146 virtual bool removeEventListener(const AtomicString& eventType, EventListene
r*, bool useCapture) OVERRIDE FINAL; |
| 147 | 147 |
| 148 void invalidateRelativeLengthClients(SubtreeLayoutScope* = 0); | 148 void invalidateRelativeLengthClients(SubtreeLayoutScope* = 0); |
| 149 | 149 |
| 150 bool isContextElement() const { return m_isContextElement; } | 150 bool isContextElement() const { return m_isContextElement; } |
| 151 void setContextElement() { m_isContextElement = true; } | 151 void setContextElement() { m_isContextElement = true; } |
| 152 | 152 |
| 153 void addToPropertyMap(PassRefPtr<NewSVGAnimatedPropertyBase>); |
| 154 |
| 153 virtual bool childShouldCreateRenderer(const Node& child) const { return tru
e; } | 155 virtual bool childShouldCreateRenderer(const Node& child) const { return tru
e; } |
| 154 | 156 |
| 157 SVGAnimatedString* className() { return m_className.get(); } |
| 158 |
| 155 protected: | 159 protected: |
| 156 SVGElement(const QualifiedName&, Document&, ConstructionType = CreateSVGElem
ent); | 160 SVGElement(const QualifiedName&, Document&, ConstructionType = CreateSVGElem
ent); |
| 157 | 161 |
| 158 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 162 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; |
| 159 | 163 |
| 160 virtual void finishParsingChildren() OVERRIDE; | 164 virtual void finishParsingChildren() OVERRIDE; |
| 161 virtual void attributeChanged(const QualifiedName&, const AtomicString&, Att
ributeModificationReason = ModifiedDirectly) OVERRIDE; | 165 virtual void attributeChanged(const QualifiedName&, const AtomicString&, Att
ributeModificationReason = ModifiedDirectly) OVERRIDE; |
| 162 | 166 |
| 163 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; | 167 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; |
| 164 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons
t AtomicString&, MutableStylePropertySet*) OVERRIDE; | 168 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons
t AtomicString&, MutableStylePropertySet*) OVERRIDE; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 ASSERT(m_owner); | 202 ASSERT(m_owner); |
| 199 m_owner->cleanupAnimatedProperties(); | 203 m_owner->cleanupAnimatedProperties(); |
| 200 } | 204 } |
| 201 | 205 |
| 202 void setOwner(SVGElement* owner) { m_owner = owner; } | 206 void setOwner(SVGElement* owner) { m_owner = owner; } |
| 203 | 207 |
| 204 private: | 208 private: |
| 205 SVGElement* m_owner; | 209 SVGElement* m_owner; |
| 206 }; | 210 }; |
| 207 | 211 |
| 208 void addToPropertyMap(PassRefPtr<NewSVGAnimatedPropertyBase>); | |
| 209 | |
| 210 private: | 212 private: |
| 211 friend class SVGElementInstance; | 213 friend class SVGElementInstance; |
| 212 | 214 |
| 213 // FIXME: Author shadows should be allowed | 215 // FIXME: Author shadows should be allowed |
| 214 // https://bugs.webkit.org/show_bug.cgi?id=77938 | 216 // https://bugs.webkit.org/show_bug.cgi?id=77938 |
| 215 virtual bool areAuthorShadowsAllowed() const OVERRIDE FINAL { return false;
} | 217 virtual bool areAuthorShadowsAllowed() const OVERRIDE FINAL { return false;
} |
| 216 | 218 |
| 217 RenderStyle* computedStyle(PseudoId = NOPSEUDO); | 219 RenderStyle* computedStyle(PseudoId = NOPSEUDO); |
| 218 virtual RenderStyle* virtualComputedStyle(PseudoId pseudoElementSpecifier =
NOPSEUDO) OVERRIDE FINAL { return computedStyle(pseudoElementSpecifier); } | 220 virtual RenderStyle* virtualComputedStyle(PseudoId pseudoElementSpecifier =
NOPSEUDO) OVERRIDE FINAL { return computedStyle(pseudoElementSpecifier); } |
| 219 virtual void willRecalcStyle(StyleRecalcChange) OVERRIDE; | 221 virtual void willRecalcStyle(StyleRecalcChange) OVERRIDE; |
| 220 virtual bool isKeyboardFocusable() const OVERRIDE; | 222 virtual bool isKeyboardFocusable() const OVERRIDE; |
| 221 | 223 |
| 222 void buildPendingResourcesIfNeeded(); | 224 void buildPendingResourcesIfNeeded(); |
| 223 | 225 |
| 224 void mapInstanceToElement(SVGElementInstance*); | 226 void mapInstanceToElement(SVGElementInstance*); |
| 225 void removeInstanceMapping(SVGElementInstance*); | 227 void removeInstanceMapping(SVGElementInstance*); |
| 226 | 228 |
| 227 void cleanupAnimatedProperties(); | 229 void cleanupAnimatedProperties(); |
| 228 friend class CleanUpAnimatedPropertiesCaller; | 230 friend class CleanUpAnimatedPropertiesCaller; |
| 229 | 231 |
| 230 HashSet<SVGElement*> m_elementsWithRelativeLengths; | 232 HashSet<SVGElement*> m_elementsWithRelativeLengths; |
| 231 | 233 |
| 232 typedef HashMap<QualifiedName, RefPtr<NewSVGAnimatedPropertyBase> > Attribut
eToPropertyMap; | 234 typedef HashMap<QualifiedName, RefPtr<NewSVGAnimatedPropertyBase> > Attribut
eToPropertyMap; |
| 233 AttributeToPropertyMap m_newAttributeToPropertyMap; | 235 AttributeToPropertyMap m_newAttributeToPropertyMap; |
| 236 RefPtr<SVGAnimatedString> m_className; |
| 234 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGElement) | 237 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGElement) |
| 235 DECLARE_ANIMATED_STRING(ClassName, className) | |
| 236 END_DECLARE_ANIMATED_PROPERTIES | 238 END_DECLARE_ANIMATED_PROPERTIES |
| 237 | 239 |
| 238 #if !ASSERT_DISABLED | 240 #if !ASSERT_DISABLED |
| 239 bool m_inRelativeLengthClientsInvalidation; | 241 bool m_inRelativeLengthClientsInvalidation; |
| 240 #endif | 242 #endif |
| 241 unsigned m_animatedPropertiesDestructed : 1; | 243 unsigned m_animatedPropertiesDestructed : 1; |
| 242 unsigned m_isContextElement : 1; | 244 unsigned m_isContextElement : 1; |
| 243 unsigned m_hasSVGRareData : 1; | 245 unsigned m_hasSVGRareData : 1; |
| 244 }; | 246 }; |
| 245 | 247 |
| 246 struct SVGAttributeHashTranslator { | 248 struct SVGAttributeHashTranslator { |
| 247 static unsigned hash(const QualifiedName& key) | 249 static unsigned hash(const QualifiedName& key) |
| 248 { | 250 { |
| 249 if (key.hasPrefix()) { | 251 if (key.hasPrefix()) { |
| 250 QualifiedNameComponents components = { nullAtom.impl(), key.localNam
e().impl(), key.namespaceURI().impl() }; | 252 QualifiedNameComponents components = { nullAtom.impl(), key.localNam
e().impl(), key.namespaceURI().impl() }; |
| 251 return hashComponents(components); | 253 return hashComponents(components); |
| 252 } | 254 } |
| 253 return DefaultHash<QualifiedName>::Hash::hash(key); | 255 return DefaultHash<QualifiedName>::Hash::hash(key); |
| 254 } | 256 } |
| 255 static bool equal(const QualifiedName& a, const QualifiedName& b) { return a
.matches(b); } | 257 static bool equal(const QualifiedName& a, const QualifiedName& b) { return a
.matches(b); } |
| 256 }; | 258 }; |
| 257 | 259 |
| 258 DEFINE_NODE_TYPE_CASTS(SVGElement, isSVGElement()); | 260 DEFINE_NODE_TYPE_CASTS(SVGElement, isSVGElement()); |
| 259 | 261 |
| 260 } | 262 } |
| 261 | 263 |
| 262 #endif | 264 #endif |
| OLD | NEW |