| 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, 2014 Apple Inc. All rights reserved. | 4 * Copyright (C) 2009, 2014 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 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 #ifndef SVGElement_h | 22 #ifndef SVGElement_h |
| 23 #define SVGElement_h | 23 #define SVGElement_h |
| 24 | 24 |
| 25 #include "core/SVGNames.h" | 25 #include "core/SVGNames.h" |
| 26 #include "core/dom/Element.h" | 26 #include "core/dom/Element.h" |
| 27 #include "core/svg/SVGAnimatedString.h" | 27 #include "core/svg/SVGAnimatedString.h" |
| 28 #include "core/svg/SVGParsingError.h" | 28 #include "core/svg/SVGParsingError.h" |
| 29 #include "core/svg/properties/SVGPropertyInfo.h" | 29 #include "core/svg/properties/SVGPropertyInfo.h" |
| 30 #include "platform/Timer.h" | 30 #include "platform/Timer.h" |
| 31 #include "platform/heap/Handle.h" |
| 31 #include "wtf/HashMap.h" | 32 #include "wtf/HashMap.h" |
| 32 #include "wtf/OwnPtr.h" | 33 #include "wtf/OwnPtr.h" |
| 33 | 34 |
| 34 namespace blink { | 35 namespace blink { |
| 35 | 36 |
| 36 class AffineTransform; | 37 class AffineTransform; |
| 37 class CSSCursorImageValue; | 38 class CSSCursorImageValue; |
| 38 class Document; | 39 class Document; |
| 39 class SVGAnimatedPropertyBase; | 40 class SVGAnimatedPropertyBase; |
| 40 class SubtreeLayoutScope; | 41 class SubtreeLayoutScope; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 virtual bool isFilterEffect() const { return false; } | 86 virtual bool isFilterEffect() const { return false; } |
| 86 virtual bool isTextContent() const { return false; } | 87 virtual bool isTextContent() const { return false; } |
| 87 virtual bool isTextPositioning() const { return false; } | 88 virtual bool isTextPositioning() const { return false; } |
| 88 virtual bool isStructurallyExternal() const { return false; } | 89 virtual bool isStructurallyExternal() const { return false; } |
| 89 | 90 |
| 90 // For SVGTests | 91 // For SVGTests |
| 91 virtual bool isValid() const { return true; } | 92 virtual bool isValid() const { return true; } |
| 92 | 93 |
| 93 virtual void svgAttributeChanged(const QualifiedName&); | 94 virtual void svgAttributeChanged(const QualifiedName&); |
| 94 | 95 |
| 95 PassRefPtr<SVGAnimatedPropertyBase> propertyFromAttribute(const QualifiedNam
e& attributeName); | 96 PassRefPtrWillBeRawPtr<SVGAnimatedPropertyBase> propertyFromAttribute(const
QualifiedName& attributeName); |
| 96 static AnimatedPropertyType animatedPropertyTypeForCSSAttribute(const Qualif
iedName& attributeName); | 97 static AnimatedPropertyType animatedPropertyTypeForCSSAttribute(const Qualif
iedName& attributeName); |
| 97 | 98 |
| 98 void sendSVGLoadEventToSelfAndAncestorChainIfPossible(); | 99 void sendSVGLoadEventToSelfAndAncestorChainIfPossible(); |
| 99 bool sendSVGLoadEventIfPossible(); | 100 bool sendSVGLoadEventIfPossible(); |
| 100 void sendSVGLoadEventIfPossibleAsynchronously(); | 101 void sendSVGLoadEventIfPossibleAsynchronously(); |
| 101 void svgLoadEventTimerFired(Timer<SVGElement>*); | 102 void svgLoadEventTimerFired(Timer<SVGElement>*); |
| 102 virtual Timer<SVGElement>* svgLoadEventTimer(); | 103 virtual Timer<SVGElement>* svgLoadEventTimer(); |
| 103 | 104 |
| 104 virtual AffineTransform* animateMotionTransform() { return 0; } | 105 virtual AffineTransform* animateMotionTransform() { return 0; } |
| 105 | 106 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 MutableStylePropertySet* ensureAnimatedSMILStyleProperties(); | 141 MutableStylePropertySet* ensureAnimatedSMILStyleProperties(); |
| 141 void setUseOverrideComputedStyle(bool); | 142 void setUseOverrideComputedStyle(bool); |
| 142 | 143 |
| 143 virtual bool haveLoadedRequiredResources(); | 144 virtual bool haveLoadedRequiredResources(); |
| 144 | 145 |
| 145 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even
tListener>, bool useCapture = false) override final; | 146 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even
tListener>, bool useCapture = false) override final; |
| 146 virtual bool removeEventListener(const AtomicString& eventType, PassRefPtr<E
ventListener>, bool useCapture = false) override final; | 147 virtual bool removeEventListener(const AtomicString& eventType, PassRefPtr<E
ventListener>, bool useCapture = false) override final; |
| 147 | 148 |
| 148 void invalidateRelativeLengthClients(SubtreeLayoutScope* = 0); | 149 void invalidateRelativeLengthClients(SubtreeLayoutScope* = 0); |
| 149 | 150 |
| 150 void addToPropertyMap(PassRefPtr<SVGAnimatedPropertyBase>); | 151 void addToPropertyMap(PassRefPtrWillBeRawPtr<SVGAnimatedPropertyBase>); |
| 151 | 152 |
| 152 SVGAnimatedString* className() { return m_className.get(); } | 153 SVGAnimatedString* className() { return m_className.get(); } |
| 153 | 154 |
| 154 bool inUseShadowTree() const; | 155 bool inUseShadowTree() const; |
| 155 | 156 |
| 156 SVGElementSet* setOfIncomingReferences() const; | 157 SVGElementSet* setOfIncomingReferences() const; |
| 157 void addReferenceTo(SVGElement*); | 158 void addReferenceTo(SVGElement*); |
| 158 void rebuildAllIncomingReferences(); | 159 void rebuildAllIncomingReferences(); |
| 159 void removeAllIncomingReferences(); | 160 void removeAllIncomingReferences(); |
| 160 void removeAllOutgoingReferences(); | 161 void removeAllOutgoingReferences(); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 bool isStyledElement() const WTF_DELETED_FUNCTION; // This will catch anyone
doing an unnecessary check. | 232 bool isStyledElement() const WTF_DELETED_FUNCTION; // This will catch anyone
doing an unnecessary check. |
| 232 | 233 |
| 233 RenderStyle* computedStyle(PseudoId = NOPSEUDO); | 234 RenderStyle* computedStyle(PseudoId = NOPSEUDO); |
| 234 virtual RenderStyle* virtualComputedStyle(PseudoId pseudoElementSpecifier =
NOPSEUDO) override final { return computedStyle(pseudoElementSpecifier); } | 235 virtual RenderStyle* virtualComputedStyle(PseudoId pseudoElementSpecifier =
NOPSEUDO) override final { return computedStyle(pseudoElementSpecifier); } |
| 235 virtual void willRecalcStyle(StyleRecalcChange) override; | 236 virtual void willRecalcStyle(StyleRecalcChange) override; |
| 236 | 237 |
| 237 void buildPendingResourcesIfNeeded(); | 238 void buildPendingResourcesIfNeeded(); |
| 238 | 239 |
| 239 WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> > m_elementsWithRelativ
eLengths; | 240 WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> > m_elementsWithRelativ
eLengths; |
| 240 | 241 |
| 241 typedef HashMap<QualifiedName, RefPtr<SVGAnimatedPropertyBase> > AttributeTo
PropertyMap; | 242 typedef WillBeHeapHashMap<QualifiedName, RefPtrWillBeMember<SVGAnimatedPrope
rtyBase> > AttributeToPropertyMap; |
| 242 AttributeToPropertyMap m_attributeToPropertyMap; | 243 AttributeToPropertyMap m_attributeToPropertyMap; |
| 243 | 244 |
| 244 #if ENABLE(ASSERT) | 245 #if ENABLE(ASSERT) |
| 245 bool m_inRelativeLengthClientsInvalidation; | 246 bool m_inRelativeLengthClientsInvalidation; |
| 246 #endif | 247 #endif |
| 247 | 248 |
| 248 OwnPtrWillBeMember<SVGElementRareData> m_SVGRareData; | 249 OwnPtrWillBeMember<SVGElementRareData> m_SVGRareData; |
| 249 RefPtr<SVGAnimatedString> m_className; | 250 RefPtrWillBeMember<SVGAnimatedString> m_className; |
| 250 }; | 251 }; |
| 251 | 252 |
| 252 struct SVGAttributeHashTranslator { | 253 struct SVGAttributeHashTranslator { |
| 253 static unsigned hash(const QualifiedName& key) | 254 static unsigned hash(const QualifiedName& key) |
| 254 { | 255 { |
| 255 if (key.hasPrefix()) { | 256 if (key.hasPrefix()) { |
| 256 QualifiedNameComponents components = { nullAtom.impl(), key.localNam
e().impl(), key.namespaceURI().impl() }; | 257 QualifiedNameComponents components = { nullAtom.impl(), key.localNam
e().impl(), key.namespaceURI().impl() }; |
| 257 return hashComponents(components); | 258 return hashComponents(components); |
| 258 } | 259 } |
| 259 return DefaultHash<QualifiedName>::Hash::hash(key); | 260 return DefaultHash<QualifiedName>::Hash::hash(key); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 271 return isSVGElement() && toSVGElement(*this).hasTagName(name); | 272 return isSVGElement() && toSVGElement(*this).hasTagName(name); |
| 272 } | 273 } |
| 273 | 274 |
| 274 // This requires isSVG*Element(const SVGElement&). | 275 // This requires isSVG*Element(const SVGElement&). |
| 275 #define DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) \ | 276 #define DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) \ |
| 276 inline bool is##thisType(const thisType* element); \ | 277 inline bool is##thisType(const thisType* element); \ |
| 277 inline bool is##thisType(const thisType& element); \ | 278 inline bool is##thisType(const thisType& element); \ |
| 278 inline bool is##thisType(const SVGElement* element) { return element && is##
thisType(*element); } \ | 279 inline bool is##thisType(const SVGElement* element) { return element && is##
thisType(*element); } \ |
| 279 inline bool is##thisType(const Node& node) { return node.isSVGElement() ? is
##thisType(toSVGElement(node)) : false; } \ | 280 inline bool is##thisType(const Node& node) { return node.isSVGElement() ? is
##thisType(toSVGElement(node)) : false; } \ |
| 280 inline bool is##thisType(const Node* node) { return node && is##thisType(*no
de); } \ | 281 inline bool is##thisType(const Node* node) { return node && is##thisType(*no
de); } \ |
| 281 template<typename T> inline bool is##thisType(const PassRefPtr<T>& node) { r
eturn is##thisType(node.get()); } \ | 282 template<typename T> inline bool is##thisType(const PassRefPtrWillBeRawPtr<T
>& node) { return is##thisType(node.get()); } \ |
| 282 template<typename T> inline bool is##thisType(const RefPtr<T>& node) { retur
n is##thisType(node.get()); } \ | 283 template<typename T> inline bool is##thisType(const RefPtrWillBeMember<T>& n
ode) { return is##thisType(node.get()); } \ |
| 283 template <> inline bool isElementOfType<const thisType>(const SVGElement& el
ement) { return is##thisType(element); } \ | 284 template <> inline bool isElementOfType<const thisType>(const SVGElement& el
ement) { return is##thisType(element); } \ |
| 284 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) | 285 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) |
| 285 | 286 |
| 286 } // namespace blink | 287 } // namespace blink |
| 287 | 288 |
| 288 #include "core/SVGElementTypeHelpers.h" | 289 #include "core/SVGElementTypeHelpers.h" |
| 289 | 290 |
| 290 #endif // SVGElement_h | 291 #endif // SVGElement_h |
| OLD | NEW |