| 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 "core/events/EventSender.h" | |
| 25 #include "core/fetch/DocumentResource.h" | 24 #include "core/fetch/DocumentResource.h" |
| 26 #include "core/svg/SVGAnimatedLength.h" | 25 #include "core/svg/SVGAnimatedLength.h" |
| 27 #include "core/svg/SVGGeometryElement.h" | 26 #include "core/svg/SVGGeometryElement.h" |
| 28 #include "core/svg/SVGGraphicsElement.h" | 27 #include "core/svg/SVGGraphicsElement.h" |
| 29 #include "core/svg/SVGURIReference.h" | 28 #include "core/svg/SVGURIReference.h" |
| 30 #include "platform/heap/Handle.h" | 29 #include "platform/heap/Handle.h" |
| 31 | 30 |
| 32 namespace blink { | 31 namespace blink { |
| 33 | 32 |
| 34 using SVGUseEventSender = EventSender<SVGUseElement>; | |
| 35 | |
| 36 class SVGUseElement final : public SVGGraphicsElement, | 33 class SVGUseElement final : public SVGGraphicsElement, |
| 37 public SVGURIReference, | 34 public SVGURIReference, |
| 38 public DocumentResourceClient { | 35 public DocumentResourceClient { |
| 39 DEFINE_WRAPPERTYPEINFO(); | 36 DEFINE_WRAPPERTYPEINFO(); |
| 40 USING_GARBAGE_COLLECTED_MIXIN(SVGUseElement); | 37 USING_GARBAGE_COLLECTED_MIXIN(SVGUseElement); |
| 41 USING_PRE_FINALIZER(SVGUseElement, dispose); | 38 USING_PRE_FINALIZER(SVGUseElement, dispose); |
| 42 | 39 |
| 43 public: | 40 public: |
| 44 static SVGUseElement* create(Document&); | 41 static SVGUseElement* create(Document&); |
| 45 ~SVGUseElement() override; | 42 ~SVGUseElement() override; |
| 46 | 43 |
| 47 void invalidateShadowTree(); | 44 void invalidateShadowTree(); |
| 48 | 45 |
| 49 // Return the element that should be used for clipping, | 46 // Return the element that should be used for clipping, |
| 50 // or null if a valid clip element is not directly referenced. | 47 // or null if a valid clip element is not directly referenced. |
| 51 SVGGraphicsElement* visibleTargetGraphicsElementForClipping() const; | 48 SVGGraphicsElement* visibleTargetGraphicsElementForClipping() const; |
| 52 | 49 |
| 53 SVGAnimatedLength* x() const { return m_x.get(); } | 50 SVGAnimatedLength* x() const { return m_x.get(); } |
| 54 SVGAnimatedLength* y() const { return m_y.get(); } | 51 SVGAnimatedLength* y() const { return m_y.get(); } |
| 55 SVGAnimatedLength* width() const { return m_width.get(); } | 52 SVGAnimatedLength* width() const { return m_width.get(); } |
| 56 SVGAnimatedLength* height() const { return m_height.get(); } | 53 SVGAnimatedLength* height() const { return m_height.get(); } |
| 57 | 54 |
| 58 void buildPendingResource() override; | 55 void buildPendingResource() override; |
| 59 | 56 |
| 60 void dispatchPendingEvent(SVGUseEventSender*); | 57 void dispatchPendingEvent(); |
| 61 void toClipPath(Path&) const; | 58 void toClipPath(Path&) const; |
| 62 | 59 |
| 63 DECLARE_VIRTUAL_TRACE(); | 60 DECLARE_VIRTUAL_TRACE(); |
| 64 | 61 |
| 65 private: | 62 private: |
| 66 explicit SVGUseElement(Document&); | 63 explicit SVGUseElement(Document&); |
| 67 | 64 |
| 68 void dispose(); | 65 void dispose(); |
| 69 | 66 |
| 70 FloatRect getBBox() override; | 67 FloatRect getBBox() override; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 bool m_elementIdentifierIsLocal; | 120 bool m_elementIdentifierIsLocal; |
| 124 bool m_haveFiredLoadEvent; | 121 bool m_haveFiredLoadEvent; |
| 125 bool m_needsShadowTreeRecreation; | 122 bool m_needsShadowTreeRecreation; |
| 126 Member<SVGElement> m_targetElementInstance; | 123 Member<SVGElement> m_targetElementInstance; |
| 127 Member<DocumentResource> m_resource; | 124 Member<DocumentResource> m_resource; |
| 128 }; | 125 }; |
| 129 | 126 |
| 130 } // namespace blink | 127 } // namespace blink |
| 131 | 128 |
| 132 #endif // SVGUseElement_h | 129 #endif // SVGUseElement_h |
| OLD | NEW |