Chromium Code Reviews| 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, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
| 14 * | 14 * |
| 15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
| 16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
| 19 */ | 19 */ |
| 20 | 20 |
| 21 #ifndef SVGUseElement_h | 21 #ifndef SVGUseElement_h |
| 22 #define SVGUseElement_h | 22 #define SVGUseElement_h |
| 23 | 23 |
| 24 #include "SVGNames.h" | 24 #include "SVGNames.h" |
| 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/SVGExternalResourcesRequired.h" | |
| 29 #include "core/svg/SVGGraphicsElement.h" | 28 #include "core/svg/SVGGraphicsElement.h" |
| 30 #include "core/svg/SVGURIReference.h" | 29 #include "core/svg/SVGURIReference.h" |
| 31 | 30 |
| 32 namespace WebCore { | 31 namespace WebCore { |
| 33 | 32 |
| 34 class DocumentResource; | 33 class DocumentResource; |
| 35 class SVGElementInstance; | 34 class SVGElementInstance; |
| 36 | 35 |
| 37 class SVGUseElement FINAL : public SVGGraphicsElement, | 36 class SVGUseElement FINAL : public SVGGraphicsElement, |
| 38 public SVGExternalResourcesRequired, | |
| 39 public SVGURIReference, | 37 public SVGURIReference, |
| 40 public DocumentResourceClient { | 38 public DocumentResourceClient { |
| 41 public: | 39 public: |
| 42 static PassRefPtr<SVGUseElement> create(const QualifiedName&, Document&, boo l wasInsertedByParser); | 40 static PassRefPtr<SVGUseElement> create(const QualifiedName&, Document&, boo l wasInsertedByParser); |
| 43 virtual ~SVGUseElement(); | 41 virtual ~SVGUseElement(); |
| 44 | 42 |
| 45 SVGElementInstance* instanceRoot(); | 43 SVGElementInstance* instanceRoot(); |
| 46 SVGElementInstance* animatedInstanceRoot() const; | 44 SVGElementInstance* animatedInstanceRoot() const; |
| 47 SVGElementInstance* instanceForShadowTreeElement(Node*) const; | 45 SVGElementInstance* instanceForShadowTreeElement(Node*) const; |
| 48 void invalidateShadowTree(); | 46 void invalidateShadowTree(); |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 67 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; | 65 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; |
| 68 virtual void willRecalcStyle(StyleRecalcChange) OVERRIDE; | 66 virtual void willRecalcStyle(StyleRecalcChange) OVERRIDE; |
| 69 | 67 |
| 70 virtual RenderObject* createRenderer(RenderStyle*); | 68 virtual RenderObject* createRenderer(RenderStyle*); |
| 71 virtual void toClipPath(Path&); | 69 virtual void toClipPath(Path&); |
| 72 | 70 |
| 73 void clearResourceReferences(); | 71 void clearResourceReferences(); |
| 74 void buildShadowAndInstanceTree(SVGElement* target); | 72 void buildShadowAndInstanceTree(SVGElement* target); |
| 75 void detachInstance(); | 73 void detachInstance(); |
| 76 | 74 |
| 77 virtual bool haveLoadedRequiredResources() { return SVGExternalResourcesRequ ired::haveLoadedRequiredResources(); } | 75 virtual bool haveLoadedRequiredResources() { return m_haveFiredLoadEvent; } |
|
Stephen Chennney
2013/11/06 16:45:43
Ditto. In particular, if these are virtual, what v
Erik Dahlström (inactive)
2013/11/07 09:38:04
SVGElement::haveLoadedRequiredResources is virtual
| |
| 78 | 76 |
| 79 virtual void finishParsingChildren(); | 77 virtual void finishParsingChildren(); |
| 80 virtual bool selfHasRelativeLengths() const; | 78 virtual bool selfHasRelativeLengths() const; |
| 81 | 79 |
| 82 // Instance tree handling | 80 // Instance tree handling |
| 83 void buildInstanceTree(SVGElement* target, SVGElementInstance* targetInstanc e, bool& foundCycle, bool foundUse); | 81 void buildInstanceTree(SVGElement* target, SVGElementInstance* targetInstanc e, bool& foundCycle, bool foundUse); |
| 84 bool hasCycleUseReferencing(SVGUseElement*, SVGElementInstance* targetInstan ce, SVGElement*& newTarget); | 82 bool hasCycleUseReferencing(SVGUseElement*, SVGElementInstance* targetInstan ce, SVGElement*& newTarget); |
| 85 | 83 |
| 86 // Shadow tree handling | 84 // Shadow tree handling |
| 87 void buildShadowTree(SVGElement* target, SVGElementInstance* targetInstance) ; | 85 void buildShadowTree(SVGElement* target, SVGElementInstance* targetInstance) ; |
| 88 | 86 |
| 89 void expandUseElementsInShadowTree(Node* element); | 87 void expandUseElementsInShadowTree(Node* element); |
| 90 void expandSymbolElementsInShadowTree(Node* element); | 88 void expandSymbolElementsInShadowTree(Node* element); |
| 91 | 89 |
| 92 // "Tree connector" | 90 // "Tree connector" |
| 93 void associateInstancesWithShadowTreeElements(Node* target, SVGElementInstan ce* targetInstance); | 91 void associateInstancesWithShadowTreeElements(Node* target, SVGElementInstan ce* targetInstance); |
| 94 SVGElementInstance* instanceForShadowTreeElement(Node* element, SVGElementIn stance* instance) const; | 92 SVGElementInstance* instanceForShadowTreeElement(Node* element, SVGElementIn stance* instance) const; |
| 95 | 93 |
| 96 void transferUseAttributesToReplacedElement(SVGElement* from, SVGElement* to ) const; | 94 void transferUseAttributesToReplacedElement(SVGElement* from, SVGElement* to ) const; |
| 97 void transferEventListenersToShadowTree(SVGElementInstance* target); | 95 void transferEventListenersToShadowTree(SVGElementInstance* target); |
| 98 | 96 |
| 99 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGUseElement) | 97 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGUseElement) |
| 100 DECLARE_ANIMATED_LENGTH(X, x) | 98 DECLARE_ANIMATED_LENGTH(X, x) |
| 101 DECLARE_ANIMATED_LENGTH(Y, y) | 99 DECLARE_ANIMATED_LENGTH(Y, y) |
| 102 DECLARE_ANIMATED_LENGTH(Width, width) | 100 DECLARE_ANIMATED_LENGTH(Width, width) |
| 103 DECLARE_ANIMATED_LENGTH(Height, height) | 101 DECLARE_ANIMATED_LENGTH(Height, height) |
| 104 DECLARE_ANIMATED_STRING(Href, href) | 102 DECLARE_ANIMATED_STRING(Href, href) |
| 105 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesReq uired) | |
| 106 END_DECLARE_ANIMATED_PROPERTIES | 103 END_DECLARE_ANIMATED_PROPERTIES |
| 107 | 104 |
| 108 bool resourceIsStillLoading(); | 105 bool resourceIsStillLoading(); |
| 109 Document* externalDocument() const; | 106 Document* externalDocument() const; |
| 110 bool instanceTreeIsLoading(SVGElementInstance*); | 107 bool instanceTreeIsLoading(SVGElementInstance*); |
| 111 virtual void notifyFinished(Resource*); | 108 virtual void notifyFinished(Resource*); |
| 112 Document* referencedDocument() const; | 109 Document* referencedDocument() const; |
| 113 void setDocumentResource(ResourcePtr<DocumentResource>); | 110 void setDocumentResource(ResourcePtr<DocumentResource>); |
| 114 | 111 |
| 115 // SVGExternalResourcesRequired | |
| 116 virtual void setHaveFiredLoadEvent(bool haveFiredLoadEvent) { m_haveFiredLoa dEvent = haveFiredLoadEvent; } | |
| 117 virtual bool isParserInserted() const { return m_wasInsertedByParser; } | |
| 118 virtual bool haveFiredLoadEvent() const { return m_haveFiredLoadEvent; } | |
| 119 virtual Timer<SVGElement>* svgLoadEventTimer() OVERRIDE { return &m_svgLoadE ventTimer; } | 112 virtual Timer<SVGElement>* svgLoadEventTimer() OVERRIDE { return &m_svgLoadE ventTimer; } |
| 120 | 113 |
| 121 bool m_wasInsertedByParser; | 114 bool m_wasInsertedByParser; |
| 122 bool m_haveFiredLoadEvent; | 115 bool m_haveFiredLoadEvent; |
| 123 bool m_needsShadowTreeRecreation; | 116 bool m_needsShadowTreeRecreation; |
| 124 RefPtr<SVGElementInstance> m_targetElementInstance; | 117 RefPtr<SVGElementInstance> m_targetElementInstance; |
| 125 ResourcePtr<DocumentResource> m_resource; | 118 ResourcePtr<DocumentResource> m_resource; |
| 126 Timer<SVGElement> m_svgLoadEventTimer; | 119 Timer<SVGElement> m_svgLoadEventTimer; |
| 127 }; | 120 }; |
| 128 | 121 |
| 129 DEFINE_NODE_TYPE_CASTS(SVGUseElement, hasTagName(SVGNames::useTag)); | 122 DEFINE_NODE_TYPE_CASTS(SVGUseElement, hasTagName(SVGNames::useTag)); |
| 130 | 123 |
| 131 } | 124 } |
| 132 | 125 |
| 133 #endif | 126 #endif |
| OLD | NEW |