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

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

Issue 896773002: [svg2] Make 'x' and 'y' presentation attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: codereview fixes Created 5 years, 10 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
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 26 matching lines...) Expand all
37 class AffineTransform; 37 class AffineTransform;
38 class CSSCursorImageValue; 38 class CSSCursorImageValue;
39 class Document; 39 class Document;
40 class SVGAnimatedPropertyBase; 40 class SVGAnimatedPropertyBase;
41 class SubtreeLayoutScope; 41 class SubtreeLayoutScope;
42 class SVGCursorElement; 42 class SVGCursorElement;
43 class SVGDocumentExtensions; 43 class SVGDocumentExtensions;
44 class SVGElement; 44 class SVGElement;
45 class SVGElementRareData; 45 class SVGElementRareData;
46 class SVGFitToViewBox; 46 class SVGFitToViewBox;
47 class SVGLength;
47 class SVGSVGElement; 48 class SVGSVGElement;
48 class SVGUseElement; 49 class SVGUseElement;
49 50
50 typedef WillBeHeapHashSet<RawPtrWillBeMember<SVGElement> > SVGElementSet; 51 typedef WillBeHeapHashSet<RawPtrWillBeMember<SVGElement> > SVGElementSet;
51 52
52 class SVGElement : public Element { 53 class SVGElement : public Element {
53 DEFINE_WRAPPERTYPEINFO(); 54 DEFINE_WRAPPERTYPEINFO();
54 public: 55 public:
55 virtual ~SVGElement(); 56 virtual ~SVGElement();
56 virtual void attach(const AttachContext&) override; 57 virtual void attach(const AttachContext&) override;
57 virtual void detach(const AttachContext&) override; 58 virtual void detach(const AttachContext&) override;
58 59
59 virtual short tabIndex() const override; 60 virtual short tabIndex() const override;
60 virtual bool supportsFocus() const override { return false; } 61 virtual bool supportsFocus() const override { return false; }
61 62
62 bool isOutermostSVGSVGElement() const; 63 bool isOutermostSVGSVGElement() const;
63 64
64 bool hasTagName(const SVGQualifiedName& name) const { return hasLocalName(na me.localName()); } 65 bool hasTagName(const SVGQualifiedName& name) const { return hasLocalName(na me.localName()); }
65 66
66 virtual String title() const override; 67 virtual String title() const override;
67 bool hasRelativeLengths() const { return !m_elementsWithRelativeLengths.isEm pty(); } 68 bool hasRelativeLengths() const { return !m_elementsWithRelativeLengths.isEm pty(); }
68 static bool isAnimatableCSSProperty(const QualifiedName&); 69 static bool isAnimatableCSSProperty(const QualifiedName&);
70
69 enum CTMScope { 71 enum CTMScope {
70 NearestViewportScope, // Used by SVGGraphicsElement::getCTM() 72 NearestViewportScope, // Used by SVGGraphicsElement::getCTM()
71 ScreenScope, // Used by SVGGraphicsElement::getScreenCTM() 73 ScreenScope, // Used by SVGGraphicsElement::getScreenCTM()
72 AncestorScope // Used by SVGSVGElement::get{Enclosure|Intersection}List( ) 74 AncestorScope // Used by SVGSVGElement::get{Enclosure|Intersection}List( )
73 }; 75 };
74 virtual AffineTransform localCoordinateSpaceTransform(CTMScope) const; 76 virtual AffineTransform localCoordinateSpaceTransform(CTMScope) const;
75 virtual bool needsPendingResourceHandling() const { return true; } 77 virtual bool needsPendingResourceHandling() const { return true; }
76 78
77 bool instanceUpdatesBlocked() const; 79 bool instanceUpdatesBlocked() const;
78 void setInstanceUpdatesBlocked(bool); 80 void setInstanceUpdatesBlocked(bool);
(...skipping 20 matching lines...) Expand all
99 void sendSVGLoadEventToSelfAndAncestorChainIfPossible(); 101 void sendSVGLoadEventToSelfAndAncestorChainIfPossible();
100 bool sendSVGLoadEventIfPossible(); 102 bool sendSVGLoadEventIfPossible();
101 void sendSVGLoadEventIfPossibleAsynchronously(); 103 void sendSVGLoadEventIfPossibleAsynchronously();
102 void svgLoadEventTimerFired(Timer<SVGElement>*); 104 void svgLoadEventTimerFired(Timer<SVGElement>*);
103 virtual Timer<SVGElement>* svgLoadEventTimer(); 105 virtual Timer<SVGElement>* svgLoadEventTimer();
104 106
105 virtual AffineTransform* animateMotionTransform() { return 0; } 107 virtual AffineTransform* animateMotionTransform() { return 0; }
106 108
107 void invalidateSVGAttributes() { ensureUniqueElementData().m_animatedSVGAttr ibutesAreDirty = true; } 109 void invalidateSVGAttributes() { ensureUniqueElementData().m_animatedSVGAttr ibutesAreDirty = true; }
108 void invalidateSVGPresentationAttributeStyle() { ensureUniqueElementData().m _presentationAttributeStyleIsDirty = true; } 110 void invalidateSVGPresentationAttributeStyle() { ensureUniqueElementData().m _presentationAttributeStyleIsDirty = true; }
111 void addSVGLengthPropertyToPresentationAttributeStyle(MutableStylePropertySe t*, CSSPropertyID, SVGLength&);
109 112
110 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& instancesForEl ement() const; 113 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& instancesForEl ement() const;
111 void mapInstanceToElement(SVGElement*); 114 void mapInstanceToElement(SVGElement*);
112 void removeInstanceMapping(SVGElement*); 115 void removeInstanceMapping(SVGElement*);
113 116
114 bool getBoundingBox(FloatRect&); 117 bool getBoundingBox(FloatRect&);
115 118
116 void setCursorElement(SVGCursorElement*); 119 void setCursorElement(SVGCursorElement*);
117 void setCursorImageValue(CSSCursorImageValue*); 120 void setCursorImageValue(CSSCursorImageValue*);
118 121
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 private: 184 private:
182 RawPtrWillBeMember<SVGElement> m_targetElement; 185 RawPtrWillBeMember<SVGElement> m_targetElement;
183 }; 186 };
184 187
185 void invalidateInstances(); 188 void invalidateInstances();
186 189
187 virtual void trace(Visitor*) override; 190 virtual void trace(Visitor*) override;
188 191
189 static const AtomicString& eventParameterName(); 192 static const AtomicString& eventParameterName();
190 193
194 virtual bool isPresentationAttribute(const QualifiedName&) const override;
195
191 protected: 196 protected:
192 SVGElement(const QualifiedName&, Document&, ConstructionType = CreateSVGElem ent); 197 SVGElement(const QualifiedName&, Document&, ConstructionType = CreateSVGElem ent);
193 198
194 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr ide; 199 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr ide;
195 200
196 // FIXME: |parseAttributeNew| is a new implementation of parseAttribute 201 // FIXME: |parseAttributeNew| is a new implementation of parseAttribute
197 // which maps attribute using |m_attributeToPropertyMap|. 202 // which maps attribute using |m_attributeToPropertyMap|.
198 // This is to replace |parseAttribute()| after all derived class switch to c all this. 203 // This is to replace |parseAttribute()| after all derived class switch to c all this.
199 void parseAttributeNew(const QualifiedName&, const AtomicString&); 204 void parseAttributeNew(const QualifiedName&, const AtomicString&);
200 205
201 virtual void attributeChanged(const QualifiedName&, const AtomicString&, Att ributeModificationReason = ModifiedDirectly) override; 206 virtual void attributeChanged(const QualifiedName&, const AtomicString&, Att ributeModificationReason = ModifiedDirectly) override;
202 207
203 virtual bool isPresentationAttribute(const QualifiedName&) const override;
204 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons t AtomicString&, MutableStylePropertySet*) override; 208 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons t AtomicString&, MutableStylePropertySet*) override;
205 209
206 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; 210 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override;
207 virtual void removedFrom(ContainerNode*) override; 211 virtual void removedFrom(ContainerNode*) override;
208 virtual void childrenChanged(const ChildrenChange&) override; 212 virtual void childrenChanged(const ChildrenChange&) override;
209 213
210 static CSSPropertyID cssPropertyIdForSVGAttributeName(const QualifiedName&); 214 static CSSPropertyID cssPropertyIdForSVGAttributeName(const QualifiedName&);
211 void updateRelativeLengthsInformation() { updateRelativeLengthsInformation(s elfHasRelativeLengths(), this); } 215 void updateRelativeLengthsInformation() { updateRelativeLengthsInformation(s elfHasRelativeLengths(), this); }
212 void updateRelativeLengthsInformation(bool hasRelativeLengths, SVGElement*); 216 void updateRelativeLengthsInformation(bool hasRelativeLengths, SVGElement*);
213 static void markForLayoutAndParentResourceInvalidation(RenderObject*); 217 static void markForLayoutAndParentResourceInvalidation(RenderObject*);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 template<typename T> inline bool is##thisType(const PassRefPtrWillBeRawPtr<T >& node) { return is##thisType(node.get()); } \ 286 template<typename T> inline bool is##thisType(const PassRefPtrWillBeRawPtr<T >& node) { return is##thisType(node.get()); } \
283 template<typename T> inline bool is##thisType(const RefPtrWillBeMember<T>& n ode) { return is##thisType(node.get()); } \ 287 template<typename T> inline bool is##thisType(const RefPtrWillBeMember<T>& n ode) { return is##thisType(node.get()); } \
284 template <> inline bool isElementOfType<const thisType>(const SVGElement& el ement) { return is##thisType(element); } \ 288 template <> inline bool isElementOfType<const thisType>(const SVGElement& el ement) { return is##thisType(element); } \
285 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) 289 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType)
286 290
287 } // namespace blink 291 } // namespace blink
288 292
289 #include "core/SVGElementTypeHelpers.h" 293 #include "core/SVGElementTypeHelpers.h"
290 294
291 #endif // SVGElement_h 295 #endif // SVGElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698