| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> |
| 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "core/fetch/DocumentResource.h" | 25 #include "core/fetch/DocumentResource.h" |
| 26 #include "core/svg/SVGAnimatedBoolean.h" | 26 #include "core/svg/SVGAnimatedBoolean.h" |
| 27 #include "core/svg/SVGAnimatedLength.h" | 27 #include "core/svg/SVGAnimatedLength.h" |
| 28 #include "core/svg/SVGGraphicsElement.h" | 28 #include "core/svg/SVGGraphicsElement.h" |
| 29 #include "core/svg/SVGURIReference.h" | 29 #include "core/svg/SVGURIReference.h" |
| 30 | 30 |
| 31 namespace blink { | 31 namespace blink { |
| 32 | 32 |
| 33 class DocumentResource; | 33 class DocumentResource; |
| 34 | 34 |
| 35 class SVGUseElement FINAL : public SVGGraphicsElement, | 35 class SVGUseElement final : public SVGGraphicsElement, |
| 36 public SVGURIReference, | 36 public SVGURIReference, |
| 37 public DocumentResourceClient { | 37 public DocumentResourceClient { |
| 38 DEFINE_WRAPPERTYPEINFO(); | 38 DEFINE_WRAPPERTYPEINFO(); |
| 39 public: | 39 public: |
| 40 static PassRefPtrWillBeRawPtr<SVGUseElement> create(Document&); | 40 static PassRefPtrWillBeRawPtr<SVGUseElement> create(Document&); |
| 41 virtual ~SVGUseElement(); | 41 virtual ~SVGUseElement(); |
| 42 | 42 |
| 43 void invalidateShadowTree(); | 43 void invalidateShadowTree(); |
| 44 | 44 |
| 45 RenderObject* rendererClipChild() const; | 45 RenderObject* rendererClipChild() const; |
| 46 | 46 |
| 47 SVGAnimatedLength* x() const { return m_x.get(); } | 47 SVGAnimatedLength* x() const { return m_x.get(); } |
| 48 SVGAnimatedLength* y() const { return m_y.get(); } | 48 SVGAnimatedLength* y() const { return m_y.get(); } |
| 49 SVGAnimatedLength* width() const { return m_width.get(); } | 49 SVGAnimatedLength* width() const { return m_width.get(); } |
| 50 SVGAnimatedLength* height() const { return m_height.get(); } | 50 SVGAnimatedLength* height() const { return m_height.get(); } |
| 51 | 51 |
| 52 virtual void buildPendingResource() OVERRIDE; | 52 virtual void buildPendingResource() override; |
| 53 | 53 |
| 54 virtual void trace(Visitor*) OVERRIDE; | 54 virtual void trace(Visitor*) override; |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 explicit SVGUseElement(Document&); | 57 explicit SVGUseElement(Document&); |
| 58 | 58 |
| 59 virtual bool isStructurallyExternal() const OVERRIDE { return !hrefString().
isNull() && isExternalURIReference(hrefString(), document()); } | 59 virtual bool isStructurallyExternal() const override { return !hrefString().
isNull() && isExternalURIReference(hrefString(), document()); } |
| 60 | 60 |
| 61 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; | 61 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; |
| 62 virtual void removedFrom(ContainerNode*) OVERRIDE; | 62 virtual void removedFrom(ContainerNode*) override; |
| 63 | 63 |
| 64 bool isSupportedAttribute(const QualifiedName&); | 64 bool isSupportedAttribute(const QualifiedName&); |
| 65 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 65 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; |
| 66 virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE; | 66 virtual void svgAttributeChanged(const QualifiedName&) override; |
| 67 | 67 |
| 68 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; | 68 virtual RenderObject* createRenderer(RenderStyle*) override; |
| 69 virtual void toClipPath(Path&) OVERRIDE; | 69 virtual void toClipPath(Path&) override; |
| 70 | 70 |
| 71 void clearResourceReferences(); | 71 void clearResourceReferences(); |
| 72 void buildShadowAndInstanceTree(SVGElement* target); | 72 void buildShadowAndInstanceTree(SVGElement* target); |
| 73 | 73 |
| 74 void scheduleShadowTreeRecreation(); | 74 void scheduleShadowTreeRecreation(); |
| 75 virtual bool haveLoadedRequiredResources() OVERRIDE { return !isStructurally
External() || m_haveFiredLoadEvent; } | 75 virtual bool haveLoadedRequiredResources() override { return !isStructurally
External() || m_haveFiredLoadEvent; } |
| 76 | 76 |
| 77 virtual bool selfHasRelativeLengths() const OVERRIDE; | 77 virtual bool selfHasRelativeLengths() const override; |
| 78 | 78 |
| 79 // Instance tree handling | 79 // Instance tree handling |
| 80 bool buildShadowTree(SVGElement* target, SVGElement* targetInstance, bool fo
undUse); | 80 bool buildShadowTree(SVGElement* target, SVGElement* targetInstance, bool fo
undUse); |
| 81 bool hasCycleUseReferencing(SVGUseElement*, ContainerNode* targetInstance, S
VGElement*& newTarget); | 81 bool hasCycleUseReferencing(SVGUseElement*, ContainerNode* targetInstance, S
VGElement*& newTarget); |
| 82 bool expandUseElementsInShadowTree(SVGElement*); | 82 bool expandUseElementsInShadowTree(SVGElement*); |
| 83 void expandSymbolElementsInShadowTree(SVGElement*); | 83 void expandSymbolElementsInShadowTree(SVGElement*); |
| 84 | 84 |
| 85 void transferUseAttributesToReplacedElement(SVGElement* from, SVGElement* to
) const; | 85 void transferUseAttributesToReplacedElement(SVGElement* from, SVGElement* to
) const; |
| 86 | 86 |
| 87 void invalidateDependentShadowTrees(); | 87 void invalidateDependentShadowTrees(); |
| 88 | 88 |
| 89 bool resourceIsStillLoading(); | 89 bool resourceIsStillLoading(); |
| 90 Document* externalDocument() const; | 90 Document* externalDocument() const; |
| 91 bool instanceTreeIsLoading(SVGElement*); | 91 bool instanceTreeIsLoading(SVGElement*); |
| 92 virtual void notifyFinished(Resource*) OVERRIDE; | 92 virtual void notifyFinished(Resource*) override; |
| 93 TreeScope* referencedScope() const; | 93 TreeScope* referencedScope() const; |
| 94 void setDocumentResource(ResourcePtr<DocumentResource>); | 94 void setDocumentResource(ResourcePtr<DocumentResource>); |
| 95 | 95 |
| 96 virtual Timer<SVGElement>* svgLoadEventTimer() OVERRIDE { return &m_svgLoadE
ventTimer; } | 96 virtual Timer<SVGElement>* svgLoadEventTimer() override { return &m_svgLoadE
ventTimer; } |
| 97 | 97 |
| 98 RefPtr<SVGAnimatedLength> m_x; | 98 RefPtr<SVGAnimatedLength> m_x; |
| 99 RefPtr<SVGAnimatedLength> m_y; | 99 RefPtr<SVGAnimatedLength> m_y; |
| 100 RefPtr<SVGAnimatedLength> m_width; | 100 RefPtr<SVGAnimatedLength> m_width; |
| 101 RefPtr<SVGAnimatedLength> m_height; | 101 RefPtr<SVGAnimatedLength> m_height; |
| 102 | 102 |
| 103 bool m_haveFiredLoadEvent; | 103 bool m_haveFiredLoadEvent; |
| 104 bool m_needsShadowTreeRecreation; | 104 bool m_needsShadowTreeRecreation; |
| 105 RefPtrWillBeMember<SVGElement> m_targetElementInstance; | 105 RefPtrWillBeMember<SVGElement> m_targetElementInstance; |
| 106 ResourcePtr<DocumentResource> m_resource; | 106 ResourcePtr<DocumentResource> m_resource; |
| 107 Timer<SVGElement> m_svgLoadEventTimer; | 107 Timer<SVGElement> m_svgLoadEventTimer; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 } // namespace blink | 110 } // namespace blink |
| 111 | 111 |
| 112 #endif // SVGUseElement_h | 112 #endif // SVGUseElement_h |
| OLD | NEW |