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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 class SVGSVGElement; | 46 class SVGSVGElement; |
47 | 47 |
48 void mapAttributeToCSSProperty(HashMap<StringImpl*, CSSPropertyID>* propertyName
ToIdMap, const QualifiedName& attrName); | 48 void mapAttributeToCSSProperty(HashMap<StringImpl*, CSSPropertyID>* propertyName
ToIdMap, const QualifiedName& attrName); |
49 | 49 |
50 class SVGElement : public Element { | 50 class SVGElement : public Element { |
51 public: | 51 public: |
52 virtual ~SVGElement(); | 52 virtual ~SVGElement(); |
53 | 53 |
54 bool isOutermostSVGSVGElement() const; | 54 bool isOutermostSVGSVGElement() const; |
55 | 55 |
56 virtual String title() const; | 56 virtual String title() const OVERRIDE; |
57 bool hasRelativeLengths() const { return !m_elementsWithRelativeLengths.isEm
pty(); } | 57 bool hasRelativeLengths() const { return !m_elementsWithRelativeLengths.isEm
pty(); } |
58 virtual bool supportsMarkers() const { return false; } | 58 virtual bool supportsMarkers() const { return false; } |
59 PassRefPtr<CSSValue> getPresentationAttribute(const AtomicString& name); | 59 PassRefPtr<CSSValue> getPresentationAttribute(const AtomicString& name); |
60 static bool isAnimatableCSSProperty(const QualifiedName&); | 60 static bool isAnimatableCSSProperty(const QualifiedName&); |
61 enum CTMScope { | 61 enum CTMScope { |
62 NearestViewportScope, // Used by SVGGraphicsElement::getCTM() | 62 NearestViewportScope, // Used by SVGGraphicsElement::getCTM() |
63 ScreenScope // Used by SVGGraphicsElement::getScreenCTM() | 63 ScreenScope // Used by SVGGraphicsElement::getScreenCTM() |
64 }; | 64 }; |
65 virtual AffineTransform localCoordinateSpaceTransform(CTMScope) const; | 65 virtual AffineTransform localCoordinateSpaceTransform(CTMScope) const; |
66 virtual bool needsPendingResourceHandling() const { return true; } | 66 virtual bool needsPendingResourceHandling() const { return true; } |
(...skipping 20 matching lines...) Expand all Loading... |
87 virtual bool isFilterEffect() const { return false; } | 87 virtual bool isFilterEffect() const { return false; } |
88 virtual bool isGradientStop() const { return false; } | 88 virtual bool isGradientStop() const { return false; } |
89 virtual bool isTextContent() const { return false; } | 89 virtual bool isTextContent() const { return false; } |
90 virtual bool isStructurallyExternal() const { return false; } | 90 virtual bool isStructurallyExternal() const { return false; } |
91 | 91 |
92 // For SVGTests | 92 // For SVGTests |
93 virtual bool isValid() const { return true; } | 93 virtual bool isValid() const { return true; } |
94 | 94 |
95 virtual void svgAttributeChanged(const QualifiedName&); | 95 virtual void svgAttributeChanged(const QualifiedName&); |
96 | 96 |
97 virtual void animatedPropertyTypeForAttribute(const QualifiedName&, Vector<A
nimatedPropertyType>&); | 97 void animatedPropertyTypeForAttribute(const QualifiedName&, Vector<AnimatedP
ropertyType>&); |
98 PassRefPtr<NewSVGAnimatedPropertyBase> propertyFromAttribute(const Qualified
Name& attributeName); | 98 PassRefPtr<NewSVGAnimatedPropertyBase> propertyFromAttribute(const Qualified
Name& attributeName); |
99 | 99 |
100 void sendSVGLoadEventIfPossible(bool sendParentLoadEvents = false); | 100 void sendSVGLoadEventIfPossible(bool sendParentLoadEvents = false); |
101 void sendSVGLoadEventIfPossibleAsynchronously(); | 101 void sendSVGLoadEventIfPossibleAsynchronously(); |
102 void svgLoadEventTimerFired(Timer<SVGElement>*); | 102 void svgLoadEventTimerFired(Timer<SVGElement>*); |
103 virtual Timer<SVGElement>* svgLoadEventTimer(); | 103 virtual Timer<SVGElement>* svgLoadEventTimer(); |
104 | 104 |
105 virtual AffineTransform* supplementalTransform() { return 0; } | 105 virtual AffineTransform* supplementalTransform() { return 0; } |
106 | 106 |
107 void invalidateSVGAttributes() { ensureUniqueElementData()->m_animatedSVGAtt
ributesAreDirty = true; } | 107 void invalidateSVGAttributes() { ensureUniqueElementData()->m_animatedSVGAtt
ributesAreDirty = true; } |
108 | 108 |
109 const HashSet<SVGElementInstance*>& instancesForElement() const; | 109 const HashSet<SVGElementInstance*>& instancesForElement() const; |
110 | 110 |
111 bool getBoundingBox(FloatRect&); | 111 bool getBoundingBox(FloatRect&); |
112 | 112 |
113 void setCursorElement(SVGCursorElement*); | 113 void setCursorElement(SVGCursorElement*); |
114 void cursorElementRemoved(); | 114 void cursorElementRemoved(); |
115 void setCursorImageValue(CSSCursorImageValue*); | 115 void setCursorImageValue(CSSCursorImageValue*); |
116 void cursorImageValueRemoved(); | 116 void cursorImageValueRemoved(); |
117 | 117 |
118 SVGElement* correspondingElement(); | 118 SVGElement* correspondingElement(); |
119 void setCorrespondingElement(SVGElement*); | 119 void setCorrespondingElement(SVGElement*); |
120 | 120 |
121 void synchronizeAnimatedSVGAttribute(const QualifiedName&) const; | 121 void synchronizeAnimatedSVGAttribute(const QualifiedName&) const; |
122 | 122 |
123 virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE; | 123 virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE FINAL; |
124 | 124 |
125 static void synchronizeRequiredFeatures(SVGElement* contextElement); | 125 static void synchronizeRequiredFeatures(SVGElement* contextElement); |
126 static void synchronizeRequiredExtensions(SVGElement* contextElement); | 126 static void synchronizeRequiredExtensions(SVGElement* contextElement); |
127 static void synchronizeSystemLanguage(SVGElement* contextElement); | 127 static void synchronizeSystemLanguage(SVGElement* contextElement); |
128 | 128 |
129 virtual void synchronizeRequiredFeatures() { } | 129 virtual void synchronizeRequiredFeatures() { } |
130 virtual void synchronizeRequiredExtensions() { } | 130 virtual void synchronizeRequiredExtensions() { } |
131 virtual void synchronizeSystemLanguage() { } | 131 virtual void synchronizeSystemLanguage() { } |
132 | 132 |
133 #ifndef NDEBUG | 133 #ifndef NDEBUG |
134 bool isAnimatableAttribute(const QualifiedName&) const; | 134 bool isAnimatableAttribute(const QualifiedName&) const; |
135 #endif | 135 #endif |
136 | 136 |
137 MutableStylePropertySet* animatedSMILStyleProperties() const; | 137 MutableStylePropertySet* animatedSMILStyleProperties() const; |
138 MutableStylePropertySet* ensureAnimatedSMILStyleProperties(); | 138 MutableStylePropertySet* ensureAnimatedSMILStyleProperties(); |
139 void setUseOverrideComputedStyle(bool); | 139 void setUseOverrideComputedStyle(bool); |
140 | 140 |
141 virtual bool haveLoadedRequiredResources(); | 141 virtual bool haveLoadedRequiredResources(); |
142 | 142 |
143 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even
tListener>, bool useCapture) OVERRIDE; | 143 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even
tListener>, bool useCapture) OVERRIDE FINAL; |
144 virtual bool removeEventListener(const AtomicString& eventType, EventListene
r*, bool useCapture) OVERRIDE; | 144 virtual bool removeEventListener(const AtomicString& eventType, EventListene
r*, bool useCapture) OVERRIDE FINAL; |
145 | 145 |
146 void invalidateRelativeLengthClients(SubtreeLayoutScope* = 0); | 146 void invalidateRelativeLengthClients(SubtreeLayoutScope* = 0); |
147 | 147 |
148 bool isContextElement() const { return m_isContextElement; } | 148 bool isContextElement() const { return m_isContextElement; } |
149 void setContextElement() { m_isContextElement = true; } | 149 void setContextElement() { m_isContextElement = true; } |
150 | 150 |
151 protected: | 151 protected: |
152 SVGElement(const QualifiedName&, Document&, ConstructionType = CreateSVGElem
ent); | 152 SVGElement(const QualifiedName&, Document&, ConstructionType = CreateSVGElem
ent); |
153 | 153 |
154 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 154 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; |
155 | 155 |
156 virtual void finishParsingChildren(); | 156 virtual void finishParsingChildren() OVERRIDE; |
157 virtual void attributeChanged(const QualifiedName&, const AtomicString&, Att
ributeModificationReason = ModifiedDirectly) OVERRIDE; | 157 virtual void attributeChanged(const QualifiedName&, const AtomicString&, Att
ributeModificationReason = ModifiedDirectly) OVERRIDE; |
158 virtual bool childShouldCreateRenderer(const Node& child) const OVERRIDE; | 158 virtual bool childShouldCreateRenderer(const Node& child) const OVERRIDE; |
159 | 159 |
160 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; | 160 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; |
161 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons
t AtomicString&, MutableStylePropertySet*) OVERRIDE; | 161 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons
t AtomicString&, MutableStylePropertySet*) OVERRIDE; |
162 virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE; | 162 virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE; |
163 | 163 |
164 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; | 164 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; |
165 virtual void removedFrom(ContainerNode*) OVERRIDE; | 165 virtual void removedFrom(ContainerNode*) OVERRIDE; |
166 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang
e = 0, Node* afterChange = 0, int childCountDelta = 0); | 166 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang
e = 0, Node* afterChange = 0, int childCountDelta = 0); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 SVGElement* m_owner; | 200 SVGElement* m_owner; |
201 }; | 201 }; |
202 | 202 |
203 void addToPropertyMap(PassRefPtr<NewSVGAnimatedPropertyBase>); | 203 void addToPropertyMap(PassRefPtr<NewSVGAnimatedPropertyBase>); |
204 | 204 |
205 private: | 205 private: |
206 friend class SVGElementInstance; | 206 friend class SVGElementInstance; |
207 | 207 |
208 // FIXME: Author shadows should be allowed | 208 // FIXME: Author shadows should be allowed |
209 // https://bugs.webkit.org/show_bug.cgi?id=77938 | 209 // https://bugs.webkit.org/show_bug.cgi?id=77938 |
210 virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; } | 210 virtual bool areAuthorShadowsAllowed() const OVERRIDE FINAL { return false;
} |
211 | 211 |
212 RenderStyle* computedStyle(PseudoId = NOPSEUDO); | 212 RenderStyle* computedStyle(PseudoId = NOPSEUDO); |
213 virtual RenderStyle* virtualComputedStyle(PseudoId pseudoElementSpecifier =
NOPSEUDO) { return computedStyle(pseudoElementSpecifier); } | 213 virtual RenderStyle* virtualComputedStyle(PseudoId pseudoElementSpecifier =
NOPSEUDO) OVERRIDE FINAL { return computedStyle(pseudoElementSpecifier); } |
214 virtual void willRecalcStyle(StyleRecalcChange) OVERRIDE; | 214 virtual void willRecalcStyle(StyleRecalcChange) OVERRIDE; |
215 virtual bool isKeyboardFocusable() const OVERRIDE; | 215 virtual bool isKeyboardFocusable() const OVERRIDE; |
216 | 216 |
217 void buildPendingResourcesIfNeeded(); | 217 void buildPendingResourcesIfNeeded(); |
218 | 218 |
219 void mapInstanceToElement(SVGElementInstance*); | 219 void mapInstanceToElement(SVGElementInstance*); |
220 void removeInstanceMapping(SVGElementInstance*); | 220 void removeInstanceMapping(SVGElementInstance*); |
221 | 221 |
222 void cleanupAnimatedProperties(); | 222 void cleanupAnimatedProperties(); |
223 friend class CleanUpAnimatedPropertiesCaller; | 223 friend class CleanUpAnimatedPropertiesCaller; |
(...skipping 24 matching lines...) Expand all Loading... |
248 return DefaultHash<QualifiedName>::Hash::hash(key); | 248 return DefaultHash<QualifiedName>::Hash::hash(key); |
249 } | 249 } |
250 static bool equal(const QualifiedName& a, const QualifiedName& b) { return a
.matches(b); } | 250 static bool equal(const QualifiedName& a, const QualifiedName& b) { return a
.matches(b); } |
251 }; | 251 }; |
252 | 252 |
253 DEFINE_NODE_TYPE_CASTS(SVGElement, isSVGElement()); | 253 DEFINE_NODE_TYPE_CASTS(SVGElement, isSVGElement()); |
254 | 254 |
255 } | 255 } |
256 | 256 |
257 #endif | 257 #endif |
OLD | NEW |