Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(601)

Side by Side Diff: Source/core/svg/SVGElement.h

Issue 1212253012: Fix virtual/override/final usage in Source/core/svg/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 class SVGFitToViewBox; 46 class SVGFitToViewBox;
47 class SVGLength; 47 class SVGLength;
48 class SVGSVGElement; 48 class SVGSVGElement;
49 class SVGUseElement; 49 class SVGUseElement;
50 50
51 typedef WillBeHeapHashSet<RawPtrWillBeMember<SVGElement>> SVGElementSet; 51 typedef WillBeHeapHashSet<RawPtrWillBeMember<SVGElement>> SVGElementSet;
52 52
53 class CORE_EXPORT SVGElement : public Element { 53 class CORE_EXPORT SVGElement : public Element {
54 DEFINE_WRAPPERTYPEINFO(); 54 DEFINE_WRAPPERTYPEINFO();
55 public: 55 public:
56 virtual ~SVGElement(); 56 ~SVGElement() override;
57 virtual void attach(const AttachContext&) override; 57 void attach(const AttachContext&) override;
58 virtual void detach(const AttachContext&) override; 58 void detach(const AttachContext&) override;
59 59
60 virtual short tabIndex() const override; 60 short tabIndex() const override;
61 virtual bool supportsFocus() const override { return false; } 61 bool supportsFocus() const override { return false; }
62 62
63 bool isOutermostSVGSVGElement() const; 63 bool isOutermostSVGSVGElement() const;
64 64
65 bool hasTagName(const SVGQualifiedName& name) const { return hasLocalName(na me.localName()); } 65 bool hasTagName(const SVGQualifiedName& name) const { return hasLocalName(na me.localName()); }
66 66
67 virtual String title() const override; 67 String title() const override;
68 bool hasRelativeLengths() const { return !m_elementsWithRelativeLengths.isEm pty(); } 68 bool hasRelativeLengths() const { return !m_elementsWithRelativeLengths.isEm pty(); }
69 static bool isAnimatableCSSProperty(const QualifiedName&); 69 static bool isAnimatableCSSProperty(const QualifiedName&);
70 70
71 enum CTMScope { 71 enum CTMScope {
72 NearestViewportScope, // Used by SVGGraphicsElement::getCTM() 72 NearestViewportScope, // Used by SVGGraphicsElement::getCTM()
73 ScreenScope, // Used by SVGGraphicsElement::getScreenCTM() 73 ScreenScope, // Used by SVGGraphicsElement::getScreenCTM()
74 AncestorScope // Used by SVGSVGElement::get{Enclosure|Intersection}List( ) 74 AncestorScope // Used by SVGSVGElement::get{Enclosure|Intersection}List( )
75 }; 75 };
76 virtual AffineTransform localCoordinateSpaceTransform(CTMScope) const; 76 virtual AffineTransform localCoordinateSpaceTransform(CTMScope) const;
77 virtual bool needsPendingResourceHandling() const { return true; } 77 virtual bool needsPendingResourceHandling() const { return true; }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 void cursorElementRemoved(); 121 void cursorElementRemoved();
122 void cursorImageValueRemoved(); 122 void cursorImageValueRemoved();
123 #endif 123 #endif
124 124
125 SVGElement* correspondingElement(); 125 SVGElement* correspondingElement();
126 void setCorrespondingElement(SVGElement*); 126 void setCorrespondingElement(SVGElement*);
127 SVGUseElement* correspondingUseElement() const; 127 SVGUseElement* correspondingUseElement() const;
128 128
129 void synchronizeAnimatedSVGAttribute(const QualifiedName&) const; 129 void synchronizeAnimatedSVGAttribute(const QualifiedName&) const;
130 130
131 virtual PassRefPtr<ComputedStyle> customStyleForLayoutObject() override fina l; 131 PassRefPtr<ComputedStyle> customStyleForLayoutObject() final;
132 132
133 #if ENABLE(ASSERT) 133 #if ENABLE(ASSERT)
134 virtual bool isAnimatableAttribute(const QualifiedName&) const; 134 virtual 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 = false) override final; 143 bool addEventListener(const AtomicString& eventType, PassRefPtr<EventListene r>, bool useCapture = false) final;
144 virtual bool removeEventListener(const AtomicString& eventType, PassRefPtr<E ventListener>, bool useCapture = false) override final; 144 bool removeEventListener(const AtomicString& eventType, PassRefPtr<EventList ener>, bool useCapture = false) final;
145 145
146 void invalidateRelativeLengthClients(SubtreeLayoutScope* = 0); 146 void invalidateRelativeLengthClients(SubtreeLayoutScope* = 0);
147 147
148 void addToPropertyMap(PassRefPtrWillBeRawPtr<SVGAnimatedPropertyBase>); 148 void addToPropertyMap(PassRefPtrWillBeRawPtr<SVGAnimatedPropertyBase>);
149 149
150 SVGAnimatedString* className() { return m_className.get(); } 150 SVGAnimatedString* className() { return m_className.get(); }
151 151
152 bool inUseShadowTree() const; 152 bool inUseShadowTree() const;
153 153
154 SVGElementSet* setOfIncomingReferences() const; 154 SVGElementSet* setOfIncomingReferences() const;
(...skipping 23 matching lines...) Expand all
178 private: 178 private:
179 RawPtrWillBeMember<SVGElement> m_targetElement; 179 RawPtrWillBeMember<SVGElement> m_targetElement;
180 }; 180 };
181 181
182 void invalidateInstances(); 182 void invalidateInstances();
183 183
184 DECLARE_VIRTUAL_TRACE(); 184 DECLARE_VIRTUAL_TRACE();
185 185
186 static const AtomicString& eventParameterName(); 186 static const AtomicString& eventParameterName();
187 187
188 virtual bool isPresentationAttribute(const QualifiedName&) const override; 188 bool isPresentationAttribute(const QualifiedName&) const override;
189 virtual bool isPresentationAttributeWithSVGDOM(const QualifiedName&) const { return false; } 189 virtual bool isPresentationAttributeWithSVGDOM(const QualifiedName&) const { return false; }
190 190
191 protected: 191 protected:
192 SVGElement(const QualifiedName&, Document&, ConstructionType = CreateSVGElem ent); 192 SVGElement(const QualifiedName&, Document&, ConstructionType = CreateSVGElem ent);
193 193
194 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr ide; 194 void parseAttribute(const QualifiedName&, const AtomicString&) override;
195 195
196 virtual void attributeChanged(const QualifiedName&, const AtomicString&, Att ributeModificationReason = ModifiedDirectly) override; 196 void attributeChanged(const QualifiedName&, const AtomicString&, AttributeMo dificationReason = ModifiedDirectly) override;
197 197
198 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons t AtomicString&, MutableStylePropertySet*) override; 198 void collectStyleForPresentationAttribute(const QualifiedName&, const Atomic String&, MutableStylePropertySet*) override;
199 199
200 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; 200 InsertionNotificationRequest insertedInto(ContainerNode*) override;
201 virtual void removedFrom(ContainerNode*) override; 201 void removedFrom(ContainerNode*) override;
202 virtual void childrenChanged(const ChildrenChange&) override; 202 void childrenChanged(const ChildrenChange&) override;
203 203
204 static CSSPropertyID cssPropertyIdForSVGAttributeName(const QualifiedName&); 204 static CSSPropertyID cssPropertyIdForSVGAttributeName(const QualifiedName&);
205 void updateRelativeLengthsInformation() { updateRelativeLengthsInformation(s elfHasRelativeLengths(), this); } 205 void updateRelativeLengthsInformation() { updateRelativeLengthsInformation(s elfHasRelativeLengths(), this); }
206 void updateRelativeLengthsInformation(bool hasRelativeLengths, SVGElement*); 206 void updateRelativeLengthsInformation(bool hasRelativeLengths, SVGElement*);
207 static void markForLayoutAndParentResourceInvalidation(LayoutObject*); 207 static void markForLayoutAndParentResourceInvalidation(LayoutObject*);
208 208
209 virtual bool selfHasRelativeLengths() const { return false; } 209 virtual bool selfHasRelativeLengths() const { return false; }
210 210
211 SVGElementRareData* ensureSVGRareData(); 211 SVGElementRareData* ensureSVGRareData();
212 inline bool hasSVGRareData() const { return m_SVGRareData; } 212 inline bool hasSVGRareData() const { return m_SVGRareData; }
213 inline SVGElementRareData* svgRareData() const 213 inline SVGElementRareData* svgRareData() const
214 { 214 {
215 ASSERT(m_SVGRareData); 215 ASSERT(m_SVGRareData);
216 return m_SVGRareData.get(); 216 return m_SVGRareData.get();
217 } 217 }
218 218
219 // SVGFitToViewBox::parseAttribute uses reportAttributeParsingError. 219 // SVGFitToViewBox::parseAttribute uses reportAttributeParsingError.
220 friend class SVGFitToViewBox; 220 friend class SVGFitToViewBox;
221 void reportAttributeParsingError(SVGParsingError, const QualifiedName&, cons t AtomicString&); 221 void reportAttributeParsingError(SVGParsingError, const QualifiedName&, cons t AtomicString&);
222 bool hasFocusEventListeners() const; 222 bool hasFocusEventListeners() const;
223 223
224 private: 224 private:
225 bool isSVGElement() const = delete; // This will catch anyone doing an unnec essary check. 225 bool isSVGElement() const = delete; // This will catch anyone doing an unnec essary check.
226 bool isStyledElement() const = delete; // This will catch anyone doing an un necessary check. 226 bool isStyledElement() const = delete; // This will catch anyone doing an un necessary check.
227 227
228 const ComputedStyle* ensureComputedStyle(PseudoId = NOPSEUDO); 228 const ComputedStyle* ensureComputedStyle(PseudoId = NOPSEUDO);
229 virtual const ComputedStyle* virtualEnsureComputedStyle(PseudoId pseudoEleme ntSpecifier = NOPSEUDO) override final { return ensureComputedStyle(pseudoElemen tSpecifier); } 229 const ComputedStyle* virtualEnsureComputedStyle(PseudoId pseudoElementSpecif ier = NOPSEUDO) final { return ensureComputedStyle(pseudoElementSpecifier); }
230 virtual void willRecalcStyle(StyleRecalcChange) override; 230 void willRecalcStyle(StyleRecalcChange) override;
231 231
232 void buildPendingResourcesIfNeeded(); 232 void buildPendingResourcesIfNeeded();
233 233
234 WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement>> m_elementsWithRelative Lengths; 234 WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement>> m_elementsWithRelative Lengths;
235 235
236 typedef WillBeHeapHashMap<QualifiedName, RefPtrWillBeMember<SVGAnimatedPrope rtyBase>> AttributeToPropertyMap; 236 typedef WillBeHeapHashMap<QualifiedName, RefPtrWillBeMember<SVGAnimatedPrope rtyBase>> AttributeToPropertyMap;
237 AttributeToPropertyMap m_attributeToPropertyMap; 237 AttributeToPropertyMap m_attributeToPropertyMap;
238 238
239 #if ENABLE(ASSERT) 239 #if ENABLE(ASSERT)
240 bool m_inRelativeLengthClientsInvalidation; 240 bool m_inRelativeLengthClientsInvalidation;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 template<typename T> inline bool is##thisType(const PassRefPtrWillBeRawPtr<T >& node) { return is##thisType(node.get()); } \ 276 template<typename T> inline bool is##thisType(const PassRefPtrWillBeRawPtr<T >& node) { return is##thisType(node.get()); } \
277 template<typename T> inline bool is##thisType(const RefPtrWillBeMember<T>& n ode) { return is##thisType(node.get()); } \ 277 template<typename T> inline bool is##thisType(const RefPtrWillBeMember<T>& n ode) { return is##thisType(node.get()); } \
278 template <> inline bool isElementOfType<const thisType>(const SVGElement& el ement) { return is##thisType(element); } \ 278 template <> inline bool isElementOfType<const thisType>(const SVGElement& el ement) { return is##thisType(element); } \
279 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) 279 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType)
280 280
281 } // namespace blink 281 } // namespace blink
282 282
283 #include "core/SVGElementTypeHelpers.h" 283 #include "core/SVGElementTypeHelpers.h"
284 284
285 #endif // SVGElement_h 285 #endif // SVGElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698