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 26 matching lines...) Expand all Loading... |
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 virtual bool isPresentationAttributeWithSVGDOM(const QualifiedName&) const {
return false; } |
| 71 |
69 enum CTMScope { | 72 enum CTMScope { |
70 NearestViewportScope, // Used by SVGGraphicsElement::getCTM() | 73 NearestViewportScope, // Used by SVGGraphicsElement::getCTM() |
71 ScreenScope, // Used by SVGGraphicsElement::getScreenCTM() | 74 ScreenScope, // Used by SVGGraphicsElement::getScreenCTM() |
72 AncestorScope // Used by SVGSVGElement::get{Enclosure|Intersection}List(
) | 75 AncestorScope // Used by SVGSVGElement::get{Enclosure|Intersection}List(
) |
73 }; | 76 }; |
74 virtual AffineTransform localCoordinateSpaceTransform(CTMScope) const; | 77 virtual AffineTransform localCoordinateSpaceTransform(CTMScope) const; |
75 virtual bool needsPendingResourceHandling() const { return true; } | 78 virtual bool needsPendingResourceHandling() const { return true; } |
76 | 79 |
77 bool instanceUpdatesBlocked() const; | 80 bool instanceUpdatesBlocked() const; |
78 void setInstanceUpdatesBlocked(bool); | 81 void setInstanceUpdatesBlocked(bool); |
(...skipping 20 matching lines...) Expand all Loading... |
99 void sendSVGLoadEventToSelfAndAncestorChainIfPossible(); | 102 void sendSVGLoadEventToSelfAndAncestorChainIfPossible(); |
100 bool sendSVGLoadEventIfPossible(); | 103 bool sendSVGLoadEventIfPossible(); |
101 void sendSVGLoadEventIfPossibleAsynchronously(); | 104 void sendSVGLoadEventIfPossibleAsynchronously(); |
102 void svgLoadEventTimerFired(Timer<SVGElement>*); | 105 void svgLoadEventTimerFired(Timer<SVGElement>*); |
103 virtual Timer<SVGElement>* svgLoadEventTimer(); | 106 virtual Timer<SVGElement>* svgLoadEventTimer(); |
104 | 107 |
105 virtual AffineTransform* animateMotionTransform() { return 0; } | 108 virtual AffineTransform* animateMotionTransform() { return 0; } |
106 | 109 |
107 void invalidateSVGAttributes() { ensureUniqueElementData().m_animatedSVGAttr
ibutesAreDirty = true; } | 110 void invalidateSVGAttributes() { ensureUniqueElementData().m_animatedSVGAttr
ibutesAreDirty = true; } |
108 void invalidateSVGPresentationAttributeStyle() { ensureUniqueElementData().m
_presentationAttributeStyleIsDirty = true; } | 111 void invalidateSVGPresentationAttributeStyle() { ensureUniqueElementData().m
_presentationAttributeStyleIsDirty = true; } |
| 112 void addSVGLengthPropertyToPresentationAttributeStyle(MutableStylePropertySe
t*, CSSPropertyID, SVGLength&); |
109 | 113 |
110 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& instancesForEl
ement() const; | 114 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& instancesForEl
ement() const; |
111 void mapInstanceToElement(SVGElement*); | 115 void mapInstanceToElement(SVGElement*); |
112 void removeInstanceMapping(SVGElement*); | 116 void removeInstanceMapping(SVGElement*); |
113 | 117 |
114 bool getBoundingBox(FloatRect&); | 118 bool getBoundingBox(FloatRect&); |
115 | 119 |
116 void setCursorElement(SVGCursorElement*); | 120 void setCursorElement(SVGCursorElement*); |
117 void setCursorImageValue(CSSCursorImageValue*); | 121 void setCursorImageValue(CSSCursorImageValue*); |
118 | 122 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 private: | 185 private: |
182 RawPtrWillBeMember<SVGElement> m_targetElement; | 186 RawPtrWillBeMember<SVGElement> m_targetElement; |
183 }; | 187 }; |
184 | 188 |
185 void invalidateInstances(); | 189 void invalidateInstances(); |
186 | 190 |
187 virtual void trace(Visitor*) override; | 191 virtual void trace(Visitor*) override; |
188 | 192 |
189 static const AtomicString& eventParameterName(); | 193 static const AtomicString& eventParameterName(); |
190 | 194 |
| 195 virtual bool isPresentationAttribute(const QualifiedName&) const override; |
| 196 |
191 protected: | 197 protected: |
192 SVGElement(const QualifiedName&, Document&, ConstructionType = CreateSVGElem
ent); | 198 SVGElement(const QualifiedName&, Document&, ConstructionType = CreateSVGElem
ent); |
193 | 199 |
194 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; | 200 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; |
195 | 201 |
196 // FIXME: |parseAttributeNew| is a new implementation of parseAttribute | 202 // FIXME: |parseAttributeNew| is a new implementation of parseAttribute |
197 // which maps attribute using |m_attributeToPropertyMap|. | 203 // which maps attribute using |m_attributeToPropertyMap|. |
198 // This is to replace |parseAttribute()| after all derived class switch to c
all this. | 204 // This is to replace |parseAttribute()| after all derived class switch to c
all this. |
199 void parseAttributeNew(const QualifiedName&, const AtomicString&); | 205 void parseAttributeNew(const QualifiedName&, const AtomicString&); |
200 | 206 |
201 virtual void attributeChanged(const QualifiedName&, const AtomicString&, Att
ributeModificationReason = ModifiedDirectly) override; | 207 virtual void attributeChanged(const QualifiedName&, const AtomicString&, Att
ributeModificationReason = ModifiedDirectly) override; |
202 | 208 |
203 virtual bool isPresentationAttribute(const QualifiedName&) const override; | |
204 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons
t AtomicString&, MutableStylePropertySet*) override; | 209 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons
t AtomicString&, MutableStylePropertySet*) override; |
205 | 210 |
206 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; | 211 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; |
207 virtual void removedFrom(ContainerNode*) override; | 212 virtual void removedFrom(ContainerNode*) override; |
208 virtual void childrenChanged(const ChildrenChange&) override; | 213 virtual void childrenChanged(const ChildrenChange&) override; |
209 | 214 |
210 static CSSPropertyID cssPropertyIdForSVGAttributeName(const QualifiedName&); | 215 static CSSPropertyID cssPropertyIdForSVGAttributeName(const QualifiedName&); |
211 void updateRelativeLengthsInformation() { updateRelativeLengthsInformation(s
elfHasRelativeLengths(), this); } | 216 void updateRelativeLengthsInformation() { updateRelativeLengthsInformation(s
elfHasRelativeLengths(), this); } |
212 void updateRelativeLengthsInformation(bool hasRelativeLengths, SVGElement*); | 217 void updateRelativeLengthsInformation(bool hasRelativeLengths, SVGElement*); |
213 static void markForLayoutAndParentResourceInvalidation(RenderObject*); | 218 static void markForLayoutAndParentResourceInvalidation(RenderObject*); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 template<typename T> inline bool is##thisType(const PassRefPtrWillBeRawPtr<T
>& node) { return is##thisType(node.get()); } \ | 287 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()); } \ | 288 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); } \ | 289 template <> inline bool isElementOfType<const thisType>(const SVGElement& el
ement) { return is##thisType(element); } \ |
285 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) | 290 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) |
286 | 291 |
287 } // namespace blink | 292 } // namespace blink |
288 | 293 |
289 #include "core/SVGElementTypeHelpers.h" | 294 #include "core/SVGElementTypeHelpers.h" |
290 | 295 |
291 #endif // SVGElement_h | 296 #endif // SVGElement_h |
OLD | NEW |