| 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 21 matching lines...) Expand all Loading... |
| 32 namespace blink { | 32 namespace blink { |
| 33 | 33 |
| 34 using SVGUseEventSender = EventSender<SVGUseElement>; | 34 using SVGUseEventSender = EventSender<SVGUseElement>; |
| 35 | 35 |
| 36 class SVGUseElement final : public SVGGraphicsElement, | 36 class SVGUseElement final : public SVGGraphicsElement, |
| 37 public SVGURIReference, | 37 public SVGURIReference, |
| 38 public DocumentResourceClient { | 38 public DocumentResourceClient { |
| 39 | 39 |
| 40 DEFINE_WRAPPERTYPEINFO(); | 40 DEFINE_WRAPPERTYPEINFO(); |
| 41 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SVGUseElement); | 41 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SVGUseElement); |
| 42 WILL_BE_USING_PRE_FINALIZER(SVGUseElement, dispose); |
| 42 public: | 43 public: |
| 43 static PassRefPtrWillBeRawPtr<SVGUseElement> create(Document&); | 44 static PassRefPtrWillBeRawPtr<SVGUseElement> create(Document&); |
| 44 ~SVGUseElement() override; | 45 ~SVGUseElement() override; |
| 45 | 46 |
| 46 void invalidateShadowTree(); | 47 void invalidateShadowTree(); |
| 47 | 48 |
| 48 // Return the element that should be used for clipping, | 49 // Return the element that should be used for clipping, |
| 49 // or null if a valid clip element is not directly referenced. | 50 // or null if a valid clip element is not directly referenced. |
| 50 SVGGraphicsElement* targetGraphicsElementForClipping() const; | 51 SVGGraphicsElement* targetGraphicsElementForClipping() const; |
| 51 | 52 |
| 52 SVGAnimatedLength* x() const { return m_x.get(); } | 53 SVGAnimatedLength* x() const { return m_x.get(); } |
| 53 SVGAnimatedLength* y() const { return m_y.get(); } | 54 SVGAnimatedLength* y() const { return m_y.get(); } |
| 54 SVGAnimatedLength* width() const { return m_width.get(); } | 55 SVGAnimatedLength* width() const { return m_width.get(); } |
| 55 SVGAnimatedLength* height() const { return m_height.get(); } | 56 SVGAnimatedLength* height() const { return m_height.get(); } |
| 56 | 57 |
| 57 void buildPendingResource() override; | 58 void buildPendingResource() override; |
| 58 | 59 |
| 59 void dispatchPendingEvent(SVGUseEventSender*); | 60 void dispatchPendingEvent(SVGUseEventSender*); |
| 60 void toClipPath(Path&) const; | 61 void toClipPath(Path&) const; |
| 61 | 62 |
| 62 DECLARE_VIRTUAL_TRACE(); | 63 DECLARE_VIRTUAL_TRACE(); |
| 63 | 64 |
| 64 private: | 65 private: |
| 65 explicit SVGUseElement(Document&); | 66 explicit SVGUseElement(Document&); |
| 66 | 67 |
| 68 void dispose(); |
| 69 |
| 67 FloatRect getBBox() override; | 70 FloatRect getBBox() override; |
| 68 | 71 |
| 69 bool isPresentationAttribute(const QualifiedName&) const override; | 72 bool isPresentationAttribute(const QualifiedName&) const override; |
| 70 void collectStyleForPresentationAttribute(const QualifiedName&, const Atomic
String&, MutableStylePropertySet*) override; | 73 void collectStyleForPresentationAttribute(const QualifiedName&, const Atomic
String&, MutableStylePropertySet*) override; |
| 71 bool isPresentationAttributeWithSVGDOM(const QualifiedName&) const override; | 74 bool isPresentationAttributeWithSVGDOM(const QualifiedName&) const override; |
| 72 | 75 |
| 73 bool isStructurallyExternal() const override { return !hrefString().isNull()
&& isExternalURIReference(hrefString(), document()); } | 76 bool isStructurallyExternal() const override { return !hrefString().isNull()
&& isExternalURIReference(hrefString(), document()); } |
| 74 | 77 |
| 75 InsertionNotificationRequest insertedInto(ContainerNode*) override; | 78 InsertionNotificationRequest insertedInto(ContainerNode*) override; |
| 76 void removedFrom(ContainerNode*) override; | 79 void removedFrom(ContainerNode*) override; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 97 void transferUseAttributesToReplacedElement(SVGElement* from, SVGElement* to
) const; | 100 void transferUseAttributesToReplacedElement(SVGElement* from, SVGElement* to
) const; |
| 98 | 101 |
| 99 void invalidateDependentShadowTrees(); | 102 void invalidateDependentShadowTrees(); |
| 100 | 103 |
| 101 bool resourceIsStillLoading() const; | 104 bool resourceIsStillLoading() const; |
| 102 Document* externalDocument() const; | 105 Document* externalDocument() const; |
| 103 bool instanceTreeIsLoading(const SVGElement*); | 106 bool instanceTreeIsLoading(const SVGElement*); |
| 104 void notifyFinished(Resource*) override; | 107 void notifyFinished(Resource*) override; |
| 105 String debugName() const override { return "SVGUseElement"; } | 108 String debugName() const override { return "SVGUseElement"; } |
| 106 TreeScope* referencedScope() const; | 109 TreeScope* referencedScope() const; |
| 107 void setDocumentResource(ResourcePtr<DocumentResource>); | 110 void setDocumentResource(PassRefPtrWillBeRawPtr<DocumentResource>); |
| 108 | 111 |
| 109 RefPtrWillBeMember<SVGAnimatedLength> m_x; | 112 RefPtrWillBeMember<SVGAnimatedLength> m_x; |
| 110 RefPtrWillBeMember<SVGAnimatedLength> m_y; | 113 RefPtrWillBeMember<SVGAnimatedLength> m_y; |
| 111 RefPtrWillBeMember<SVGAnimatedLength> m_width; | 114 RefPtrWillBeMember<SVGAnimatedLength> m_width; |
| 112 RefPtrWillBeMember<SVGAnimatedLength> m_height; | 115 RefPtrWillBeMember<SVGAnimatedLength> m_height; |
| 113 | 116 |
| 114 bool m_haveFiredLoadEvent; | 117 bool m_haveFiredLoadEvent; |
| 115 bool m_needsShadowTreeRecreation; | 118 bool m_needsShadowTreeRecreation; |
| 116 RefPtrWillBeMember<SVGElement> m_targetElementInstance; | 119 RefPtrWillBeMember<SVGElement> m_targetElementInstance; |
| 117 ResourcePtr<DocumentResource> m_resource; | 120 RefPtrWillBeMember<DocumentResource> m_resource; |
| 118 }; | 121 }; |
| 119 | 122 |
| 120 } // namespace blink | 123 } // namespace blink |
| 121 | 124 |
| 122 #endif // SVGUseElement_h | 125 #endif // SVGUseElement_h |
| OLD | NEW |